pub struct AffinePoint {
pub(crate) x: FieldElement,
pub(crate) y: FieldElement,
}Expand description
Affine point on untwisted curve
Fields§
§x: FieldElement§y: FieldElementImplementations§
Source§impl AffinePoint
impl AffinePoint
Sourcepub const IDENTITY: AffinePoint
pub const IDENTITY: AffinePoint
The identity point
Sourcepub fn compress(&self) -> CompressedEdwardsY
pub fn compress(&self) -> CompressedEdwardsY
Standard compression; store Y and sign of X
Sourcepub fn is_on_curve(&self) -> Choice
pub fn is_on_curve(&self) -> Choice
Check if this point is on the curve
Sourcepub fn to_edwards(&self) -> EdwardsPoint
pub fn to_edwards(&self) -> EdwardsPoint
Convert to edwards extended point
pub(crate) fn isogeny(&self) -> Self
Sourcepub(crate) fn try_random<R>(rng: &mut R) -> Result<Self, R::Error>
pub(crate) fn try_random<R>(rng: &mut R) -> Result<Self, R::Error>
Generate a random AffinePoint.
Helper method that has TryRng bounds so ProjectivePoint can call it for its group
impls, otherwise end users should use the Generate trait.
Trait Implementations§
Source§impl Add<&AffinePoint> for &EdwardsPoint
impl Add<&AffinePoint> for &EdwardsPoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+ operator.Source§fn add(self, other: &AffinePoint) -> EdwardsPoint
fn add(self, other: &AffinePoint) -> EdwardsPoint
Performs the
+ operation. Read moreSource§impl<'b> Add<&'b AffinePoint> for EdwardsPoint
impl<'b> Add<&'b AffinePoint> for EdwardsPoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+ operator.Source§fn add(self, rhs: &'b AffinePoint) -> EdwardsPoint
fn add(self, rhs: &'b AffinePoint) -> EdwardsPoint
Performs the
+ operation. Read moreSource§impl Add<&EdwardsPoint> for &AffinePoint
impl Add<&EdwardsPoint> for &AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+ operator.Source§fn add(self, other: &EdwardsPoint) -> EdwardsPoint
fn add(self, other: &EdwardsPoint) -> EdwardsPoint
Performs the
+ operation. Read moreSource§impl<'b> Add<&'b EdwardsPoint> for AffinePoint
impl<'b> Add<&'b EdwardsPoint> for AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+ operator.Source§fn add(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
fn add(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
Performs the
+ operation. Read moreSource§impl<'a> Add<AffinePoint> for &'a EdwardsPoint
impl<'a> Add<AffinePoint> for &'a EdwardsPoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+ operator.Source§fn add(self, rhs: AffinePoint) -> EdwardsPoint
fn add(self, rhs: AffinePoint) -> EdwardsPoint
Performs the
+ operation. Read moreSource§impl Add<AffinePoint> for EdwardsPoint
impl Add<AffinePoint> for EdwardsPoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+ operator.Source§fn add(self, rhs: AffinePoint) -> EdwardsPoint
fn add(self, rhs: AffinePoint) -> EdwardsPoint
Performs the
+ operation. Read moreSource§impl<'a> Add<EdwardsPoint> for &'a AffinePoint
impl<'a> Add<EdwardsPoint> for &'a AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+ operator.Source§fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the
+ operation. Read moreSource§impl Add<EdwardsPoint> for AffinePoint
impl Add<EdwardsPoint> for AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+ operator.Source§fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the
+ operation. Read moreSource§impl AddAssign<&AffinePoint> for EdwardsPoint
impl AddAssign<&AffinePoint> for EdwardsPoint
Source§fn add_assign(&mut self, rhs: &AffinePoint)
fn add_assign(&mut self, rhs: &AffinePoint)
Performs the
+= operation. Read moreSource§impl AddAssign<&EdwardsPoint> for AffinePoint
impl AddAssign<&EdwardsPoint> for AffinePoint
Source§fn add_assign(&mut self, rhs: &EdwardsPoint)
fn add_assign(&mut self, rhs: &EdwardsPoint)
Performs the
+= operation. Read moreSource§impl AddAssign<AffinePoint> for EdwardsPoint
impl AddAssign<AffinePoint> for EdwardsPoint
Source§fn add_assign(&mut self, rhs: AffinePoint)
fn add_assign(&mut self, rhs: AffinePoint)
Performs the
+= operation. Read moreSource§impl AddAssign<EdwardsPoint> for AffinePoint
impl AddAssign<EdwardsPoint> for AffinePoint
Source§fn add_assign(&mut self, rhs: EdwardsPoint)
fn add_assign(&mut self, rhs: EdwardsPoint)
Performs the
+= operation. Read moreSource§impl AffineCoordinates for AffinePoint
impl AffineCoordinates for AffinePoint
Source§impl Clone for AffinePoint
impl Clone for AffinePoint
Source§fn clone(&self) -> AffinePoint
fn clone(&self) -> AffinePoint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConditionallySelectable for AffinePoint
impl ConditionallySelectable for AffinePoint
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
Conditionally swap
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl ConstantTimeEq for AffinePoint
impl ConstantTimeEq for AffinePoint
Source§impl CtEq for AffinePoint
impl CtEq for AffinePoint
Source§impl CtSelect for AffinePoint
impl CtSelect for AffinePoint
Source§impl CurveAffine for AffinePoint
impl CurveAffine for AffinePoint
Source§type Curve = EdwardsPoint
type Curve = EdwardsPoint
The efficient representation for this elliptic curve.
Source§fn identity() -> AffinePoint
fn identity() -> AffinePoint
Returns the additive identity.
Source§fn generator() -> AffinePoint
fn generator() -> AffinePoint
Returns a fixed generator of unknown exponent.
Source§fn is_identity(&self) -> Choice
fn is_identity(&self) -> Choice
Determines if this point represents the additive identity.
Source§fn to_curve(&self) -> EdwardsPoint
fn to_curve(&self) -> EdwardsPoint
Converts this affine point to its efficient representation.
Source§impl Debug for AffinePoint
impl Debug for AffinePoint
Source§impl Default for AffinePoint
impl Default for AffinePoint
Source§impl From<&AffinePoint> for EdwardsPoint
impl From<&AffinePoint> for EdwardsPoint
Source§fn from(value: &AffinePoint) -> Self
fn from(value: &AffinePoint) -> Self
Converts to this type from the input type.
Source§impl From<&EdwardsPoint> for AffinePoint
impl From<&EdwardsPoint> for AffinePoint
Source§fn from(value: &EdwardsPoint) -> Self
fn from(value: &EdwardsPoint) -> Self
Converts to this type from the input type.
Source§impl From<AffinePoint> for EdwardsPoint
impl From<AffinePoint> for EdwardsPoint
Source§fn from(value: AffinePoint) -> Self
fn from(value: AffinePoint) -> Self
Converts to this type from the input type.
Source§impl From<EdwardsPoint> for AffinePoint
impl From<EdwardsPoint> for AffinePoint
Source§fn from(value: EdwardsPoint) -> Self
fn from(value: EdwardsPoint) -> Self
Converts to this type from the input type.
Source§impl From<NonIdentity<AffinePoint>> for AffinePoint
impl From<NonIdentity<AffinePoint>> for AffinePoint
Source§fn from(affine: NonIdentity<AffinePoint>) -> Self
fn from(affine: NonIdentity<AffinePoint>) -> Self
Converts to this type from the input type.
Source§impl Generate for AffinePoint
impl Generate for AffinePoint
Source§fn try_generate_from_rng<R: TryCryptoRng + ?Sized>(
rng: &mut R,
) -> Result<Self, R::Error>
fn try_generate_from_rng<R: TryCryptoRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>
Generate random key using the provided
TryCryptoRng. Read moreSource§fn generate_from_rng<R>(rng: &mut R) -> Self
fn generate_from_rng<R>(rng: &mut R) -> Self
Generate random key using the provided
CryptoRng.Source§impl GroupEncoding for AffinePoint
impl GroupEncoding for AffinePoint
Source§type Repr = Array<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B1>>
type Repr = Array<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B1>>
The encoding of group elements. Read more
Source§fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
Attempts to deserialize a group element from its encoding.
Source§impl Mul<&Scalar<Ed448>> for &AffinePoint
impl Mul<&Scalar<Ed448>> for &AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
* operator.Source§impl<'b> Mul<&'b Scalar<Ed448>> for AffinePoint
impl<'b> Mul<&'b Scalar<Ed448>> for AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &'b EdwardsScalar) -> EdwardsPoint
fn mul(self, rhs: &'b EdwardsScalar) -> EdwardsPoint
Performs the
* operation. Read moreSource§impl<'a> Mul<Scalar<Ed448>> for &'a AffinePoint
impl<'a> Mul<Scalar<Ed448>> for &'a AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
* operator.Source§fn mul(self, rhs: EdwardsScalar) -> EdwardsPoint
fn mul(self, rhs: EdwardsScalar) -> EdwardsPoint
Performs the
* operation. Read moreSource§impl Mul<Scalar<Ed448>> for AffinePoint
impl Mul<Scalar<Ed448>> for AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
* operator.Source§fn mul(self, rhs: EdwardsScalar) -> EdwardsPoint
fn mul(self, rhs: EdwardsScalar) -> EdwardsPoint
Performs the
* operation. Read moreSource§impl MulVartime<&Scalar<Ed448>> for &AffinePoint
impl MulVartime<&Scalar<Ed448>> for &AffinePoint
Source§fn mul_vartime(self, scalar: &EdwardsScalar) -> Self::Output
fn mul_vartime(self, scalar: &EdwardsScalar) -> Self::Output
Multiply
self by rhs in variable-time.Source§impl MulVartime<&Scalar<Ed448>> for AffinePoint
impl MulVartime<&Scalar<Ed448>> for AffinePoint
Source§fn mul_vartime(self, scalar: &EdwardsScalar) -> Self::Output
fn mul_vartime(self, scalar: &EdwardsScalar) -> Self::Output
Multiply
self by rhs in variable-time.Source§impl MulVartime<Scalar<Ed448>> for AffinePoint
impl MulVartime<Scalar<Ed448>> for AffinePoint
Source§fn mul_vartime(self, scalar: EdwardsScalar) -> Self::Output
fn mul_vartime(self, scalar: EdwardsScalar) -> Self::Output
Multiply
self by rhs in variable-time.Source§impl Neg for AffinePoint
impl Neg for AffinePoint
Source§impl PartialEq for AffinePoint
impl PartialEq for AffinePoint
Source§impl Sub<&AffinePoint> for &EdwardsPoint
impl Sub<&AffinePoint> for &EdwardsPoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
- operator.Source§fn sub(self, other: &AffinePoint) -> EdwardsPoint
fn sub(self, other: &AffinePoint) -> EdwardsPoint
Performs the
- operation. Read moreSource§impl<'b> Sub<&'b AffinePoint> for EdwardsPoint
impl<'b> Sub<&'b AffinePoint> for EdwardsPoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
- operator.Source§fn sub(self, rhs: &'b AffinePoint) -> EdwardsPoint
fn sub(self, rhs: &'b AffinePoint) -> EdwardsPoint
Performs the
- operation. Read moreSource§impl Sub<&EdwardsPoint> for &AffinePoint
impl Sub<&EdwardsPoint> for &AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
- operator.Source§fn sub(self, other: &EdwardsPoint) -> EdwardsPoint
fn sub(self, other: &EdwardsPoint) -> EdwardsPoint
Performs the
- operation. Read moreSource§impl<'b> Sub<&'b EdwardsPoint> for AffinePoint
impl<'b> Sub<&'b EdwardsPoint> for AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
- operator.Source§fn sub(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
fn sub(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
Performs the
- operation. Read moreSource§impl<'a> Sub<AffinePoint> for &'a EdwardsPoint
impl<'a> Sub<AffinePoint> for &'a EdwardsPoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
- operator.Source§fn sub(self, rhs: AffinePoint) -> EdwardsPoint
fn sub(self, rhs: AffinePoint) -> EdwardsPoint
Performs the
- operation. Read moreSource§impl Sub<AffinePoint> for EdwardsPoint
impl Sub<AffinePoint> for EdwardsPoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
- operator.Source§fn sub(self, rhs: AffinePoint) -> EdwardsPoint
fn sub(self, rhs: AffinePoint) -> EdwardsPoint
Performs the
- operation. Read moreSource§impl<'a> Sub<EdwardsPoint> for &'a AffinePoint
impl<'a> Sub<EdwardsPoint> for &'a AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
- operator.Source§fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the
- operation. Read moreSource§impl Sub<EdwardsPoint> for AffinePoint
impl Sub<EdwardsPoint> for AffinePoint
Source§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
- operator.Source§fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the
- operation. Read moreSource§impl SubAssign<&AffinePoint> for EdwardsPoint
impl SubAssign<&AffinePoint> for EdwardsPoint
Source§fn sub_assign(&mut self, rhs: &AffinePoint)
fn sub_assign(&mut self, rhs: &AffinePoint)
Performs the
-= operation. Read moreSource§impl SubAssign<&EdwardsPoint> for AffinePoint
impl SubAssign<&EdwardsPoint> for AffinePoint
Source§fn sub_assign(&mut self, rhs: &EdwardsPoint)
fn sub_assign(&mut self, rhs: &EdwardsPoint)
Performs the
-= operation. Read moreSource§impl SubAssign<AffinePoint> for EdwardsPoint
impl SubAssign<AffinePoint> for EdwardsPoint
Source§fn sub_assign(&mut self, rhs: AffinePoint)
fn sub_assign(&mut self, rhs: AffinePoint)
Performs the
-= operation. Read moreSource§impl SubAssign<EdwardsPoint> for AffinePoint
impl SubAssign<EdwardsPoint> for AffinePoint
Source§fn sub_assign(&mut self, rhs: EdwardsPoint)
fn sub_assign(&mut self, rhs: EdwardsPoint)
Performs the
-= operation. Read moreSource§impl TryFrom<AffinePoint> for NonIdentity<AffinePoint>
impl TryFrom<AffinePoint> for NonIdentity<AffinePoint>
impl Copy for AffinePoint
impl DefaultIsZeroes for AffinePoint
impl Eq for AffinePoint
Auto Trait Implementations§
impl Freeze for AffinePoint
impl RefUnwindSafe for AffinePoint
impl Send for AffinePoint
impl Sync for AffinePoint
impl Unpin for AffinePoint
impl UnsafeUnpin for AffinePoint
impl UnwindSafe for AffinePoint
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