pub struct PedersenGadget<C: SonobeCurve, const H: bool> { /* private fields */ }Expand description
PedersenGadget defines the in-circuit Pedersen gadget that operates over
the base field of the curve and supports canonical elliptic curve point
variables as commitments, where H controls whether the scheme is hiding or
not.
Trait Implementations§
Source§impl<C: Clone + SonobeCurve, const H: bool> Clone for PedersenGadget<C, H>
impl<C: Clone + SonobeCurve, const H: bool> Clone for PedersenGadget<C, H>
Source§fn clone(&self) -> PedersenGadget<C, H>
fn clone(&self) -> PedersenGadget<C, H>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C: SonobeCurve> CommitmentDefGadget for PedersenGadget<C, false>
impl<C: SonobeCurve> CommitmentDefGadget for PedersenGadget<C, false>
Source§type ConstraintField = <<C as CurveGroup>::BaseField as Field>::BasePrimeField
type ConstraintField = <<C as CurveGroup>::BaseField as Field>::BasePrimeField
CommitmentDefGadget::ConstraintField is the field over which the
circuit running the commitment scheme is defined.Source§type KeyVar = PedersenKeyVar<C, false>
type KeyVar = PedersenKeyVar<C, false>
CommitmentDefGadget::KeyVar is the in-circuit variable type for the
commitment key.Source§type ScalarVar = LimbedVar<<<C as CurveGroup>::BaseField as Field>::BasePrimeField, <C as PrimeGroup>::ScalarField, true>
type ScalarVar = LimbedVar<<<C as CurveGroup>::BaseField as Field>::BasePrimeField, <C as PrimeGroup>::ScalarField, true>
CommitmentDefGadget::ScalarVar is the in-circuit variable type for
the scalars being committed to.Source§type CommitmentVar = <C as Val>::Var
type CommitmentVar = <C as Val>::Var
CommitmentDefGadget::CommitmentVar is the in-circuit variable type
for the commitment.Source§type RandomnessVar = Null
type RandomnessVar = Null
CommitmentDefGadget::RandomnessVar is the in-circuit variable type
for the randomness used in the commitment.Source§type Widget = Pedersen<C, false>
type Widget = Pedersen<C, false>
CommitmentDefGadget::Widget points to the out-of-circuit commitment
scheme widget.Source§impl<C: SonobeCurve> CommitmentDefGadget for PedersenGadget<C, true>
impl<C: SonobeCurve> CommitmentDefGadget for PedersenGadget<C, true>
Source§type ConstraintField = <<C as CurveGroup>::BaseField as Field>::BasePrimeField
type ConstraintField = <<C as CurveGroup>::BaseField as Field>::BasePrimeField
CommitmentDefGadget::ConstraintField is the field over which the
circuit running the commitment scheme is defined.Source§type KeyVar = PedersenKeyVar<C, true>
type KeyVar = PedersenKeyVar<C, true>
CommitmentDefGadget::KeyVar is the in-circuit variable type for the
commitment key.Source§type ScalarVar = LimbedVar<<<C as CurveGroup>::BaseField as Field>::BasePrimeField, <C as PrimeGroup>::ScalarField, true>
type ScalarVar = LimbedVar<<<C as CurveGroup>::BaseField as Field>::BasePrimeField, <C as PrimeGroup>::ScalarField, true>
CommitmentDefGadget::ScalarVar is the in-circuit variable type for
the scalars being committed to.Source§type CommitmentVar = <C as Val>::Var
type CommitmentVar = <C as Val>::Var
CommitmentDefGadget::CommitmentVar is the in-circuit variable type
for the commitment.Source§type RandomnessVar = LimbedVar<<<C as CurveGroup>::BaseField as Field>::BasePrimeField, <C as PrimeGroup>::ScalarField, true>
type RandomnessVar = LimbedVar<<<C as CurveGroup>::BaseField as Field>::BasePrimeField, <C as PrimeGroup>::ScalarField, true>
CommitmentDefGadget::RandomnessVar is the in-circuit variable type
for the randomness used in the commitment.Source§type Widget = Pedersen<C, true>
type Widget = Pedersen<C, true>
CommitmentDefGadget::Widget points to the out-of-circuit commitment
scheme widget.Source§impl<C: SonobeCurve> CommitmentOpsGadget for PedersenGadget<C, false>
impl<C: SonobeCurve> CommitmentOpsGadget for PedersenGadget<C, false>
Source§fn open(
ck: &PedersenKeyVar<C, false>,
v: &[EmulatedFieldVar<CF2<C>, CF1<C>>],
_r: &Null,
cm: &C::Var,
) -> Result<(), SynthesisError>
fn open( ck: &PedersenKeyVar<C, false>, v: &[EmulatedFieldVar<CF2<C>, CF1<C>>], _r: &Null, cm: &C::Var, ) -> Result<(), SynthesisError>
CommitmentOpsGadget::open defines the commitment opening gadget
that matches its out-of-circuit widget CommitmentOps::open.Source§impl<C: SonobeCurve> CommitmentOpsGadget for PedersenGadget<C, true>
impl<C: SonobeCurve> CommitmentOpsGadget for PedersenGadget<C, true>
Source§fn open(
ck: &PedersenKeyVar<C, true>,
v: &[EmulatedFieldVar<CF2<C>, CF1<C>>],
r: &EmulatedFieldVar<CF2<C>, CF1<C>>,
cm: &C::Var,
) -> Result<(), SynthesisError>
fn open( ck: &PedersenKeyVar<C, true>, v: &[EmulatedFieldVar<CF2<C>, CF1<C>>], r: &EmulatedFieldVar<CF2<C>, CF1<C>>, cm: &C::Var, ) -> Result<(), SynthesisError>
CommitmentOpsGadget::open defines the commitment opening gadget
that matches its out-of-circuit widget CommitmentOps::open.Auto Trait Implementations§
impl<C, const H: bool> Freeze for PedersenGadget<C, H>where
<C as Val>::Var: Sized,
<C as CurveGroup>::Config: Sized,
<<C as CurveGroup>::BaseField as Val>::Var: for<'a> Sized,
<C as CurveGroup>::BaseField: Sized,
<<C as PrimeGroup>::ScalarField as Val>::Var: for<'a> Sized,
<C as PrimeGroup>::ScalarField: Sized,
impl<C, const H: bool> RefUnwindSafe for PedersenGadget<C, H>where
<C as Val>::Var: Sized,
<C as CurveGroup>::Config: Sized,
<<C as CurveGroup>::BaseField as Val>::Var: for<'a> Sized,
<C as CurveGroup>::BaseField: Sized,
<<C as PrimeGroup>::ScalarField as Val>::Var: for<'a> Sized,
<C as PrimeGroup>::ScalarField: Sized,
C: RefUnwindSafe,
impl<C, const H: bool> Send for PedersenGadget<C, H>where
<C as Val>::Var: Sized,
<C as CurveGroup>::Config: Sized,
<<C as CurveGroup>::BaseField as Val>::Var: for<'a> Sized,
<C as CurveGroup>::BaseField: Sized,
<<C as PrimeGroup>::ScalarField as Val>::Var: for<'a> Sized,
<C as PrimeGroup>::ScalarField: Sized,
impl<C, const H: bool> Sync for PedersenGadget<C, H>where
<C as Val>::Var: Sized,
<C as CurveGroup>::Config: Sized,
<<C as CurveGroup>::BaseField as Val>::Var: for<'a> Sized,
<C as CurveGroup>::BaseField: Sized,
<<C as PrimeGroup>::ScalarField as Val>::Var: for<'a> Sized,
<C as PrimeGroup>::ScalarField: Sized,
impl<C, const H: bool> Unpin for PedersenGadget<C, H>where
<C as Val>::Var: Sized,
<C as CurveGroup>::Config: Sized,
<<C as CurveGroup>::BaseField as Val>::Var: for<'a> Sized,
<C as CurveGroup>::BaseField: Sized,
<<C as PrimeGroup>::ScalarField as Val>::Var: for<'a> Sized,
<C as PrimeGroup>::ScalarField: Sized,
C: Unpin,
impl<C, const H: bool> UnsafeUnpin for PedersenGadget<C, H>where
<C as Val>::Var: Sized,
<C as CurveGroup>::Config: Sized,
<<C as CurveGroup>::BaseField as Val>::Var: for<'a> Sized,
<C as CurveGroup>::BaseField: Sized,
<<C as PrimeGroup>::ScalarField as Val>::Var: for<'a> Sized,
<C as PrimeGroup>::ScalarField: Sized,
impl<C, const H: bool> UnwindSafe for PedersenGadget<C, H>where
<C as Val>::Var: Sized,
<C as CurveGroup>::Config: Sized,
<<C as CurveGroup>::BaseField as Val>::Var: for<'a> Sized,
<C as CurveGroup>::BaseField: Sized,
<<C as PrimeGroup>::ScalarField as Val>::Var: for<'a> Sized,
<C as PrimeGroup>::ScalarField: Sized,
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more