Skip to content

Commit

Permalink
Merge branch 'privacy-scaling-explorations:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Brechtpd authored May 29, 2023
2 parents 94db00c + 468a752 commit d0b65f4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions halo2_proofs/src/poly/kzg/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,30 @@ where
}
}

/// Initializes parameters for the curve through existing parameters
/// k, g, g_lagrange (optional), g2, s_g2
pub fn from_parts(
&self,
k: u32,
g: Vec<E::G1Affine>,
g_lagrange: Option<Vec<E::G1Affine>>,
g2: E::G2Affine,
s_g2: E::G2Affine,
) -> Self {
Self {
k,
n: 1 << k,
g_lagrange: if let Some(g_l) = g_lagrange {
g_l
} else {
g_to_lagrange(g.iter().map(PrimeCurveAffine::to_curve).collect(), k)
},
g,
g2,
s_g2,
}
}

/// Returns gernerator on G2
pub fn g2(&self) -> E::G2Affine {
self.g2
Expand Down

0 comments on commit d0b65f4

Please sign in to comment.