Struct ark_r1cs_std::groups::curves::twisted_edwards::MontgomeryAffineVar
source · 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,
/* private fields */
}
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§
source§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>,
sourcepub 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.
sourcepub 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.
sourcepub fn into_edwards(&self) -> Result<AffineVar<P, F>, SynthesisError>
pub fn into_edwards(&self) -> Result<AffineVar<P, F>, SynthesisError>
Converts self
into a Twisted Edwards curve point variable.
Trait Implementations§
source§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>,
source§impl<P: TEModelParameters, F> Clone for MontgomeryAffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone + FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
impl<P: TEModelParameters, F> Clone for MontgomeryAffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone + FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
source§impl<P: TEModelParameters, F> Debug for MontgomeryAffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug + FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
impl<P: TEModelParameters, F> Debug for MontgomeryAffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug + FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
source§impl<P, F> R1CSVar<<<P as CurveConfig>::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 CurveConfig>::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>,
§type Value = (<P as CurveConfig>::BaseField, <P as CurveConfig>::BaseField)
type Value = (<P as CurveConfig>::BaseField, <P as CurveConfig>::BaseField)
The type of the “native” value that
Self
represents in the constraint
system.source§fn cs(&self) -> ConstraintSystemRef<<P::BaseField as Field>::BasePrimeField>
fn cs(&self) -> ConstraintSystemRef<<P::BaseField as Field>::BasePrimeField>
Returns the underlying
ConstraintSystemRef
. Read moresource§fn value(&self) -> Result<Self::Value, SynthesisError>
fn value(&self) -> Result<Self::Value, SynthesisError>
Returns the value that is assigned to
self
in the underlying
ConstraintSystem
.source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns
true
if self
is a circuit-generation-time constant.