mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-04 20:03:39 +00:00
Check h_evals/h_commitments lengths in vanishing argument verifier.
This commit is contained in:
parent
bd73089123
commit
65ed1d8568
3 changed files with 14 additions and 3 deletions
|
|
@ -9,10 +9,14 @@ use crate::{
|
|||
};
|
||||
|
||||
impl<C: CurveAffine> Proof<C> {
|
||||
pub(in crate::plonk) fn check_lengths(&self, _vk: &VerifyingKey<C>) -> Result<(), Error> {
|
||||
// TODO: check h_evals
|
||||
pub(in crate::plonk) fn check_lengths(&self, vk: &VerifyingKey<C>) -> Result<(), Error> {
|
||||
if self.h_commitments.len() != self.h_evals.len() {
|
||||
return Err(Error::IncompatibleParams);
|
||||
}
|
||||
|
||||
// TODO: check h_commitments
|
||||
if self.h_commitments.len() != vk.domain.get_quotient_poly_degree() {
|
||||
return Err(Error::IncompatibleParams);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,6 +182,8 @@ impl<'a, C: CurveAffine> Proof<C> {
|
|||
.map(|p| p.check_lengths(vk))
|
||||
.transpose()?;
|
||||
|
||||
self.vanishing.check_lengths(vk)?;
|
||||
|
||||
if self.lookups.len() != vk.cs.lookups.len() {
|
||||
return Err(Error::IncompatibleParams);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -382,4 +382,9 @@ impl<G: Group> EvaluationDomain<G> {
|
|||
pub fn get_barycentric_weight(&self) -> G::Scalar {
|
||||
self.barycentric_weight
|
||||
}
|
||||
|
||||
/// Gets the quotient polynomial's degree (as a multiple of n)
|
||||
pub fn get_quotient_poly_degree(&self) -> usize {
|
||||
self.quotient_poly_degree as usize
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue