Trait snarkvm_wasm::traits::curves::GroupGadget [−][src]
Associated Types
Loading content...Required methods
pub fn get_value(&self) -> Option<Self::Value>
[src]
pub fn get_variable(&self) -> Self::Variable
[src]
pub fn zero<CS>(cs: CS) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn add<CS>(&self, cs: CS, other: &Self) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn add_constant<CS>(
&self,
cs: CS,
other: &G
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
other: &G
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn double_in_place<CS>(&mut self, cs: CS) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn negate<CS>(&self, cs: CS) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn cost_of_add() -> usize
[src]
pub fn cost_of_double() -> usize
[src]
Provided methods
pub fn sub<CS>(&self, cs: CS, other: &Self) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn sub_constant<CS>(
&self,
cs: CS,
other: &G
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
other: &G
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn mul_bits<CS>(
&self,
cs: CS,
result: &Self,
bits: impl Iterator<Item = Boolean>
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
result: &Self,
bits: impl Iterator<Item = Boolean>
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
Inputs must be specified in little-endian form.
If the addition law is incomplete for the identity element,
result
must not be the identity element.
pub fn precomputed_base_scalar_mul<'a, CS, I, B>(
&mut self,
cs: CS,
scalar_bits_with_base_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
G: 'a,
I: Iterator<Item = (B, &'a G)>,
[src]
&mut self,
cs: CS,
scalar_bits_with_base_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
G: 'a,
I: Iterator<Item = (B, &'a G)>,
pub fn precomputed_base_symmetric_scalar_mul<'a, CS, I, B>(
&mut self,
cs: CS,
scalar_bits_with_base_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
G: 'a,
I: Iterator<Item = (B, &'a G)>,
[src]
&mut self,
cs: CS,
scalar_bits_with_base_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
G: 'a,
I: Iterator<Item = (B, &'a G)>,
pub fn precomputed_base_scalar_mul_masked<'a, CS, I, B>(
&mut self,
CS,
I,
I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
G: 'a,
I: Iterator<Item = (B, &'a G)>,
[src]
&mut self,
CS,
I,
I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
G: 'a,
I: Iterator<Item = (B, &'a G)>,
pub fn precomputed_base_3_bit_signed_digit_scalar_mul<CS, I, J, K, B>(
CS,
&[B],
K
) -> Result<Self, SynthesisError> where
B: Borrow<[G]>,
CS: ConstraintSystem<F>,
I: Borrow<[Boolean]>,
J: Iterator<Item = I>,
K: Iterator<Item = J>,
[src]
CS,
&[B],
K
) -> Result<Self, SynthesisError> where
B: Borrow<[G]>,
CS: ConstraintSystem<F>,
I: Borrow<[Boolean]>,
J: Iterator<Item = I>,
K: Iterator<Item = J>,
pub fn precomputed_base_multiscalar_mul<'a, CS, T, I, B>(
cs: CS,
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError> where
B: Borrow<[G]>,
CS: ConstraintSystem<F>,
T: 'a + ToBitsGadget<F> + ?Sized,
I: Iterator<Item = &'a T>,
[src]
cs: CS,
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError> where
B: Borrow<[G]>,
CS: ConstraintSystem<F>,
T: 'a + ToBitsGadget<F> + ?Sized,
I: Iterator<Item = &'a T>,
pub fn precomputed_base_symmetric_multiscalar_mul<'a, CS, T, I, B>(
cs: CS,
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError> where
B: Borrow<[G]>,
CS: ConstraintSystem<F>,
T: 'a + ToBitsGadget<F> + ?Sized,
I: Iterator<Item = &'a T>,
[src]
cs: CS,
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError> where
B: Borrow<[G]>,
CS: ConstraintSystem<F>,
T: 'a + ToBitsGadget<F> + ?Sized,
I: Iterator<Item = &'a T>,
pub fn precomputed_base_multiscalar_mul_masked<'a, CS, T, I, B>(
cs: CS,
bases: &[B],
scalars: I,
mask_bases: &[B],
masks: I
) -> Result<Self, SynthesisError> where
B: Borrow<[G]>,
CS: ConstraintSystem<F>,
T: 'a + ToBitsGadget<F> + ?Sized,
I: Iterator<Item = &'a T>,
[src]
cs: CS,
bases: &[B],
scalars: I,
mask_bases: &[B],
masks: I
) -> Result<Self, SynthesisError> where
B: Borrow<[G]>,
CS: ConstraintSystem<F>,
T: 'a + ToBitsGadget<F> + ?Sized,
I: Iterator<Item = &'a T>,
Compute ∏((h_i^{-1} * 1[p_i = 0] + h_i * 1[p_i = 1])^{1 - m_i \xor p_i})((g_i h_i^{-1} * 1[p_i = 0] + g_i^{-1} h_i * 1[p_i = 1])^{m_i \xor p_i}) for all i, m_i being the scalars, p_i being the masks, h_i being the symmetric Pedersen bases and g_i the Pedersen bases.
Implementors
impl<P, F, FG> GroupGadget<GroupProjective<P>, F> for snarkvm_wasm::curves::templates::bls12::AffineGadget<P, F, FG> where
P: SWModelParameters,
F: PrimeField,
FG: FieldGadget<<P as ModelParameters>::BaseField, F>,
[src]
P: SWModelParameters,
F: PrimeField,
FG: FieldGadget<<P as ModelParameters>::BaseField, F>,
type Value = GroupProjective<P>
type Variable = (<FG as FieldGadget<<P as ModelParameters>::BaseField, F>>::Variable, <FG as FieldGadget<<P as ModelParameters>::BaseField, F>>::Variable)
pub fn get_value(
&self
) -> Option<<AffineGadget<P, F, FG> as GroupGadget<GroupProjective<P>, F>>::Value>
[src]
&self
) -> Option<<AffineGadget<P, F, FG> as GroupGadget<GroupProjective<P>, F>>::Value>
pub fn get_variable(
&self
) -> <AffineGadget<P, F, FG> as GroupGadget<GroupProjective<P>, F>>::Variable
[src]
&self
) -> <AffineGadget<P, F, FG> as GroupGadget<GroupProjective<P>, F>>::Variable
pub fn zero<CS>(cs: CS) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn add<CS>(
&self,
cs: CS,
other: &AffineGadget<P, F, FG>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
other: &AffineGadget<P, F, FG>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
Incomplete addition: neither self
nor other
can be the neutral
element.
pub fn add_constant<CS>(
&self,
cs: CS,
other: &GroupProjective<P>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
other: &GroupProjective<P>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
Incomplete addition: neither self
nor other
can be the neutral
element.
pub fn double_in_place<CS>(&mut self, cs: CS) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn negate<CS>(
&self,
cs: CS
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost_of_add() -> usize
[src]
pub fn cost_of_double() -> usize
[src]
impl<P, F, FG> GroupGadget<GroupAffine<P>, F> for snarkvm_wasm::curves::templates::twisted_edwards::AffineGadget<P, F, FG> where
P: TEModelParameters,
F: Field,
FG: FieldGadget<<P as ModelParameters>::BaseField, F>,
[src]
P: TEModelParameters,
F: Field,
FG: FieldGadget<<P as ModelParameters>::BaseField, F>,
type Value = GroupAffine<P>
type Variable = (<FG as FieldGadget<<P as ModelParameters>::BaseField, F>>::Variable, <FG as FieldGadget<<P as ModelParameters>::BaseField, F>>::Variable)
pub fn get_value(
&self
) -> Option<<AffineGadget<P, F, FG> as GroupGadget<GroupAffine<P>, F>>::Value>
[src]
&self
) -> Option<<AffineGadget<P, F, FG> as GroupGadget<GroupAffine<P>, F>>::Value>
pub fn get_variable(
&self
) -> <AffineGadget<P, F, FG> as GroupGadget<GroupAffine<P>, F>>::Variable
[src]
&self
) -> <AffineGadget<P, F, FG> as GroupGadget<GroupAffine<P>, F>>::Variable
pub fn zero<CS>(cs: CS) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn add<CS>(
&self,
cs: CS,
other: &AffineGadget<P, F, FG>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
other: &AffineGadget<P, F, FG>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
Optimized constraints for checking Edwards point addition from ZCash developers Daira Hopwood and Sean Bowe. Requires only 6 constraints compared to 7 for the straightforward version we had earlier.
pub fn add_constant<CS>(
&self,
cs: CS,
other: &GroupAffine<P>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
other: &GroupAffine<P>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn double_in_place<CS>(&mut self, cs: CS) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn negate<CS>(
&self,
cs: CS
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost_of_add() -> usize
[src]
pub fn cost_of_double() -> usize
[src]
impl<P, F, FG> GroupGadget<GroupProjective<P>, F> for snarkvm_wasm::curves::templates::twisted_edwards::AffineGadget<P, F, FG> where
P: TEModelParameters,
F: Field,
FG: FieldGadget<<P as ModelParameters>::BaseField, F>,
[src]
P: TEModelParameters,
F: Field,
FG: FieldGadget<<P as ModelParameters>::BaseField, F>,
type Value = GroupProjective<P>
type Variable = (<FG as FieldGadget<<P as ModelParameters>::BaseField, F>>::Variable, <FG as FieldGadget<<P as ModelParameters>::BaseField, F>>::Variable)
pub fn get_value(
&self
) -> Option<<AffineGadget<P, F, FG> as GroupGadget<GroupProjective<P>, F>>::Value>
[src]
&self
) -> Option<<AffineGadget<P, F, FG> as GroupGadget<GroupProjective<P>, F>>::Value>
pub fn get_variable(
&self
) -> <AffineGadget<P, F, FG> as GroupGadget<GroupProjective<P>, F>>::Variable
[src]
&self
) -> <AffineGadget<P, F, FG> as GroupGadget<GroupProjective<P>, F>>::Variable
pub fn zero<CS>(cs: CS) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn add<CS>(
&self,
cs: CS,
other: &AffineGadget<P, F, FG>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
other: &AffineGadget<P, F, FG>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
Optimized constraints for checking Edwards point addition from ZCash developers Daira Hopwood and Sean Bowe. Requires only 6 constraints compared to 7 for the straightforward version we had earlier.
pub fn add_constant<CS>(
&self,
cs: CS,
other: &GroupProjective<P>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS,
other: &GroupProjective<P>
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn double_in_place<CS>(&mut self, cs: CS) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
pub fn negate<CS>(
&self,
cs: CS
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
[src]
&self,
cs: CS
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn precomputed_base_scalar_mul<'a, CS, I, B>(
&mut self,
cs: CS,
scalar_bits_with_base_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
I: Iterator<Item = (B, &'a GroupProjective<P>)>,
[src]
&mut self,
cs: CS,
scalar_bits_with_base_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
I: Iterator<Item = (B, &'a GroupProjective<P>)>,
pub fn precomputed_base_symmetric_scalar_mul<'a, CS, I, B>(
&mut self,
cs: CS,
scalar_bits_with_base_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
I: Iterator<Item = (B, &'a GroupProjective<P>)>,
[src]
&mut self,
cs: CS,
scalar_bits_with_base_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
I: Iterator<Item = (B, &'a GroupProjective<P>)>,
pub fn precomputed_base_scalar_mul_masked<'a, CS, I, B>(
&mut self,
cs: CS,
scalar_bits_with_base_powers: I,
mask_bits_with_mask_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
I: Iterator<Item = (B, &'a GroupProjective<P>)>,
[src]
&mut self,
cs: CS,
scalar_bits_with_base_powers: I,
mask_bits_with_mask_powers: I
) -> Result<(), SynthesisError> where
B: Borrow<Boolean>,
CS: ConstraintSystem<F>,
I: Iterator<Item = (B, &'a GroupProjective<P>)>,
pub fn precomputed_base_3_bit_signed_digit_scalar_mul<CS, I, J, K, B>(
cs: CS,
bases: &[B],
scalars: K
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
B: Borrow<[GroupProjective<P>]>,
CS: ConstraintSystem<F>,
I: Borrow<[Boolean]>,
J: Iterator<Item = I>,
K: Iterator<Item = J>,
[src]
cs: CS,
bases: &[B],
scalars: K
) -> Result<AffineGadget<P, F, FG>, SynthesisError> where
B: Borrow<[GroupProjective<P>]>,
CS: ConstraintSystem<F>,
I: Borrow<[Boolean]>,
J: Iterator<Item = I>,
K: Iterator<Item = J>,