pub struct Projective<P: SWCurveConfig> {
pub x: P::BaseField,
pub y: P::BaseField,
pub z: P::BaseField,
}Expand description
Jacobian coordinates for a point on an elliptic curve in short Weierstrass
form, over the base field P::BaseField. This struct implements arithmetic
via the Jacobian formulae.
Fields§
§x: P::BaseFieldX / Z projection of the affine X
y: P::BaseFieldY / Z projection of the affine Y
z: P::BaseFieldProjective multiplicative inverse. Will be 0 only at infinity.
Implementations§
Source§impl<P: SWCurveConfig> Projective<P>
impl<P: SWCurveConfig> Projective<P>
Sourcepub const fn new_unchecked(
x: P::BaseField,
y: P::BaseField,
z: P::BaseField,
) -> Self
pub const fn new_unchecked( x: P::BaseField, y: P::BaseField, z: P::BaseField, ) -> Self
Constructs a new group element without checking whether the coordinates specify a point in the subgroup.
Trait Implementations§
Source§impl<'a, 'b, P: SWCurveConfig> Add<&'a Projective<P>> for &'b Projective<P>
impl<'a, 'b, P: SWCurveConfig> Add<&'a Projective<P>> for &'b Projective<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<'a, P: SWCurveConfig> Add<&'a Projective<P>> for Affine<P>
impl<'a, P: SWCurveConfig> 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<'a, P: SWCurveConfig> Add<&'a Projective<P>> for Projective<P>
impl<'a, P: SWCurveConfig> Add<&'a Projective<P>> for Projective<P>
Source§impl<'a, 'b, P: SWCurveConfig> Add<&'a mut Projective<P>> for &'b Projective<P>
impl<'a, 'b, P: SWCurveConfig> Add<&'a mut Projective<P>> for &'b Projective<P>
Source§type Output = Projective<P>
type Output = Projective<P>
+ operator.Source§fn add(self, other: &'a mut Projective<P>) -> Projective<P>
fn add(self, other: &'a mut Projective<P>) -> Projective<P>
+ operation. Read moreSource§impl<'a, P: SWCurveConfig> Add<&'a mut Projective<P>> for Projective<P>
impl<'a, P: SWCurveConfig> Add<&'a mut Projective<P>> for Projective<P>
Source§impl<'b, P: SWCurveConfig> Add<Projective<P>> for &'b Projective<P>
impl<'b, P: SWCurveConfig> Add<Projective<P>> for &'b Projective<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: SWCurveConfig> Add<Projective<P>> for Affine<P>
impl<P: SWCurveConfig> 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: SWCurveConfig, T: Borrow<Affine<P>>> Add<T> for Projective<P>
impl<P: SWCurveConfig, T: Borrow<Affine<P>>> Add<T> for Projective<P>
Source§impl<P: SWCurveConfig> Add for Projective<P>
impl<P: SWCurveConfig> Add for Projective<P>
Source§impl<'a, P: SWCurveConfig> AddAssign<&'a Projective<P>> for Projective<P>
impl<'a, P: SWCurveConfig> AddAssign<&'a Projective<P>> for Projective<P>
Source§fn add_assign(&mut self, other: &'a Self)
fn add_assign(&mut self, other: &'a Self)
+= operation. Read moreSource§impl<'a, P: SWCurveConfig> AddAssign<&'a mut Projective<P>> for Projective<P>
impl<'a, P: SWCurveConfig> 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)
+= operation. Read moreSource§impl<P: SWCurveConfig, T: Borrow<Affine<P>>> AddAssign<T> for Projective<P>
impl<P: SWCurveConfig, T: Borrow<Affine<P>>> AddAssign<T> for Projective<P>
Source§fn add_assign(&mut self, other: T)
fn add_assign(&mut self, other: T)
Source§impl<P: SWCurveConfig> AddAssign for Projective<P>
impl<P: SWCurveConfig> AddAssign for Projective<P>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+= operation. Read moreSource§impl<P: SWCurveConfig> AdditiveGroup for Projective<P>
impl<P: SWCurveConfig> AdditiveGroup for Projective<P>
Source§fn double_in_place(&mut self) -> &mut Self
fn double_in_place(&mut self) -> &mut Self
Sets self = 2 * self. Note that Jacobian formulae are incomplete, and
so doubling cannot be computed as self + self. Instead, this
implementation uses the following specialized doubling formulae:
Source§type Scalar = <P as CurveConfig>::ScalarField
type Scalar = <P as CurveConfig>::ScalarField
Source§fn neg_in_place(&mut self) -> &mut Self
fn neg_in_place(&mut self) -> &mut Self
self in place.Source§impl<P: SWCurveConfig> Clone for Projective<P>
impl<P: SWCurveConfig> Clone for Projective<P>
Source§impl<P: SWCurveConfig> CurveGroup for Projective<P>
impl<P: SWCurveConfig> CurveGroup for Projective<P>
Source§fn normalize_batch(v: &[Self]) -> Vec<Self::Affine>
fn normalize_batch(v: &[Self]) -> Vec<Self::Affine>
Normalizes a slice of projective elements so that conversion to affine is inexpensive.
In more detail, this method converts a curve point in Jacobian coordinates (x, y, z) into an equivalent representation (x/z^2, y/z^3, 1).
For N = v.len(), this costs 1 inversion + 6N field multiplications + N
field squarings.
(Where batch inversion comprises 3N field multiplications + 1 inversion of these operations)
Source§type BaseField = <P as CurveConfig>::BaseField
type BaseField = <P as CurveConfig>::BaseField
Source§type FullGroup = Affine<P>
type FullGroup = Affine<P>
Source§fn into_affine(self) -> Self::Affine
fn into_affine(self) -> Self::Affine
self into the affine representation.Source§impl<P: SWCurveConfig> Debug for Projective<P>
impl<P: SWCurveConfig> Debug for Projective<P>
Source§impl<P: SWCurveConfig> Default for Projective<P>
impl<P: SWCurveConfig> Default for Projective<P>
Source§impl<P: SWCurveConfig> Display for Projective<P>
impl<P: SWCurveConfig> Display for Projective<P>
Source§impl<P: SWCurveConfig> From<Affine<P>> for Projective<P>
impl<P: SWCurveConfig> From<Affine<P>> for Projective<P>
Source§fn from(p: Affine<P>) -> Projective<P>
fn from(p: Affine<P>) -> Projective<P>
Source§impl<P: SWCurveConfig> From<Projective<P>> for Affine<P>
impl<P: SWCurveConfig> From<Projective<P>> for Affine<P>
Source§fn from(p: Projective<P>) -> Affine<P>
fn from(p: Projective<P>) -> Affine<P>
Source§impl<P: SWCurveConfig> Hash for Projective<P>
impl<P: SWCurveConfig> Hash for Projective<P>
Source§impl<P: SWCurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Projective<P>
impl<P: SWCurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Projective<P>
Source§impl<P: SWCurveConfig, T: Borrow<P::ScalarField>> MulAssign<T> for Projective<P>
impl<P: SWCurveConfig, T: Borrow<P::ScalarField>> MulAssign<T> for Projective<P>
Source§fn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
*= operation. Read moreSource§impl<P: SWCurveConfig> Neg for Projective<P>
impl<P: SWCurveConfig> Neg for Projective<P>
Source§impl<P: SWCurveConfig> PartialEq<Affine<P>> for Projective<P>
impl<P: SWCurveConfig> PartialEq<Affine<P>> for Projective<P>
Source§impl<P: SWCurveConfig> PartialEq<Projective<P>> for Affine<P>
impl<P: SWCurveConfig> PartialEq<Projective<P>> for Affine<P>
Source§impl<P: SWCurveConfig> PartialEq for Projective<P>
impl<P: SWCurveConfig> PartialEq for Projective<P>
Source§impl<P: SWCurveConfig> PrimeGroup for Projective<P>
impl<P: SWCurveConfig> PrimeGroup for Projective<P>
Source§type ScalarField = <P as CurveConfig>::ScalarField
type ScalarField = <P as CurveConfig>::ScalarField
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
Source§fn mul_bits_be(&self, other: impl Iterator<Item = bool>) -> Self
fn mul_bits_be(&self, other: impl Iterator<Item = bool>) -> Self
other * self, where other is a big-endian
bit representation of some integer.Source§impl<'a, 'b, P: SWCurveConfig> Sub<&'a Projective<P>> for &'b Projective<P>
impl<'a, 'b, P: SWCurveConfig> Sub<&'a Projective<P>> for &'b Projective<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<'a, P: SWCurveConfig> Sub<&'a Projective<P>> for Affine<P>
impl<'a, P: SWCurveConfig> 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<'a, P: SWCurveConfig> Sub<&'a Projective<P>> for Projective<P>
impl<'a, P: SWCurveConfig> Sub<&'a Projective<P>> for Projective<P>
Source§impl<'a, 'b, P: SWCurveConfig> Sub<&'a mut Projective<P>> for &'b Projective<P>
impl<'a, 'b, P: SWCurveConfig> Sub<&'a mut Projective<P>> for &'b Projective<P>
Source§type Output = Projective<P>
type Output = Projective<P>
- operator.Source§fn sub(self, other: &'a mut Projective<P>) -> Projective<P>
fn sub(self, other: &'a mut Projective<P>) -> Projective<P>
- operation. Read moreSource§impl<'a, P: SWCurveConfig> Sub<&'a mut Projective<P>> for Projective<P>
impl<'a, P: SWCurveConfig> Sub<&'a mut Projective<P>> for Projective<P>
Source§impl<'b, P: SWCurveConfig> Sub<Projective<P>> for &'b Projective<P>
impl<'b, P: SWCurveConfig> Sub<Projective<P>> for &'b Projective<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 moreSource§impl<P: SWCurveConfig> Sub<Projective<P>> for Affine<P>
impl<P: SWCurveConfig> 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 moreSource§impl<P: SWCurveConfig, T: Borrow<Affine<P>>> Sub<T> for Projective<P>
impl<P: SWCurveConfig, T: Borrow<Affine<P>>> Sub<T> for Projective<P>
Source§impl<P: SWCurveConfig> Sub for Projective<P>
impl<P: SWCurveConfig> Sub for Projective<P>
Source§impl<'a, P: SWCurveConfig> SubAssign<&'a Projective<P>> for Projective<P>
impl<'a, P: SWCurveConfig> SubAssign<&'a Projective<P>> for Projective<P>
Source§fn sub_assign(&mut self, other: &'a Self)
fn sub_assign(&mut self, other: &'a Self)
-= operation. Read moreSource§impl<'a, P: SWCurveConfig> SubAssign<&'a mut Projective<P>> for Projective<P>
impl<'a, P: SWCurveConfig> 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)
-= operation. Read moreSource§impl<P: SWCurveConfig, T: Borrow<Affine<P>>> SubAssign<T> for Projective<P>
impl<P: SWCurveConfig, T: Borrow<Affine<P>>> SubAssign<T> for Projective<P>
Source§fn sub_assign(&mut self, other: T)
fn sub_assign(&mut self, other: T)
-= operation. Read moreSource§impl<P: SWCurveConfig> SubAssign for Projective<P>
impl<P: SWCurveConfig> SubAssign for Projective<P>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-= operation. Read more