Skip to main content

CommitmentDefGadget

Trait CommitmentDefGadget 

Source
pub trait CommitmentDefGadget: Clone {
    type ConstraintField: SonobeField;
    type KeyVar: AllocVar<<Self::Widget as CommitmentDef>::Key, Self::ConstraintField>;
    type ScalarVar: AbsorbableVar<Self::ConstraintField> + CondSelectGadget<Self::ConstraintField> + FromBitsGadget<Self::ConstraintField> + AllocVar<<Self::Widget as CommitmentDef>::Scalar, Self::ConstraintField> + GR1CSVar<Self::ConstraintField, Value = <Self::Widget as CommitmentDef>::Scalar> + TwoStageFieldVar;
    type CommitmentVar: Clone + AbsorbableVar<Self::ConstraintField> + CondSelectGadget<Self::ConstraintField> + AllocVar<<Self::Widget as CommitmentDef>::Commitment, Self::ConstraintField> + GR1CSVar<Self::ConstraintField, Value = <Self::Widget as CommitmentDef>::Commitment>;
    type RandomnessVar: AllocVar<<Self::Widget as CommitmentDef>::Randomness, Self::ConstraintField> + GR1CSVar<Self::ConstraintField, Value = <Self::Widget as CommitmentDef>::Randomness>;
    type Widget: CommitmentDef;
}
Expand description

CommitmentDefGadget specifies the in-circuit associated types for a commitment scheme gadget.

Required Associated Types§

Source

type ConstraintField: SonobeField

CommitmentDefGadget::ConstraintField is the field over which the circuit running the commitment scheme is defined.

Source

type KeyVar: AllocVar<<Self::Widget as CommitmentDef>::Key, Self::ConstraintField>

CommitmentDefGadget::KeyVar is the in-circuit variable type for the commitment key.

Source

type ScalarVar: AbsorbableVar<Self::ConstraintField> + CondSelectGadget<Self::ConstraintField> + FromBitsGadget<Self::ConstraintField> + AllocVar<<Self::Widget as CommitmentDef>::Scalar, Self::ConstraintField> + GR1CSVar<Self::ConstraintField, Value = <Self::Widget as CommitmentDef>::Scalar> + TwoStageFieldVar

CommitmentDefGadget::ScalarVar is the in-circuit variable type for the scalars being committed to.

Source

type CommitmentVar: Clone + AbsorbableVar<Self::ConstraintField> + CondSelectGadget<Self::ConstraintField> + AllocVar<<Self::Widget as CommitmentDef>::Commitment, Self::ConstraintField> + GR1CSVar<Self::ConstraintField, Value = <Self::Widget as CommitmentDef>::Commitment>

CommitmentDefGadget::CommitmentVar is the in-circuit variable type for the commitment.

Source

type RandomnessVar: AllocVar<<Self::Widget as CommitmentDef>::Randomness, Self::ConstraintField> + GR1CSVar<Self::ConstraintField, Value = <Self::Widget as CommitmentDef>::Randomness>

CommitmentDefGadget::RandomnessVar is the in-circuit variable type for the randomness used in the commitment.

Source

type Widget: CommitmentDef

CommitmentDefGadget::Widget points to the out-of-circuit commitment scheme widget.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C: SonobeCurve> CommitmentDefGadget for PedersenEmulatedGadget<C, false>

Source§

impl<C: SonobeCurve> CommitmentDefGadget for PedersenEmulatedGadget<C, true>

Source§

impl<C: SonobeCurve> CommitmentDefGadget for PedersenGadget<C, false>

Source§

impl<C: SonobeCurve> CommitmentDefGadget for PedersenGadget<C, true>