ark_r1cs_std::convert

Trait ToConstraintFieldGadget

Source
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§

Source

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>>

Source§

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``.

Implementors§

Source§

impl<BF, P> ToConstraintFieldGadget<<P as CubicExtConfig>::BasePrimeField> for CubicExtVar<BF, P>

Source§

impl<BF, P> ToConstraintFieldGadget<<P as QuadExtConfig>::BasePrimeField> for QuadExtVar<BF, P>

Source§

impl<F: PrimeField> ToConstraintFieldGadget<F> for Boolean<F>

Source§

impl<F: PrimeField> ToConstraintFieldGadget<F> for FpVar<F>

Source§

impl<F: PrimeField> ToConstraintFieldGadget<F> for AllocatedFp<F>

Source§

impl<P, F> ToConstraintFieldGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for ark_r1cs_std::groups::curves::short_weierstrass::AffineVar<P, F>

Source§

impl<P, F> ToConstraintFieldGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F>

Source§

impl<P, F> ToConstraintFieldGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for ark_r1cs_std::groups::curves::twisted_edwards::AffineVar<P, F>

Source§

impl<TargetF: PrimeField, BaseF: PrimeField> ToConstraintFieldGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>

Source§

impl<TargetF: PrimeField, BaseF: PrimeField> ToConstraintFieldGadget<BaseF> for AllocatedEmulatedFpVar<TargetF, BaseF>