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::BaseField§y: P::BaseField§t: P::BaseField§z: P::BaseField

Implementations§

source§

impl<P: TECurveConfig> Projective<P>

source

pub const fn new_unchecked( x: P::BaseField, y: P::BaseField, t: P::BaseField, z: P::BaseField ) -> Self

Construct a new group element without checking whether the coordinates specify a point in the subgroup.

source

pub fn new( x: P::BaseField, y: P::BaseField, t: P::BaseField, z: P::BaseField ) -> Self

Construct a new group element in a way while enforcing that points are in the prime-order subgroup.

Trait Implementations§

source§

impl<'a, 'b, P: TECurveConfig> Add<&'a Projective<P>> for &'b Projective<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Projective<P>) -> Projective<P>

Performs the + operation. Read more
source§

impl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Affine<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Projective<P>) -> Projective<P>

Performs the + operation. Read more
source§

impl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Self) -> Self

Performs the + operation. Read more
source§

impl<'a, 'b, P: TECurveConfig> Add<&'a mut Projective<P>> for &'b Projective<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a mut Projective<P>) -> Projective<P>

Performs the + operation. Read more
source§

impl<'a, P: TECurveConfig> Add<&'a mut Projective<P>> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a mut Self) -> Self

Performs the + operation. Read more
source§

impl<'b, P: TECurveConfig> Add<Projective<P>> for &'b Projective<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: Projective<P>) -> Projective<P>

Performs the + operation. Read more
source§

impl<P: TECurveConfig> Add<Projective<P>> for Affine<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: Projective<P>) -> Projective<P>

Performs the + operation. Read more
source§

impl<P: TECurveConfig> Add<Projective<P>> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

impl<P: TECurveConfig, T: Borrow<Affine<P>>> Add<T> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the + operator.
source§

fn add(self, other: T) -> Self

Performs the + operation. Read more
source§

impl<'a, P: TECurveConfig> AddAssign<&'a Projective<P>> for Projective<P>

source§

fn add_assign(&mut self, other: &'a Self)

Performs the += operation. Read more
source§

impl<'a, P: TECurveConfig> AddAssign<&'a mut Projective<P>> for Projective<P>

source§

fn add_assign(&mut self, other: &'a mut Self)

Performs the += operation. Read more
source§

impl<P: TECurveConfig> AddAssign<Projective<P>> for Projective<P>

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl<P: TECurveConfig, T: Borrow<Affine<P>>> AddAssign<T> for Projective<P>

source§

fn add_assign(&mut self, other: T)

Performs the += operation. Read more
source§

impl<P: TECurveConfig> CanonicalDeserialize for Projective<P>

source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate ) -> Result<Self, SerializationError>

The general deserialize method that takes in customization flags.
source§

fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where R: Read,

source§

fn deserialize_compressed_unchecked<R>( reader: R ) -> Result<Self, SerializationError>where R: Read,

source§

fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where R: Read,

source§

fn deserialize_uncompressed_unchecked<R>( reader: R ) -> Result<Self, SerializationError>where R: Read,

source§

impl<P: TECurveConfig> CanonicalSerialize for Projective<P>

source§

fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress ) -> Result<(), SerializationError>

The general serialize method that takes in customization flags.
source§

fn serialized_size(&self, compress: Compress) -> usize

source§

fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where W: Write,

source§

fn compressed_size(&self) -> usize

source§

fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where W: Write,

source§

fn uncompressed_size(&self) -> usize

source§

impl<P> Clone for Projective<P>where P: TECurveConfig,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<P: TECurveConfig> CurveGroup for Projective<P>

§

type Config = P

§

type BaseField = <P as CurveConfig>::BaseField

The field over which this curve is defined.
§

type Affine = Affine<P>

The affine representation of this element.
§

type FullGroup = Affine<P>

Type representing an element of the full elliptic curve group, not just the prime order subgroup.
source§

fn normalize_batch(v: &[Self]) -> Vec<Self::Affine>

Normalizes a slice of group elements into affine.
source§

fn into_affine(self) -> Self::Affine

Converts self into the affine representation.
source§

impl<P> Debug for Projective<P>where P: TECurveConfig,

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<P: TECurveConfig> Default for Projective<P>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<P: TECurveConfig> Display for Projective<P>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
source§

impl<P: TECurveConfig> Distribution<Projective<P>> for Standard

source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Projective<P>

Generates a uniformly random instance of the curve.

source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
source§

impl<P: TECurveConfig> From<Affine<P>> for Projective<P>

source§

fn from(p: Affine<P>) -> Projective<P>

Converts to this type from the input type.
source§

impl<P: TECurveConfig> From<Projective<P>> for Affine<P>

source§

fn from(p: Projective<P>) -> Affine<P>

Converts to this type from the input type.
source§

impl<P: TECurveConfig> Group for Projective<P>

§

type ScalarField = <P as CurveConfig>::ScalarField

The scalar field F_r, where r is the order of this group.
source§

fn generator() -> Self

Returns a fixed generator of this group.
source§

fn double_in_place(&mut self) -> &mut Self

Double self in place.
source§

fn mul_bigint(&self, other: impl AsRef<[u64]>) -> Self

Performs scalar multiplication of this element.
source§

fn double(&self) -> Self

Doubles self.
source§

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<P: TECurveConfig> Hash for Projective<P>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<P: TECurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the * operator.
source§

fn mul(self, other: T) -> Self

Performs the * operation. Read more
source§

impl<P: TECurveConfig, T: Borrow<P::ScalarField>> MulAssign<T> for Projective<P>

source§

fn mul_assign(&mut self, other: T)

Performs the *= operation. Read more
source§

