pub struct Affine<P: TECurveConfig> {
pub x: P::BaseField,
pub y: P::BaseField,
}Expand description
Affine coordinates for a point on a twisted Edwards curve, over the
base field P::BaseField.
Fields§
§x: P::BaseFieldX coordinate of the point represented as a field element
y: P::BaseFieldY coordinate of the point represented as a field element
Implementations§
Source§impl<P: TECurveConfig> Affine<P>
impl<P: TECurveConfig> Affine<P>
Sourcepub const fn new_unchecked(x: P::BaseField, y: P::BaseField) -> Self
pub const fn new_unchecked(x: P::BaseField, y: P::BaseField) -> Self
Construct a new group element without checking whether the coordinates specify a point in the subgroup.
Sourcepub fn new(x: P::BaseField, y: P::BaseField) -> Self
pub fn new(x: P::BaseField, y: P::BaseField) -> Self
Construct a new group element in a way while enforcing that points are in the prime-order subgroup.
§Panics
- If point is not on curve.
- If point is not in the prime-order subgroup.
Sourcepub fn is_on_curve(&self) -> bool
pub fn is_on_curve(&self) -> bool
Checks that the current point is on the elliptic curve.
Source§impl<P: TECurveConfig> Affine<P>
impl<P: TECurveConfig> Affine<P>
Sourcepub fn is_in_prime_order_subgroup(&self) -> bool
pub fn is_in_prime_order_subgroup(&self) -> bool
Checks if this point is in the prime-order subgroup.
This assumes the point is already on the curve and verifies it belongs
to the subgroup with order equal to P::ScalarField.
Trait Implementations§
Source§impl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Affine<P>
impl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Affine<P>
Source§type Output = Projective<P>
type Output = Projective<P>
+ operator.Source§fn add(self, other: &'a Projective<P>) -> Projective<P>
fn add(self, other: &'a Projective<P>) -> Projective<P>
+ operation. Read moreSource§impl<P: TECurveConfig> Add<Projective<P>> for Affine<P>
impl<P: TECurveConfig> Add<Projective<P>> for Affine<P>
Source§type Output = Projective<P>
type Output = Projective<P>
+ operator.Source§fn add(self, other: Projective<P>) -> Projective<P>
fn add(self, other: Projective<P>) -> Projective<P>
+ operation. Read moreSource§impl<P: TECurveConfig> AffineRepr for Affine<P>
impl<P: TECurveConfig> AffineRepr for Affine<P>
Source§fn mul_by_cofactor_to_group(&self) -> Self::Group
fn mul_by_cofactor_to_group(&self) -> Self::Group
Multiplies this element by the cofactor and output the resulting projective element.
Source§fn clear_cofactor(&self) -> Self
fn clear_cofactor(&self) -> Self
Performs cofactor clearing. The default method is simply to multiply by the cofactor. Some curves can implement a more efficient algorithm.
Source§type BaseField = <P as CurveConfig>::BaseField
type BaseField = <P as CurveConfig>::BaseField
Source§type Group = Projective<P>
type Group = Projective<P>
Source§type ScalarField = <P as CurveConfig>::ScalarField
type ScalarField = <P as CurveConfig>::ScalarField
Source§fn xy(&self) -> Option<(Self::BaseField, Self::BaseField)>
fn xy(&self) -> Option<(Self::BaseField, Self::BaseField)>
Source§fn mul_bigint(&self, by: impl BitIteratorBE) -> Self::Group
fn mul_bigint(&self, by: impl BitIteratorBE) -> Self::Group
Source§fn into_group(self) -> Self::Group
fn into_group(self) -> Self::Group
Source§fn mul_by_cofactor(&self) -> Self
fn mul_by_cofactor(&self) -> Self
Source§fn mul_by_cofactor_inv(&self) -> Self
fn mul_by_cofactor_inv(&self) -> Self
Self::ScalarField.Source§impl<P: TECurveConfig> Clone for Affine<P>
impl<P: TECurveConfig> Clone for Affine<P>
Source§impl<P: TECurveConfig> Debug for Affine<P>
impl<P: TECurveConfig> Debug for Affine<P>
Source§impl<P: TECurveConfig> Default for Affine<P>
impl<P: TECurveConfig> Default for Affine<P>
Source§impl<P: TECurveConfig> Display for Affine<P>
impl<P: TECurveConfig> Display for Affine<P>
Source§impl From<Affine<Curve25519Config>> for CompressedPointY
impl From<Affine<Curve25519Config>> for CompressedPointY
Source§fn from(point: AffinePoint) -> Self
fn from(point: AffinePoint) -> Self
Source§impl<P: TECurveConfig> From<Affine<P>> for Projective<P>
impl<P: TECurveConfig> From<Affine<P>> for Projective<P>
Source§fn from(p: Affine<P>) -> Projective<P>
fn from(p: Affine<P>) -> Projective<P>
Source§impl<P: TECurveConfig> From<Projective<P>> for Affine<P>
impl<P: TECurveConfig> From<Projective<P>> for Affine<P>
Source§fn from(p: Projective<P>) -> Affine<P>
fn from(p: Projective<P>) -> Affine<P>
Source§impl<P: TECurveConfig> Hash for Affine<P>
impl<P: TECurveConfig> Hash for Affine<P>
Source§impl<P: TECurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Affine<P>
impl<P: TECurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Affine<P>
Source§impl<P: TECurveConfig> Neg for Affine<P>
impl<P: TECurveConfig> Neg for Affine<P>
Source§impl<P: TECurveConfig> PartialEq<Affine<P>> for Projective<P>
impl<P: TECurveConfig> PartialEq<Affine<P>> for Projective<P>
Source§impl<P: TECurveConfig> PartialEq<Projective<P>> for Affine<P>
impl<P: TECurveConfig> PartialEq<Projective<P>> for Affine<P>
Source§impl<P: TECurveConfig> PartialEq for Affine<P>
impl<P: TECurveConfig> PartialEq for Affine<P>
Source§impl<'a, P: TECurveConfig> Sub<&'a Projective<P>> for Affine<P>
impl<'a, P: TECurveConfig> Sub<&'a Projective<P>> for Affine<P>
Source§type Output = Projective<P>
type Output = Projective<P>
- operator.Source§fn sub(self, other: &'a Projective<P>) -> Projective<P>
fn sub(self, other: &'a Projective<P>) -> Projective<P>
- operation. Read moreSource§impl<P: TECurveConfig> Sub<Projective<P>> for Affine<P>
impl<P: TECurveConfig> Sub<Projective<P>> for Affine<P>
Source§type Output = Projective<P>
type Output = Projective<P>
- operator.Source§fn sub(self, other: Projective<P>) -> Projective<P>
fn sub(self, other: Projective<P>) -> Projective<P>
- operation. Read more