pub struct MontgomeryAffineVar<P: TECurveConfig, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>>{
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: TECurveConfig, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> MontgomeryAffineVar<P, F>
impl<P: TECurveConfig, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> MontgomeryAffineVar<P, 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 as CurveConfig>::BaseField as Field>::BasePrimeField>,
p: &TEAffine<P>,
) -> Result<Self, SynthesisError>
pub fn new_witness_from_edwards( cs: ConstraintSystemRef<<<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Source§impl<P: TECurveConfig, F> Clone for MontgomeryAffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone + FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
PhantomData<P>: Clone,
impl<P: TECurveConfig, F> Clone for MontgomeryAffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone + FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
PhantomData<P>: Clone,
Source§impl<P: TECurveConfig, F> Debug for MontgomeryAffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug + FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
impl<P: TECurveConfig, F> Debug for MontgomeryAffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug + FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
Auto Trait Implementations§
impl<P, F> Freeze for MontgomeryAffineVar<P, F>
impl<P, F> RefUnwindSafe for MontgomeryAffineVar<P, F>
impl<P, F> Send for MontgomeryAffineVar<P, F>
impl<P, F> Sync for MontgomeryAffineVar<P, F>
impl<P, F> Unpin for MontgomeryAffineVar<P, F>
impl<P, F> UnwindSafe for MontgomeryAffineVar<P, F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more