ark_r1cs_std::fields::cubic_extension

Struct CubicExtVar

Source
pub struct CubicExtVar<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>>
where for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
{ pub c0: BF, pub c1: BF, pub c2: BF, /* private fields */ }
Expand description

This struct is the R1CS equivalent of the cubic extension field type in ark-ff, i.e. ark_ff::CubicExtField.

Fields§

§c0: BF

The zero-th coefficient of this field element.

§c1: BF

The first coefficient of this field element.

§c2: BF

The second coefficient of this field element.

Implementations§

Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> CubicExtVar<BF, P>
where for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>,

Source

pub fn new(c0: BF, c1: BF, c2: BF) -> Self

Constructs a CubicExtVar from the underlying coefficients.

Source

pub fn mul_base_field_by_nonresidue(fe: &BF) -> Result<BF, SynthesisError>

Multiplies a variable of the base field by the cubic nonresidue P::NONRESIDUE that is used to construct the extension field.

Source

pub fn mul_by_base_field_constant(&self, fe: P::BaseField) -> Self

Multiplies self by a constant from the base field.

Source

pub fn mul_assign_by_base_field_constant(&mut self, fe: P::BaseField)

Sets self = self.mul_by_base_field_constant(fe).

Source§

impl<P: Fp6Config> CubicExtVar<QuadExtVar<FpVar<<<P as Fp6Config>::Fp2Config as Fp2Config>::Fp>, Fp2ConfigWrapper<<P as Fp6Config>::Fp2Config>>, Fp6ConfigWrapper<P>>

Source

pub fn mul_by_0_c1_0( &self, c1: &Fp2Var<P::Fp2Config>, ) -> Result<Self, SynthesisError>

Multiplies self by a sparse element which has c0 == c2 == zero.

Source

pub fn mul_by_c0_c1_0( &self, c0: &Fp2Var<P::Fp2Config>, c1: &Fp2Var<P::Fp2Config>, ) -> Result<Self, SynthesisError>

Multiplies self by a sparse element which has c2 == zero.

Trait Implementations§

Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Add<&'a CubicExtVar<BF, P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a CubicExtVar<BF, P>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Add<CubicExtField<P>> for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the + operator.
Source§

fn add(self, other: CubicExtField<P>) -> Self::Output

Performs the + operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Add<CubicExtField<P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the + operator.
Source§

fn add(self, other: CubicExtField<P>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Add<CubicExtVar<BF, P>> for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the + operator.
Source§

fn add(self, other: CubicExtVar<BF, P>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Add for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a CubicExtVar<BF, P>) -> Self::Output

Performs the + operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Add for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the + operator.
Source§

fn add(self, other: CubicExtVar<BF, P>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> AddAssign<&'a CubicExtVar<BF, P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn add_assign(&mut self, other: &'a CubicExtVar<BF, P>)

Performs the += operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> AddAssign<CubicExtField<P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn add_assign(&mut self, other: CubicExtField<P>)

Performs the += operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> AddAssign for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn add_assign(&mut self, other: CubicExtVar<BF, P>)

Performs the += operation. Read more
Source§

impl<BF, P> AllocVar<CubicExtField<P>, <P as CubicExtConfig>::BasePrimeField> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

fn new_variable<T: Borrow<CubicExtField<P>>>( cs: impl Into<Namespace<P::BasePrimeField>>, f: impl FnOnce() -> Result<T, SynthesisError>, mode: AllocationMode, ) -> Result<Self, SynthesisError>

Allocates a new variable of type Self in the ConstraintSystem cs. The mode of allocation is decided by mode.
Source§

fn new_constant( cs: impl Into<Namespace<F>>, t: impl Borrow<V>, ) -> Result<Self, SynthesisError>

Allocates a new constant of type Self in the ConstraintSystem cs. Read more
Source§

fn new_input<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>

Allocates a new public input of type Self in the ConstraintSystem cs.
Source§

fn new_witness<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>

Allocates a new private witness of type Self in the ConstraintSystem cs.
Source§

fn new_variable_with_inferred_mode<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>

Allocates a new constant or private witness of type Self in the ConstraintSystem cs with the allocation mode inferred from cs. A constant is allocated if cs is None, and a private witness is allocated otherwise. Read more
Source§

impl<BF, P: CubicExtVarConfig<BF>> Clone for CubicExtVar<BF, P>
where for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, BF: Clone + FieldVar<P::BaseField, P::BasePrimeField>, PhantomData<P>: Clone,

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<BF, P> CondSelectGadget<<P as CubicExtConfig>::BasePrimeField> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

fn conditionally_select( cond: &Boolean<P::BasePrimeField>, true_value: &Self, false_value: &Self, ) -> Result<Self, SynthesisError>

If cond == &Boolean::TRUE, then this returns true_value; else, returns false_value. Read more
Source§

fn conditionally_select_power_of_two_vector( position: &[Boolean<ConstraintF>], values: &[Self], ) -> Result<Self, SynthesisError>

Returns an element of values whose index in represented by position. position is an array of boolean that represents an unsigned integer in big endian order. Read more
Source§

impl<BF, P: CubicExtVarConfig<BF>> Debug for CubicExtVar<BF, P>
where for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, BF: Debug + FieldVar<P::BaseField, P::BasePrimeField>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<BF, P> EqGadget<<P as CubicExtConfig>::BasePrimeField> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

fn is_eq( &self, other: &Self, ) -> Result<Boolean<P::BasePrimeField>, SynthesisError>

Output a Boolean value representing whether self.value() == other.value().
Source§

fn conditional_enforce_equal( &self, other: &Self, condition: &Boolean<P::BasePrimeField>, ) -> Result<(), SynthesisError>

If should_enforce == true, enforce that self and other are equal; else, enforce a vacuously true statement. Read more
Source§

fn conditional_enforce_not_equal( &self, other: &Self, condition: &Boolean<P::BasePrimeField>, ) -> Result<(), SynthesisError>

If should_enforce == true, enforce that self and other are not equal; else, enforce a vacuously true statement. Read more
Source§

fn is_neq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>

Output a Boolean value representing whether self.value() != other.value(). Read more
Source§

fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>

Enforce that self and other are equal. Read more
Source§

fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>

Enforce that self and other are not equal. Read more
Source§

impl<BF, P> FieldVar<CubicExtField<P>, <P as CubicExtConfig>::BasePrimeField> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

fn square(&self) -> Result<Self, SynthesisError>

Use the Chung-Hasan asymmetric squaring formula.

(Devegili OhEig Scott Dahab — Multiplication and Squaring on Abstract Pairing-Friendly Fields.pdf; Section 4 (CH-SQR2))

Source§

fn constant(other: CubicExtField<P>) -> Self

Returns a constant with value v. Read more
Source§

fn zero() -> Self

Returns the constant F::zero().
Source§

fn one() -> Self

Returns the constant F::one().
Source§

fn double(&self) -> Result<Self, SynthesisError>

Computes self + self.
Source§

fn negate(&self) -> Result<Self, SynthesisError>

Coputes -self.
Source§

fn mul_equals(&self, other: &Self, result: &Self) -> Result<(), SynthesisError>

Enforces that self * other == result.
Source§

fn frobenius_map(&self, power: usize) -> Result<Self, SynthesisError>

Computes the frobenius map over self.
Source§

fn inverse(&self) -> Result<Self, SynthesisError>

Computes result such that self * result == Self::one().
Source§

fn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError>

Returns a Boolean representing whether self == Self::zero().
Source§

fn is_one(&self) -> Result<Boolean<ConstraintF>, SynthesisError>

Returns a Boolean representing whether self == Self::one().
Source§

fn double_in_place(&mut self) -> Result<&mut Self, SynthesisError>

Sets self = self + self.
Source§

fn negate_in_place(&mut self) -> Result<&mut Self, SynthesisError>

Sets self = -self.
Source§

fn square_in_place(&mut self) -> Result<&mut Self, SynthesisError>

Sets self = self.square().
Source§

fn square_equals(&self, result: &Self) -> Result<(), SynthesisError>

Enforces that self * self == result.
Source§

fn mul_by_inverse(&self, d: &Self) -> Result<Self, SynthesisError>

Returns (self / d). The constraint system will be unsatisfiable when d = 0.
Source§

fn mul_by_inverse_unchecked(&self, d: &Self) -> Result<Self, SynthesisError>

Returns (self / d). Read more
Source§

fn frobenius_map_in_place( &mut self, power: usize, ) -> Result<&mut Self, SynthesisError>

Sets self = self.frobenius_map().
Source§

fn pow_le(&self, bits: &[Boolean<ConstraintF>]) -> Result<Self, SynthesisError>

Comptues self^bits, where bits is a little-endian bit-wise decomposition of the exponent.
Source§

fn pow_by_constant<S: AsRef<[u64]>>( &self, exp: S, ) -> Result<Self, SynthesisError>

Computes self^S, where S is interpreted as an little-endian u64-decomposition of an integer.
Source§

impl<BF, P> From<Boolean<<P as CubicExtConfig>::BasePrimeField>> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

fn from(other: Boolean<P::BasePrimeField>) -> Self

Converts to this type from the input type.
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Mul<&'a CubicExtVar<BF, P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a CubicExtVar<BF, P>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Mul<CubicExtField<P>> for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the * operator.
Source§

fn mul(self, other: CubicExtField<P>) -> Self::Output

Performs the * operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Mul<CubicExtField<P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the * operator.
Source§

fn mul(self, other: CubicExtField<P>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Mul<CubicExtVar<BF, P>> for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the * operator.
Source§

fn mul(self, other: CubicExtVar<BF, P>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Mul for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a CubicExtVar<BF, P>) -> Self::Output

Performs the * operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Mul for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the * operator.
Source§

fn mul(self, other: CubicExtVar<BF, P>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> MulAssign<&'a CubicExtVar<BF, P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn mul_assign(&mut self, other: &'a CubicExtVar<BF, P>)

Performs the *= operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> MulAssign<CubicExtField<P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn mul_assign(&mut self, other: CubicExtField<P>)

Performs the *= operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> MulAssign for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn mul_assign(&mut self, other: CubicExtVar<BF, P>)

Performs the *= operation. Read more
Source§

impl<P: Fp6Config> QuadExtVarConfig<CubicExtVar<FpVar<<<P as Fp6Config>::Fp3Config as Fp3Config>::Fp>, Fp3ConfigWrapper<<P as Fp6Config>::Fp3Config>>> for Fp6ConfigWrapper<P>

Source§

fn mul_base_field_var_by_frob_coeff(fe: &mut Fp3Var<P::Fp3Config>, power: usize)

Multiply the base field of the QuadExtVar by the appropriate Frobenius coefficient. This is equivalent to Self::mul_base_field_by_frob_coeff(power).
Source§

impl<P: Fp12Config> QuadExtVarConfig<CubicExtVar<QuadExtVar<FpVar<<<<P as Fp12Config>::Fp6Config as Fp6Config>::Fp2Config as Fp2Config>::Fp>, Fp2ConfigWrapper<<<P as Fp12Config>::Fp6Config as Fp6Config>::Fp2Config>>, Fp6ConfigWrapper<<P as Fp12Config>::Fp6Config>>> for Fp12ConfigWrapper<P>

Source§

fn mul_base_field_var_by_frob_coeff(fe: &mut Fp6Var<P::Fp6Config>, power: usize)

Multiply the base field of the QuadExtVar by the appropriate Frobenius coefficient. This is equivalent to Self::mul_base_field_by_frob_coeff(power).
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Sub<&'a CubicExtVar<BF, P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a CubicExtVar<BF, P>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Sub<CubicExtField<P>> for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the - operator.
Source§

fn sub(self, other: CubicExtField<P>) -> Self::Output

Performs the - operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Sub<CubicExtField<P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the - operator.
Source§

fn sub(self, other: CubicExtField<P>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Sub<CubicExtVar<BF, P>> for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the - operator.
Source§

fn sub(self, other: CubicExtVar<BF, P>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Sub for &'a CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a CubicExtVar<BF, P>) -> Self::Output

Performs the - operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> Sub for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

type Output = CubicExtVar<BF, P>

The resulting type after applying the - operator.
Source§

fn sub(self, other: CubicExtVar<BF, P>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> SubAssign<&'a CubicExtVar<BF, P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn sub_assign(&mut self, other: &'a CubicExtVar<BF, P>)

Performs the -= operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> SubAssign<CubicExtField<P>> for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn sub_assign(&mut self, other: CubicExtField<P>)

Performs the -= operation. Read more
Source§

impl<BF: FieldVar<P::BaseField, P::BasePrimeField>, P: CubicExtVarConfig<BF>> SubAssign for CubicExtVar<BF, P>
where for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,

Source§

fn sub_assign(&mut self, other: CubicExtVar<BF, P>)

Performs the -= operation. Read more
Source§

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

Source§

type TableConstant = CubicExtField<P>

The type of values being looked up.
Source§

fn three_bit_cond_neg_lookup( b: &[Boolean<P::BasePrimeField>], b0b1: &Boolean<P::BasePrimeField>, c: &[Self::TableConstant], ) -> Result<Self, SynthesisError>

Interprets the slice bits as a two-bit integer b = bits[0] + (bits[1] << 1), and then outputs constants[b] * c, where c = if bits[2] { -1 } else { 1 };. Read more
Source§

impl<BF, P> ToBitsGadget<<P as CubicExtConfig>::BasePrimeField> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

fn to_bits_le(&self) -> Result<Vec<Boolean<P::BasePrimeField>>, SynthesisError>

Outputs the canonical little-endian bit-wise representation of self. Read more
Source§

fn to_non_unique_bits_le( &self, ) -> Result<Vec<Boolean<P::BasePrimeField>>, SynthesisError>

Outputs a possibly non-unique little-endian bit-wise representation of self. Read more
Source§

fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>

Outputs the canonical big-endian bit-wise representation of self.
Source§

fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>

Outputs a possibly non-unique big-endian bit-wise representation of self.
Source§

impl<BF, P> ToBytesGadget<<P as CubicExtConfig>::BasePrimeField> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

fn to_bytes_le(&self) -> Result<Vec<UInt8<P::BasePrimeField>>, SynthesisError>

Outputs a canonical, little-endian, byte decomposition of self. Read more
Source§

fn to_non_unique_bytes_le( &self, ) -> Result<Vec<UInt8<P::BasePrimeField>>, SynthesisError>

Outputs a possibly non-unique byte decomposition of self. Read more
Source§

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

Source§

fn to_constraint_field( &self, ) -> Result<Vec<FpVar<P::BasePrimeField>>, SynthesisError>

Converts self to FpVar<ConstraintF> variables.
Source§

impl<BF, P> TwoBitLookupGadget<<P as CubicExtConfig>::BasePrimeField> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField> + TwoBitLookupGadget<P::BasePrimeField, TableConstant = P::BaseField>, for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

type TableConstant = CubicExtField<P>

The type of values being looked up.
Source§

fn two_bit_lookup( b: &[Boolean<P::BasePrimeField>], c: &[Self::TableConstant], ) -> Result<Self, SynthesisError>

Interprets the slice bits as a two-bit integer b = bits[0] + (bits[1] << 1), and then outputs constants[b]. Read more
Source§

impl<'a, BF, P> FieldOpsBounds<'a, CubicExtField<P>, CubicExtVar<BF, P>> for &'a CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Source§

impl<'a, BF, P> FieldOpsBounds<'a, CubicExtField<P>, CubicExtVar<BF, P>> for CubicExtVar<BF, P>
where BF: FieldVar<P::BaseField, P::BasePrimeField>, for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>, P: CubicExtVarConfig<BF>,

Auto Trait Implementations§

§

impl<BF, P> Freeze for CubicExtVar<BF, P>
where &'a BF: for<'a> Sized, BF: Freeze,

§

impl<BF, P> RefUnwindSafe for CubicExtVar<BF, P>
where &'a BF: for<'a> Sized, BF: RefUnwindSafe, P: RefUnwindSafe,

§

impl<BF, P> Send for CubicExtVar<BF, P>
where &'a BF: for<'a> Sized, BF: Send,

§

impl<BF, P> Sync for CubicExtVar<BF, P>
where &'a BF: for<'a> Sized, BF: Sync,

§

impl<BF, P> Unpin for CubicExtVar<BF, P>
where &'a BF: for<'a> Sized, BF: Unpin, P: Unpin,

§

impl<BF, P> UnwindSafe for CubicExtVar<BF, P>
where &'a BF: for<'a> Sized, BF: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more