pub trait ToConstraintFieldGadget<ConstraintF: PrimeField> {
// Required method
fn to_constraint_field(
&self,
) -> Result<Vec<FpVar<ConstraintF>>, SynthesisError>;
}
Expand description
Specifies how to convert a variable of type Self
to variables of
type FpVar<ConstraintF>
Required Methods§
Sourcefn to_constraint_field(&self) -> Result<Vec<FpVar<ConstraintF>>, SynthesisError>
fn to_constraint_field(&self) -> Result<Vec<FpVar<ConstraintF>>, SynthesisError>
Converts self
to FpVar<ConstraintF>
variables.
Implementations on Foreign Types§
Source§impl<ConstraintF: PrimeField> ToConstraintFieldGadget<ConstraintF> for Vec<UInt8<ConstraintF>>
impl<ConstraintF: PrimeField> ToConstraintFieldGadget<ConstraintF> for Vec<UInt8<ConstraintF>>
fn to_constraint_field(&self) -> Result<Vec<FpVar<ConstraintF>>, SynthesisError>
Source§impl<ConstraintF: PrimeField> ToConstraintFieldGadget<ConstraintF> for [UInt8<ConstraintF>]
impl<ConstraintF: PrimeField> ToConstraintFieldGadget<ConstraintF> for [UInt8<ConstraintF>]
Parses the Vec<UInt8<ConstraintF>>
in fixed-sized
ConstraintF::MODULUS_BIT_SIZE - 1
chunks and converts each chunk, which is
assumed to be little-endian, to its FpVar<ConstraintF>
representation.
This is the gadget counterpart to the [u8]
implementation of
`ToConstraintField``.