mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-08 20:40:31 +00:00
Use the correct permutation values from the SRS.
This commit is contained in:
parent
d601533bd7
commit
4a88d52457
3 changed files with 10 additions and 4 deletions
|
|
@ -33,6 +33,7 @@ pub struct SRS<C: CurveAffine> {
|
||||||
fixed_polys: Vec<Vec<C::Scalar>>,
|
fixed_polys: Vec<Vec<C::Scalar>>,
|
||||||
fixed_cosets: Vec<Vec<C::Scalar>>,
|
fixed_cosets: Vec<Vec<C::Scalar>>,
|
||||||
permutation_commitments: Vec<Vec<C>>,
|
permutation_commitments: Vec<Vec<C>>,
|
||||||
|
permutations: Vec<Vec<Vec<C::Scalar>>>,
|
||||||
permutation_polys: Vec<Vec<Vec<C::Scalar>>>,
|
permutation_polys: Vec<Vec<Vec<C::Scalar>>>,
|
||||||
permutation_cosets: Vec<Vec<Vec<C::Scalar>>>,
|
permutation_cosets: Vec<Vec<Vec<C::Scalar>>>,
|
||||||
meta: MetaCircuit<C::Scalar>,
|
meta: MetaCircuit<C::Scalar>,
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ impl<C: CurveAffine> Proof<C> {
|
||||||
let mut permutation_product_blinds = vec![];
|
let mut permutation_product_blinds = vec![];
|
||||||
|
|
||||||
// Iterate over each permutation
|
// Iterate over each permutation
|
||||||
for (wires, permutations) in srs.meta.permutations.iter().zip(srs.permutation_polys) {
|
for (wires, permutations) in srs.meta.permutations.iter().zip(srs.permutations.iter()) {
|
||||||
// Goal is to compute the fraction
|
// Goal is to compute the fraction
|
||||||
//
|
//
|
||||||
// (p_j(\omega^i) + \delta^j \omega^i \beta + \gamma) /
|
// (p_j(\omega^i) + \delta^j \omega^i \beta + \gamma) /
|
||||||
|
|
|
||||||
|
|
@ -146,10 +146,12 @@ impl<C: CurveAffine> SRS<C> {
|
||||||
// Compute permutation polynomials, convert to coset form and
|
// Compute permutation polynomials, convert to coset form and
|
||||||
// pre-compute commitments for the SRS.
|
// pre-compute commitments for the SRS.
|
||||||
let mut permutation_commitments = vec![];
|
let mut permutation_commitments = vec![];
|
||||||
|
let mut permutations = vec![];
|
||||||
let mut permutation_polys = vec![];
|
let mut permutation_polys = vec![];
|
||||||
let mut permutation_cosets = vec![];
|
let mut permutation_cosets = vec![];
|
||||||
for (permutation_index, permutation) in meta.permutations.iter().enumerate() {
|
for (permutation_index, permutation) in meta.permutations.iter().enumerate() {
|
||||||
let mut commitments = vec![];
|
let mut commitments = vec![];
|
||||||
|
let mut inner_permutations = vec![];
|
||||||
let mut polys = vec![];
|
let mut polys = vec![];
|
||||||
let mut cosets = vec![];
|
let mut cosets = vec![];
|
||||||
for (i, _) in permutation.iter().enumerate() {
|
for (i, _) in permutation.iter().enumerate() {
|
||||||
|
|
@ -172,11 +174,13 @@ impl<C: CurveAffine> SRS<C> {
|
||||||
.to_affine(),
|
.to_affine(),
|
||||||
);
|
);
|
||||||
// Store permutation polynomial and precompute its coset evaluation
|
// Store permutation polynomial and precompute its coset evaluation
|
||||||
polys.push(permutation_poly.clone());
|
inner_permutations.push(permutation_poly.clone());
|
||||||
let permutation_poly = domain.obtain_poly(permutation_poly);
|
let poly = domain.obtain_poly(permutation_poly);
|
||||||
cosets.push(domain.obtain_coset(permutation_poly, Rotation::default()));
|
polys.push(poly.clone());
|
||||||
|
cosets.push(domain.obtain_coset(poly, Rotation::default()));
|
||||||
}
|
}
|
||||||
permutation_commitments.push(commitments);
|
permutation_commitments.push(commitments);
|
||||||
|
permutations.push(inner_permutations);
|
||||||
permutation_polys.push(polys);
|
permutation_polys.push(polys);
|
||||||
permutation_cosets.push(cosets);
|
permutation_cosets.push(cosets);
|
||||||
}
|
}
|
||||||
|
|
@ -208,6 +212,7 @@ impl<C: CurveAffine> SRS<C> {
|
||||||
fixed_polys,
|
fixed_polys,
|
||||||
fixed_cosets,
|
fixed_cosets,
|
||||||
permutation_commitments,
|
permutation_commitments,
|
||||||
|
permutations,
|
||||||
permutation_polys,
|
permutation_polys,
|
||||||
permutation_cosets,
|
permutation_cosets,
|
||||||
meta,
|
meta,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue