mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-03 19:53:40 +00:00
Introduce Accumulator struct and return it in use_g()
This commit is contained in:
parent
0633086ac1
commit
ed8130b7bf
1 changed files with 17 additions and 2 deletions
|
|
@ -23,6 +23,16 @@ pub struct OpeningProof<C: CurveAffine> {
|
|||
z2: C::Scalar,
|
||||
}
|
||||
|
||||
/// TODO: documentation
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Accumulator<C: CurveAffine> {
|
||||
/// TODO: documentation
|
||||
pub g: C,
|
||||
|
||||
/// TODO: documentation
|
||||
pub challenges_sq_packed: Vec<Challenge>,
|
||||
}
|
||||
|
||||
/// A multiscalar multiplication in the polynomial commitment scheme
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct MSM<'a, C: CurveAffine> {
|
||||
|
|
@ -267,11 +277,16 @@ impl<'a, C: CurveAffine> Guard<'a, C> {
|
|||
|
||||
/// Lets caller supply the purported G point and simply appends it to
|
||||
/// return an updated MSM.
|
||||
pub fn use_g(mut self, g: C) -> MSM<'a, C> {
|
||||
pub fn use_g(mut self, g: C) -> (MSM<'a, C>, Accumulator<C>) {
|
||||
&self.msm.other_scalars.push(self.neg_z1);
|
||||
&self.msm.other_bases.push(g);
|
||||
|
||||
self.msm
|
||||
let accumulator = Accumulator {
|
||||
g,
|
||||
challenges_sq_packed: self.challenges_sq_packed,
|
||||
};
|
||||
|
||||
(self.msm, accumulator)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue