Trait ark_r1cs_std::fields::FieldVar [−][src]
A variable representing a field. Corresponds to the native type F.
Required methods
fn zero() -> Self[src]
Returns the constant F::zero().
fn one() -> Self[src]
Returns the constant F::one().
fn constant(v: F) -> Self[src]
Returns a constant with value v.
This should not allocate any variables.
fn negate(&self) -> Result<Self, SynthesisError>[src]
Coputes -self.
fn inverse(&self) -> Result<Self, SynthesisError>[src]
Computes result such that self * result == Self::one().
fn frobenius_map(&self, power: usize) -> Result<Self, SynthesisError>[src]
Computes the frobenius map over self.
Provided methods
fn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError>[src]
Returns a Boolean representing whether self == Self::zero().
fn is_one(&self) -> Result<Boolean<ConstraintF>, SynthesisError>[src]
Returns a Boolean representing whether self == Self::one().
fn double(&self) -> Result<Self, SynthesisError>[src]
Computes self + self.
fn double_in_place(&mut self) -> Result<&mut Self, SynthesisError>[src]
Sets self = self + self.
fn negate_in_place(&mut self) -> Result<&mut Self, SynthesisError>[src]
Sets self = -self.
fn square(&self) -> Result<Self, SynthesisError>[src]
Computes self * self.
A default implementation is provided which just invokes the underlying multiplication routine. However, this method should be specialized for extension fields, where faster algorithms exist for squaring.
fn square_in_place(&mut self) -> Result<&mut Self, SynthesisError>[src]
Sets self = self.square().
fn mul_equals(&self, other: &Self, result: &Self) -> Result<(), SynthesisError>[src]
Enforces that self * other == result.
fn square_equals(&self, result: &Self) -> Result<(), SynthesisError>[src]
Enforces that self * self == result.
fn mul_by_inverse(&self, d: &Self) -> Result<Self, SynthesisError>[src]
Returns (self / d). but requires fewer constraints than self * d.inverse().
It is up to the caller to ensure that d is non-zero,
since in that case the result is unconstrained.
fn frobenius_map_in_place(
&mut self,
power: usize
) -> Result<&mut Self, SynthesisError>[src]
&mut self,
power: usize
) -> Result<&mut Self, SynthesisError>
Sets self = self.frobenius_map().
fn pow_le(&self, bits: &[Boolean<ConstraintF>]) -> Result<Self, SynthesisError>[src]
Comptues self^bits, where bits is a little-endian bit-wise
decomposition of the exponent.
fn pow_by_constant<S: AsRef<[u64]>>(
&self,
exp: S
) -> Result<Self, SynthesisError>[src]
&self,
exp: S
) -> Result<Self, SynthesisError>
Computes self^S, where S is interpreted as an little-endian
u64-decomposition of an integer.
Implementors
impl<BF, P> FieldVar<CubicExtField<P>, <P as CubicExtParameters>::BasePrimeField> for CubicExtVar<BF, P> where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarParams<BF>, [src]
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarParams<BF>,
fn constant(other: CubicExtField<P>) -> Self[src]
fn zero() -> Self[src]
fn one() -> Self[src]
fn double(&self) -> Result<Self, SynthesisError>[src]
fn negate(&self) -> Result<Self, SynthesisError>[src]
fn square(&self) -> Result<Self, SynthesisError>[src]
Use the Chung-Hasan asymmetric squaring formula.
(Devegili OhEig Scott Dahab — Multiplication and Squaring on Abstract Pairing-Friendly Fields.pdf; Section 4 (CH-SQR2))
fn mul_equals(&self, other: &Self, result: &Self) -> Result<(), SynthesisError>[src]
fn frobenius_map(&self, power: usize) -> Result<Self, SynthesisError>[src]
fn inverse(&self) -> Result<Self, SynthesisError>[src]
impl<BF, P> FieldVar<QuadExtField<P>, <P as QuadExtParameters>::BasePrimeField> for QuadExtVar<BF, P> where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: QuadExtVarParams<BF>, [src]
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: QuadExtVarParams<BF>,
fn constant(other: QuadExtField<P>) -> Self[src]
fn zero() -> Self[src]
fn one() -> Self[src]
fn double(&self) -> Result<Self, SynthesisError>[src]
fn negate(&self) -> Result<Self, SynthesisError>[src]
fn square(&self) -> Result<Self, SynthesisError>[src]
fn mul_equals(&self, other: &Self, result: &Self) -> Result<(), SynthesisError>[src]
fn frobenius_map(&self, power: usize) -> Result<Self, SynthesisError>[src]
fn inverse(&self) -> Result<Self, SynthesisError>[src]
impl<F: PrimeField> FieldVar<F, F> for FpVar<F>[src]
fn constant(f: F) -> Self[src]
fn zero() -> Self[src]
fn one() -> Self[src]
fn double(&self) -> Result<Self, SynthesisError>[src]
fn negate(&self) -> Result<Self, SynthesisError>[src]
fn square(&self) -> Result<Self, SynthesisError>[src]
fn mul_equals(&self, other: &Self, result: &Self) -> Result<(), SynthesisError>[src]
Enforce that self * other == result.
fn square_equals(&self, result: &Self) -> Result<(), SynthesisError>[src]
Enforce that self * self == result.
fn inverse(&self) -> Result<Self, SynthesisError>[src]
fn frobenius_map(&self, power: usize) -> Result<Self, SynthesisError>[src]
fn frobenius_map_in_place(
&mut self,
power: usize
) -> Result<&mut Self, SynthesisError>[src]
&mut self,
power: usize
) -> Result<&mut Self, SynthesisError>