impl<P: TECurveConfig> Neg for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl<P: TECurveConfig> PartialEq<Affine<P>> for Projective<P>

source§

fn eq(&self, other: &Affine<P>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<P: TECurveConfig> PartialEq<Projective<P>> for Affine<P>

source§

fn eq(&self, other: &Projective<P>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<P: TECurveConfig> PartialEq<Projective<P>> for Projective<P>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<P: TECurveConfig> ScalarMul for Projective<P>

source§

impl<'a, 'b, P: TECurveConfig> Sub<&'a Projective<P>> for &'b Projective<P>

§

type Output = Projective<P>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Projective<P>) -> Projective<P>

Performs the - operation. Read more
source§

impl<'a, P: TECurveConfig> Sub<&'a Projective<P>> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Self) -> Self

Performs the - operation. Read more
source§

impl<'a, 'b, P: TECurveConfig> Sub<&'a mut Projective<P>> for &'b Projective<P>

§

type Output = Projective<P>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a mut Projective<P>) -> Projective<P>

Performs the - operation. Read more
source§

impl<'a, P: TECurveConfig> Sub<&'a mut Projective<P>> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a mut Self) -> Self

Performs the - operation. Read more
source§

impl<'b, P: TECurveConfig> Sub<Projective<P>> for &'b Projective<P>

§

type Output = Projective<P>

The resulting type after applying the - operator.
source§

fn sub(self, other: Projective<P>) -> Projective<P>

Performs the - operation. Read more
source§

impl<P: TECurveConfig> Sub<Projective<P>> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
source§

impl<P: TECurveConfig, T: Borrow<Affine<P>>> Sub<T> for Projective<P>

§

type Output = Projective<P>

The resulting type after applying the - operator.
source§

fn sub(self, other: T) -> Self

Performs the - operation. Read more
source§

impl<'a, P: TECurveConfig> SubAssign<&'a Projective<P>> for Projective<P>

source§

fn sub_assign(&mut self, other: &'a Self)

Performs the -= operation. Read more
source§

impl<'a, P: TECurveConfig> SubAssign<&'a mut Projective<P>> for Projective<P>

source§

fn sub_assign(&mut self, other: &'a mut Self)

Performs the -= operation. Read more
source§

impl<P: TECurveConfig> SubAssign<Projective<P>> for Projective<P>

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<P: TECurveConfig, T: Borrow<Affine<P>>> SubAssign<T> for Projective<P>

source§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
source§

impl<'a, P: TECurveConfig> Sum<&'a Projective<P>> for Projective<P>

source§

fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<P: TECurveConfig> Sum<Projective<P>> for Projective<P>

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<P: TECurveConfig, T: Borrow<Affine<P>>> Sum<T> for Projective<P>

source§

fn sum<I>(iter: I) -> Selfwhere I: Iterator<Item = T>,

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<M: TECurveConfig, ConstraintF: Field> ToConstraintField<ConstraintF> for Projective<M>where M::BaseField: ToConstraintField<ConstraintF>,

source§

fn to_field_elements(&self) -> Option<Vec<ConstraintF>>

source§

impl<P: TECurveConfig> Valid for Projective<P>

source§

fn check(&self) -> Result<(), SerializationError>

source§

fn batch_check<'a>( batch: impl Iterator<Item = &'a Self> + Send ) -> Result<(), SerializationError>where Self: 'a,

source§

impl<P: TECurveConfig> VariableBaseMSM for Projective<P>

source§

fn msm( bases: &[Self::MulBase], bigints: &[Self::ScalarField] ) -> Result<Self, usize>

Performs multi-scalar multiplication, without checking that bases.len() == scalars.len(). Read more
source§

fn msm_unchecked(bases: &[Self::MulBase], scalars: &[Self::ScalarField]) -> Self

Computes an inner product between the PrimeField elements in scalars and the corresponding group elements in bases. Read more
source§

fn msm_bigint( bases: &[Self::MulBase], bigints: &[<Self::ScalarField as PrimeField>::BigInt] ) -> Self

Optimized implementation of multi-scalar multiplication.
source§

fn msm_chunks<I, J>(bases_stream: &J, scalars_stream: &I) -> Selfwhere I: Iterable + ?Sized, I::Item: Borrow<Self::ScalarField>, J: Iterable, J::Item: Borrow<Self::MulBase>,

Streaming multi-scalar multiplication algorithm with hard-coded chunk size.
source§

impl<P: TECurveConfig> Zero for Projective<P>

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl<P: TECurveConfig> Zeroize for Projective<P>

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
source§

impl<P> Copy for Projective<P>where P: TECurveConfig,

source§

impl<P> Eq for Projective<P>where P: TECurveConfig,

Auto Trait Implementations§

§

impl<P> RefUnwindSafe for Projective<P>where <P as CurveConfig>::BaseField: RefUnwindSafe,

§

impl<P> Send for Projective<P>

§

impl<P> Sync for Projective<P>

§

impl<P> Unpin for Projective<P>where <P as CurveConfig>::BaseField: Unpin,

§

impl<P> UnwindSafe for Projective<P>where <P as CurveConfig>::BaseField: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CanonicalSerializeHashExt for Twhere T: CanonicalSerialize,

source§

fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where H: Digest,

source§

fn hash_uncompressed<H>( &self ) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where H: Digest,

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UniformRand for Twhere Standard: Distribution<T>,

source§

fn rand<R>(rng: &mut R) -> Twhere R: Rng + ?Sized,

§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T, F> DomainCoeff<F> for Twhere F: FftField, T: Copy + Send + Sync + Add<T, Output = T> + Sub<T, Output = T> + AddAssign<T> + SubAssign<T> + Zero + MulAssign<F> + Debug + PartialEq<T>,