pub struct Projective<P: TECurveConfig> {
pub x: P::BaseField,
pub y: P::BaseField,
pub t: P::BaseField,
pub z: P::BaseField,
}Expand description
Projective implements Extended Twisted Edwards Coordinates
as described in [HKCD08].
This implementation uses the unified addition formulae from that paper (see Section 3.1).
Fields§
§x: P::BaseFieldThe x-coordinate of the point in projective coordinates.
y: P::BaseFieldThe y-coordinate of the point in projective coordinates.
t: P::BaseFieldThe t-coordinate of the point in projective coordinates.
z: P::BaseFieldThe z-coordinate of the point in projective coordinates.
Implementations§
Source§impl<P: TECurveConfig> Projective<P>
impl<P: TECurveConfig> Projective<P>
Trait Implementations§
Source§impl<'a, 'b, P: TECurveConfig> Add<&'a Projective<P>> for &'b Projective<P>
impl<'a, 'b, P: TECurveConfig> Add<&'a Projective<P>> for &'b Projective<P>
Source§type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+ operator.Source§fn add(self, other: &'a Projective<P>) -> Projective<P>
fn add(self, other: &'a Projective<P>) -> Projective<P>
Performs the
+ operation. Read moreSource§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>
The resulting type after applying the
+ operator.Source§fn add(self, other: &'a Projective<P>) -> Projective<P>
fn add(self, other: &'a Projective<P>) -> Projective<P>
Performs the
+ operation. Read moreSource§impl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Projective<P>
Source§impl<'a, 'b, P: TECurveConfig> Add<&'a mut Projective<P>> for &'b Projective<P>
impl<'a, 'b, P: TECurveConfig> Add<&'a mut Projective<P>> for &'b Projective<P>
Source§type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+ operator.Source§fn add(self, other: &'a mut Projective<P>) -> Projective<P>
fn add(self, other: &'a mut Projective<P>) -> Projective<P>
Performs the
+ operation. Read moreSource§impl<'a, P: TECurveConfig> Add<&'a mut Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Add<&'a mut Projective<P>> for Projective<P>
Source§impl<'b, P: TECurveConfig> Add<Projective<P>> for &'b Projective<P>
impl<'b, P: TECurveConfig> Add<Projective<P>> for &'b Projective<P>
Source§type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+ operator.Source§fn add(self, other: Projective<P>) -> Projective<P>
fn add(self, other: Projective<P>) -> Projective<P>
Performs the
+ 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>
The resulting type after applying the
+ operator.Source§fn add(self, other: Projective<P>) -> Projective<P>
fn add(self, other: Projective<P>) -> Projective<P>
Performs the
+ operation. Read moreSource§impl<P: TECurveConfig, T: Borrow<Affine<P>>> Add<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> Add<T> for Projective<P>
Source§impl<P: TECurveConfig> Add for Projective<P>
impl<P: TECurveConfig> Add for Projective<P>
Source§impl<'a, P: TECurveConfig> AddAssign<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> AddAssign<&'a Projective<P>> for Projective<P>
Source§fn add_assign(&mut self, other: &'a Self)
fn add_assign(&mut self, other: &'a Self)
Performs the
+= operation. Read moreSource§impl<'a, P: TECurveConfig> AddAssign<&'a mut Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> AddAssign<&'a mut Projective<P>> for Projective<P>
Source§fn add_assign(&mut self, other: &'a mut Self)
fn add_assign(&mut self, other: &'a mut Self)
Performs the
+= operation. Read moreSource§impl<P: TECurveConfig, T: Borrow<Affine<P>>> AddAssign<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> AddAssign<T> for Projective<P>
Source§fn add_assign(&mut self, other: T)
fn add_assign(&mut self, other: T)
Performs the
+= operation. Read moreSource§impl<P: TECurveConfig> AddAssign for Projective<P>
impl<P: TECurveConfig> AddAssign for Projective<P>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl<P: TECurveConfig> AdditiveGroup for Projective<P>
impl<P: TECurveConfig> AdditiveGroup for Projective<P>
Source§type Scalar = <P as CurveConfig>::ScalarField
type Scalar = <P as CurveConfig>::ScalarField
Scalar associated with the group.
Source§fn double_in_place(&mut self) -> &mut Self
fn double_in_place(&mut self) -> &mut Self
Doubles
self in place.Source§fn neg_in_place(&mut self) -> &mut Self
fn neg_in_place(&mut self) -> &mut Self
Negates
self in place.Source§impl<P: TECurveConfig> Clone for Projective<P>
impl<P: TECurveConfig> Clone for Projective<P>
Source§impl<P: TECurveConfig> CurveGroup for Projective<P>
impl<P: TECurveConfig> CurveGroup for Projective<P>
Source§fn normalize_batch(v: &[Self]) -> Vec<Self::Affine>
fn normalize_batch(v: &[Self]) -> Vec<Self::Affine>
A projective curve element (x, y, t, z) is normalized
to its affine representation, by the conversion
(x, y, t, z) -> (x/z, y/z, t/z, 1).
Batch normalizing N twisted edwards curve elements costs: 1 inversion + 6N field multiplications (batch inversion requires 3N multiplications + 1 inversion).
§Panics
- If any
Zcoordinate of inputvelements is zero.
Source§type BaseField = <P as CurveConfig>::BaseField
type BaseField = <P as CurveConfig>::BaseField
The field over which this curve is defined.
Source§type FullGroup = Affine<P>
type FullGroup = Affine<P>
Type representing an element of the full elliptic curve group, not just
the prime order subgroup.
Source§fn into_affine(self) -> Self::Affine
fn into_affine(self) -> Self::Affine
Converts
self into the affine representation.Source§impl<P: TECurveConfig> Debug for Projective<P>
impl<P: TECurveConfig> Debug for Projective<P>
Source§impl<P: TECurveConfig> Default for Projective<P>
impl<P: TECurveConfig> Default for Projective<P>
Source§impl<P: TECurveConfig> Display for Projective<P>
impl<P: TECurveConfig> Display for Projective<P>
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>
Converts to this type from the input type.
Source§impl From<Projective<Curve25519Config>> for VerifyingKey
impl From<Projective<Curve25519Config>> for VerifyingKey
Source§fn from(point: ProjectivePoint) -> Self
fn from(point: ProjectivePoint) -> Self
Converts to this type from the input type.
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>
Converts to this type from the input type.
Source§impl<P: TECurveConfig> Hash for Projective<P>
impl<P: TECurveConfig> Hash for Projective<P>
Source§impl<P: TECurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Projective<P>
Source§impl<P: TECurveConfig, T: Borrow<P::ScalarField>> MulAssign<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<P::ScalarField>> MulAssign<T> for Projective<P>
Source§fn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
Performs the
*= operation. Read moreSource§impl<P: TECurveConfig> Neg for Projective<P>
impl<P: TECurveConfig> Neg for Projective<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 Projective<P>
impl<P: TECurveConfig> PartialEq for Projective<P>
Source§impl<P: TECurveConfig> PrimeGroup for Projective<P>
impl<P: TECurveConfig> PrimeGroup for Projective<P>
Source§type ScalarField = <P as CurveConfig>::ScalarField
type ScalarField = <P as CurveConfig>::ScalarField
The scalar field
F_r, where r is the order of this group.Source§fn mul_bigint(&self, other: impl BitIteratorBE) -> Self
fn mul_bigint(&self, other: impl BitIteratorBE) -> Self
Performs scalar multiplication of this element.
Source§fn mul_bits_be(&self, other: impl Iterator<Item = bool>) -> Self
fn mul_bits_be(&self, other: impl Iterator<Item = bool>) -> Self
Computes
other * self, where other is a big-endian
bit representation of some integer.Source§impl<'a, 'b, P: TECurveConfig> Sub<&'a Projective<P>> for &'b Projective<P>
impl<'a, 'b, P: TECurveConfig> Sub<&'a Projective<P>> for &'b Projective<P>
Source§type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
- operator.Source§fn sub(self, other: &'a Projective<P>) -> Projective<P>
fn sub(self, other: &'a Projective<P>) -> Projective<P>
Performs the
- operation. Read moreSource§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>
The resulting type after applying the
- operator.Source§fn sub(self, other: &'a Projective<P>) -> Projective<P>
fn sub(self, other: &'a Projective<P>) -> Projective<P>
Performs the
- operation. Read moreSource§impl<'a, P: TECurveConfig> Sub<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Sub<&'a Projective<P>> for Projective<P>
Source§impl<'a, 'b, P: TECurveConfig> Sub<&'a mut Projective<P>> for &'b Projective<P>
impl<'a, 'b, P: TECurveConfig> Sub<&'a mut Projective<P>> for &'b Projective<P>
Source§type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
- operator.Source§fn sub(self, other: &'a mut Projective<P>) -> Projective<P>
fn sub(self, other: &'a mut Projective<P>) -> Projective<P>
Performs the
- operation. Read moreSource§impl<'a, P: TECurveConfig> Sub<&'a mut Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Sub<&'a mut Projective<P>> for Projective<P>
Source§impl<'b, P: TECurveConfig> Sub<Projective<P>> for &'b Projective<P>
impl<'b, P: TECurveConfig> Sub<Projective<P>> for &'b Projective<P>
Source§type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
- operator.Source§fn sub(self, other: Projective<P>) -> Projective<P>
fn sub(self, other: Projective<P>) -> Projective<P>
Performs the
- 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>
The resulting type after applying the
- operator.Source§fn sub(self, other: Projective<P>) -> Projective<P>
fn sub(self, other: Projective<P>) -> Projective<P>
Performs the
- operation. Read moreSource§impl<P: TECurveConfig, T: Borrow<Affine<P>>> Sub<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> Sub<T> for Projective<P>
Source§impl<P: TECurveConfig> Sub for Projective<P>
impl<P: TECurveConfig> Sub for Projective<P>
Source§impl<'a, P: TECurveConfig> SubAssign<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> SubAssign<&'a Projective<P>> for Projective<P>
Source§fn sub_assign(&mut self, other: &'a Self)
fn sub_assign(&mut self, other: &'a Self)
Performs the
-= operation. Read moreSource§impl<'a, P: TECurveConfig> SubAssign<&'a mut Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> SubAssign<&'a mut Projective<P>> for Projective<P>
Source§fn sub_assign(&mut self, other: &'a mut Self)
fn sub_assign(&mut self, other: &'a mut Self)
Performs the
-= operation. Read moreSource§impl<P: TECurveConfig, T: Borrow<Affine<P>>> SubAssign<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> SubAssign<T> for Projective<P>
Source§fn sub_assign(&mut self, other: T)
fn sub_assign(&mut self, other: T)
Performs the
-= operation. Read moreSource§impl<P: TECurveConfig> SubAssign for Projective<P>
impl<P: TECurveConfig> SubAssign for Projective<P>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreSource§impl<'a, P: TECurveConfig> Sum<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Sum<&'a Projective<P>> for Projective<P>
Source§impl<P: TECurveConfig, T: Borrow<Affine<P>>> Sum<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> Sum<T> for Projective<P>
Source§impl<P: TECurveConfig> Sum for Projective<P>
impl<P: TECurveConfig> Sum for Projective<P>
Source§impl<P: TECurveConfig> Zero for Projective<P>
impl<P: TECurveConfig> Zero for Projective<P>
Source§impl<P: TECurveConfig> Zeroize for Projective<P>
impl<P: TECurveConfig> Zeroize for Projective<P>
impl<P: TECurveConfig> Copy for Projective<P>
impl<P> Eq for Projective<P>where
P: TECurveConfig,
Auto Trait Implementations§
impl<P> Freeze for Projective<P>
impl<P> RefUnwindSafe for Projective<P>
impl<P> Send for Projective<P>
impl<P> Sync for Projective<P>
impl<P> Unpin for Projective<P>
impl<P> UnwindSafe for Projective<P>
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