Struct ark_r1cs_std::groups::curves::twisted_edwards::MontgomeryAffineVar [−][src]
pub struct MontgomeryAffineVar<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>, { pub x: F, pub y: F, // some fields omitted }
Expand description
An implementation of arithmetic for Montgomery curves that relies on incomplete addition formulae for the affine model, as outlined in the EFD.
This is intended for use primarily for implementing efficient multi-scalar-multiplication in the Bowe-Hopwood-Pedersen hash.
Fields
x: F
The x-coordinate.
y: F
The y-coordinate.
Implementations
impl<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> MontgomeryAffineVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> MontgomeryAffineVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
pub fn from_edwards_to_coords(
p: &TEAffine<P>
) -> Result<(P::BaseField, P::BaseField), SynthesisError>
pub fn from_edwards_to_coords(
p: &TEAffine<P>
) -> Result<(P::BaseField, P::BaseField), SynthesisError>
Converts a Twisted Edwards curve point to coordinates for the corresponding affine Montgomery curve point.
pub fn new_witness_from_edwards(
cs: ConstraintSystemRef<<P::BaseField as Field>::BasePrimeField>,
p: &TEAffine<P>
) -> Result<Self, SynthesisError>
pub fn new_witness_from_edwards(
cs: ConstraintSystemRef<<P::BaseField as Field>::BasePrimeField>,
p: &TEAffine<P>
) -> Result<Self, SynthesisError>
Converts a Twisted Edwards curve point to coordinates for the corresponding affine Montgomery curve point.
Converts self
into a Twisted Edwards curve point variable.
Trait Implementations
impl<'a, P, F> Add<&'a MontgomeryAffineVar<P, F>> for MontgomeryAffineVar<P, F> where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, P, F> Add<&'a MontgomeryAffineVar<P, F>> for MontgomeryAffineVar<P, F> where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> Clone for MontgomeryAffineVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone,
impl<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> Clone for MontgomeryAffineVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone,
impl<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> Debug for MontgomeryAffineVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug,
impl<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> Debug for MontgomeryAffineVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug,
impl<P, F> R1CSVar<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for MontgomeryAffineVar<P, F> where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> R1CSVar<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for MontgomeryAffineVar<P, F> where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
Auto Trait Implementations
impl<P, F> RefUnwindSafe for MontgomeryAffineVar<P, F> where
F: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, F> Send for MontgomeryAffineVar<P, F> where
F: Send,
impl<P, F> Sync for MontgomeryAffineVar<P, F> where
F: Sync,
impl<P, F> Unpin for MontgomeryAffineVar<P, F> where
F: Unpin,
P: Unpin,
impl<P, F> UnwindSafe for MontgomeryAffineVar<P, F> where
F: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V