Struct snarkvm_gadgets::fields::fp6_3over2::Fp6Gadget
source · [−]pub struct Fp6Gadget<P, F: PrimeField> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>, {
pub c0: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>,
pub c1: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>,
pub c2: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>,
/* private fields */
}
Fields
c0: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>
c1: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>
c2: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>
Implementations
sourceimpl<P, F: PrimeField> Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
pub fn new(
c0: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>,
c1: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>,
c2: Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>
) -> Self
sourcepub fn mul_fp2_gadget_by_nonresidue<CS: ConstraintSystem<F>>(
cs: CS,
fe: &Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>
) -> Result<Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>, SynthesisError>
pub fn mul_fp2_gadget_by_nonresidue<CS: ConstraintSystem<F>>(
cs: CS,
fe: &Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>
) -> Result<Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>, SynthesisError>
Multiply a Fp2Gadget by cubic nonresidue P::NONRESIDUE.
pub fn mul_by_0_c1_0<CS: ConstraintSystem<F>>(
&self,
cs: CS,
c1: &Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>
) -> Result<Self, SynthesisError>
pub fn mul_by_c0_c1_0<CS: ConstraintSystem<F>>(
&self,
cs: CS,
c0: &Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>,
c1: &Fp2Gadget<<P as Fp6Parameters>::Fp2Params, F>
) -> Result<Self, SynthesisError>
Trait Implementations
sourceimpl<P, F: PrimeField> AllocGadget<Fp6<P>, F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> AllocGadget<Fp6<P>, F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
fn alloc<Fn, T, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<Fp6<P>>,
fn alloc_input<Fn, T, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<Fp6<P>>,
fn alloc_constant<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
_cs: CS,
_f: Fn
) -> Result<Self, SynthesisError>
fn alloc_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
fn alloc_input_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
sourceimpl<P, F: PrimeField> Clone for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> Clone for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
sourceimpl<P, F: PrimeField> CondSelectGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> CondSelectGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
fn conditionally_select<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError>
fn cost() -> usize
sourceimpl<P, F: PrimeField> ConditionalEqGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> ConditionalEqGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
fn conditional_enforce_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self,
condition: &Boolean
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<P, F: PrimeField> Debug for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
F: PrimeField,
impl<P, F: PrimeField> Debug for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
F: PrimeField,
sourceimpl<P, F: PrimeField> EqGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> EqGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
sourcefn is_eq<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn is_eq<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
Output a Boolean
value representing whether self.value() == other.value()
. Read more
fn enforce_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<P, F: PrimeField> FieldGadget<Fp6<P>, F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> FieldGadget<Fp6<P>, F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
sourcefn mul<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
fn mul<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
Use the Toom-Cook-3x method to compute multiplication.
sourcefn square<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Self, SynthesisError>
fn square<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Self, SynthesisError>
Use the Toom-Cook-3x method to compute multiplication.
sourcefn mul_by_constant<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Fp6<P>
) -> Result<Self, SynthesisError>
fn mul_by_constant<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Fp6<P>
) -> Result<Self, SynthesisError>
Use the Toom-Cook-3x method to compute multiplication.
type Variable = ((ConstraintVariable<F>, ConstraintVariable<F>), (ConstraintVariable<F>, ConstraintVariable<F>), (ConstraintVariable<F>, ConstraintVariable<F>))
fn get_value(&self) -> Option<Fp6<P>>
fn get_variable(&self) -> Self::Variable
fn zero<CS: ConstraintSystem<F>>(cs: CS) -> Result<Self, SynthesisError>
fn one<CS: ConstraintSystem<F>>(cs: CS) -> Result<Self, SynthesisError>
fn conditionally_add_constant<CS: ConstraintSystem<F>>(
&self,
cs: CS,
bit: &Boolean,
coeff: Fp6<P>
) -> Result<Self, SynthesisError>
fn add<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
fn sub<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
fn negate<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Self, SynthesisError>
fn negate_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS
) -> Result<&mut Self, SynthesisError>
fn inverse<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Self, SynthesisError>
fn add_constant<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Fp6<P>
) -> Result<Self, SynthesisError>
fn add_constant_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS,
other: &Fp6<P>
) -> Result<&mut Self, SynthesisError>
fn frobenius_map<CS: ConstraintSystem<F>>(
&self,
cs: CS,
power: usize
) -> Result<Self, SynthesisError>
fn frobenius_map_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS,
power: usize
) -> Result<&mut Self, SynthesisError>
fn cost_of_mul() -> usize
fn cost_of_inv() -> usize
fn add_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError>
fn double<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Self, SynthesisError>
fn double_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS
) -> Result<&mut Self, SynthesisError>
fn sub_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError>
fn mul_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError>
fn square_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS
) -> Result<&mut Self, SynthesisError>
fn mul_equals<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self,
result: &Self
) -> Result<(), SynthesisError>
fn square_equals<CS: ConstraintSystem<F>>(
&self,
cs: CS,
result: &Self
) -> Result<(), SynthesisError>
fn sub_constant<CS: ConstraintSystem<F>>(
&self,
cs: CS,
fe: &NativeF
) -> Result<Self, SynthesisError>
fn sub_constant_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS,
other: &NativeF
) -> Result<&mut Self, SynthesisError>
fn mul_by_constant_in_place<CS: ConstraintSystem<F>>(
&mut self,
cs: CS,
other: &NativeF
) -> Result<&mut Self, SynthesisError>
sourcefn pow<CS: ConstraintSystem<F>>(
&self,
cs: CS,
bits: &[Boolean]
) -> Result<Self, SynthesisError>
fn pow<CS: ConstraintSystem<F>>(
&self,
cs: CS,
bits: &[Boolean]
) -> Result<Self, SynthesisError>
Accepts as input a list of bits which, when interpreted in big-endian form, are a scalar. Read more
sourcefn pow_by_constant<CS: ConstraintSystem<F>, S: AsRef<[u64]>>(
&self,
cs: CS,
exp: S
) -> Result<Self, SynthesisError>
fn pow_by_constant<CS: ConstraintSystem<F>, S: AsRef<[u64]>>(
&self,
cs: CS,
exp: S
) -> Result<Self, SynthesisError>
Computes self^S
, where S is interpreted as an little-endian
u64-decomposition of an integer. Read more
sourceimpl<P, F: PrimeField> NEqGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> NEqGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
fn enforce_not_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<P, F: PrimeField> PartialEq<Fp6Gadget<P, F>> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> PartialEq<Fp6Gadget<P, F>> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
sourceimpl<P, F: PrimeField> ThreeBitCondNegLookupGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> ThreeBitCondNegLookupGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
type TableConstant = Fp6<P>
fn three_bit_cond_neg_lookup<CS: ConstraintSystem<F>>(
cs: CS,
b: &[Boolean],
b0b1: &Boolean,
c: &[Self::TableConstant]
) -> Result<Self, SynthesisError>
fn cost() -> usize
sourceimpl<P, F: PrimeField> ToBitsBEGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> ToBitsBEGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
fn to_bits_be<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
sourcefn to_bits_be_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
fn to_bits_be_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
Additionally checks if the produced list of booleans is ‘valid’.
sourceimpl<P, F: PrimeField> ToBitsLEGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> ToBitsLEGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
fn to_bits_le<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
sourcefn to_bits_le_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
fn to_bits_le_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
Additionally checks if the produced list of booleans is ‘valid’.
sourceimpl<P, F: PrimeField> ToBytesGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> ToBytesGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
fn to_bytes<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
sourcefn to_bytes_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
fn to_bytes_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
Additionally checks if the produced list of booleans is ‘valid’.
sourceimpl<P, F: PrimeField> ToConstraintFieldGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> ToConstraintFieldGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
sourcefn to_constraint_field<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<FpGadget<F>>, SynthesisError>
fn to_constraint_field<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<FpGadget<F>>, SynthesisError>
Converts self
to FpGadget<F>
variables.
sourceimpl<P, F: PrimeField> TwoBitLookupGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
impl<P, F: PrimeField> TwoBitLookupGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
type TableConstant = Fp6<P>
fn two_bit_lookup<CS: ConstraintSystem<F>>(
cs: CS,
b: &[Boolean],
c: &[Self::TableConstant]
) -> Result<Self, SynthesisError>
fn cost() -> usize
impl<P, F: PrimeField> Eq for Fp6Gadget<P, F> where
P: Fp6Parameters,
P::Fp2Params: Fp2Parameters<Fp = F>,
Auto Trait Implementations
impl<P, F> RefUnwindSafe for Fp6Gadget<P, F> where
F: RefUnwindSafe,
P: RefUnwindSafe,
<P as Fp6Parameters>::Fp2Params: RefUnwindSafe,
impl<P, F> Send for Fp6Gadget<P, F>
impl<P, F> Sync for Fp6Gadget<P, F>
impl<P, F> Unpin for Fp6Gadget<P, F> where
F: Unpin,
P: Unpin,
<P as Fp6Parameters>::Fp2Params: Unpin,
impl<P, F> UnwindSafe for Fp6Gadget<P, F> where
F: UnwindSafe,
P: UnwindSafe,
<P as Fp6Parameters>::Fp2Params: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F, T> ConditionalOrEqualsGadget<F> for T where
F: Field,
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
impl<F, T> ConditionalOrEqualsGadget<F> for T where
F: Field,
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
fn conditional_enforce_equal_or<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
var: &Self,
first: &Self,
second: &Self,
should_enforce: &Boolean
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<F, T> OrEqualsGadget<F> for T where
F: Field,
T: ConditionalOrEqualsGadget<F>,
impl<F, T> OrEqualsGadget<F> for T where
F: Field,
T: ConditionalOrEqualsGadget<F>,
fn enforce_equal_or<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
var: &Self,
first: &Self,
second: &Self
) -> Result<(), SynthesisError>
fn cost() -> usize
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more