Struct ark_ec::models::twisted_edwards::Projective
source · 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
sourceimpl<P: TECurveConfig> Projective<P>
impl<P: TECurveConfig> Projective<P>
Trait Implementations
sourceimpl<'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>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+
operator.sourcefn add(self, other: &'a Projective<P>) -> Projective<P>
fn add(self, other: &'a Projective<P>) -> Projective<P>
Performs the
+
operation. Read moresourceimpl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Affine<P>
impl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Affine<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+
operator.sourcefn add(self, other: &'a Projective<P>) -> Projective<P>
fn add(self, other: &'a Projective<P>) -> Projective<P>
Performs the
+
operation. Read moresourceimpl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Add<&'a Projective<P>> for Projective<P>
sourceimpl<'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>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+
operator.sourcefn add(self, other: &'a mut Projective<P>) -> Projective<P>
fn add(self, other: &'a mut Projective<P>) -> Projective<P>
Performs the
+
operation. Read moresourceimpl<'a, P: TECurveConfig> Add<&'a mut Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Add<&'a mut Projective<P>> for Projective<P>
sourceimpl<'b, P: TECurveConfig> Add<Projective<P>> for &'b Projective<P>
impl<'b, P: TECurveConfig> Add<Projective<P>> for &'b Projective<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+
operator.sourcefn add(self, other: Projective<P>) -> Projective<P>
fn add(self, other: Projective<P>) -> Projective<P>
Performs the
+
operation. Read moresourceimpl<P: TECurveConfig> Add<Projective<P>> for Affine<P>
impl<P: TECurveConfig> Add<Projective<P>> for Affine<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+
operator.sourcefn add(self, other: Projective<P>) -> Projective<P>
fn add(self, other: Projective<P>) -> Projective<P>
Performs the
+
operation. Read moresourceimpl<P: TECurveConfig> Add<Projective<P>> for Projective<P>
impl<P: TECurveConfig> Add<Projective<P>> for Projective<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+
operator.sourceimpl<P: TECurveConfig, T: Borrow<Affine<P>>> Add<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> Add<T> for Projective<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
+
operator.sourceimpl<'a, P: TECurveConfig> AddAssign<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> AddAssign<&'a Projective<P>> for Projective<P>
sourcefn add_assign(&mut self, other: &'a Self)
fn add_assign(&mut self, other: &'a Self)
Performs the
+=
operation. Read moresourceimpl<'a, P: TECurveConfig> AddAssign<&'a mut Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> AddAssign<&'a mut Projective<P>> for Projective<P>
sourcefn add_assign(&mut self, other: &'a mut Self)
fn add_assign(&mut self, other: &'a mut Self)
Performs the
+=
operation. Read moresourceimpl<P: TECurveConfig> AddAssign<Projective<P>> for Projective<P>
impl<P: TECurveConfig> AddAssign<Projective<P>> for Projective<P>
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresourceimpl<P: TECurveConfig, T: Borrow<Affine<P>>> AddAssign<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> AddAssign<T> for Projective<P>
sourcefn add_assign(&mut self, other: T)
fn add_assign(&mut self, other: T)
Performs the
+=
operation. Read moresourceimpl<P: TECurveConfig> CanonicalDeserialize for Projective<P>
impl<P: TECurveConfig> CanonicalDeserialize for Projective<P>
sourcefn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate
) -> Result<Self, SerializationError>
The general deserialize method that takes in customization flags.
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R
) -> Result<Self, SerializationError>where
R: Read,
sourceimpl<P: TECurveConfig> CanonicalSerialize for Projective<P>
impl<P: TECurveConfig> CanonicalSerialize for Projective<P>
sourcefn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress
) -> Result<(), SerializationError>
The general serialize method that takes in customization flags.
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
sourceimpl<P: TECurveConfig> Clone for Projective<P>where
P: TECurveConfig,
impl<P: TECurveConfig> Clone for Projective<P>where
P: TECurveConfig,
sourceimpl<P: TECurveConfig> CurveGroup for Projective<P>
impl<P: TECurveConfig> CurveGroup for Projective<P>
type Config = P
type BaseField = <P as CurveConfig>::BaseField
type BaseField = <P as CurveConfig>::BaseField
The field over which this curve is defined.
type FullGroup = Affine<P>
type FullGroup = Affine<P>
Type representing an element of the full elliptic curve group, not just the
prime order subgroup. Read more
sourcefn normalize_batch(v: &[Self]) -> Vec<Self::Affine>
fn normalize_batch(v: &[Self]) -> Vec<Self::Affine>
Normalizes a slice of group elements into affine.
sourcefn into_affine(self) -> Self::Affine
fn into_affine(self) -> Self::Affine
Converts
self
into the affine representation.sourceimpl<P: TECurveConfig> Debug for Projective<P>where
P: TECurveConfig,
impl<P: TECurveConfig> Debug for Projective<P>where
P: TECurveConfig,
sourceimpl<P: TECurveConfig> Default for Projective<P>
impl<P: TECurveConfig> Default for Projective<P>
sourceimpl<P: TECurveConfig> Display for Projective<P>
impl<P: TECurveConfig> Display for Projective<P>
sourceimpl<P: TECurveConfig> Distribution<Projective<P>> for Standard
impl<P: TECurveConfig> Distribution<Projective<P>> for Standard
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Projective<P>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Projective<P>
Generates a uniformly random instance of the curve.
sourceimpl<P: TECurveConfig> From<Affine<P>> for Projective<P>
impl<P: TECurveConfig> From<Affine<P>> for Projective<P>
sourcefn from(p: Affine<P>) -> Projective<P>
fn from(p: Affine<P>) -> Projective<P>
Converts to this type from the input type.
sourceimpl<P: TECurveConfig> From<Projective<P>> for Affine<P>
impl<P: TECurveConfig> From<Projective<P>> for Affine<P>
sourcefn from(p: Projective<P>) -> Affine<P>
fn from(p: Projective<P>) -> Affine<P>
Converts to this type from the input type.
sourceimpl<P: TECurveConfig> Group for Projective<P>
impl<P: TECurveConfig> Group for Projective<P>
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.sourcefn double_in_place(&mut self) -> &mut Self
fn double_in_place(&mut self) -> &mut Self
Double
self
in place.sourcefn mul_bigint(&self, other: impl AsRef<[u64]>) -> Self
fn mul_bigint(&self, other: impl AsRef<[u64]>) -> Self
Performs scalar multiplication of this element.
sourcefn mul_bits_be(&self, other: impl Iterator<Item = bool>) -> Self
fn mul_bits_be(&self, other: impl Iterator<Item = bool>) -> Self
sourceimpl<P: TECurveConfig> Hash for Projective<P>
impl<P: TECurveConfig> Hash for Projective<P>
sourceimpl<P: TECurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<P::ScalarField>> Mul<T> for Projective<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
*
operator.sourceimpl<P: TECurveConfig, T: Borrow<P::ScalarField>> MulAssign<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<P::ScalarField>> MulAssign<T> for Projective<P>
sourcefn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
Performs the
*=
operation. Read moresourceimpl<P: TECurveConfig> Neg for Projective<P>
impl<P: TECurveConfig> Neg for Projective<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
-
operator.sourceimpl<P: TECurveConfig> PartialEq<Affine<P>> for Projective<P>
impl<P: TECurveConfig> PartialEq<Affine<P>> for Projective<P>
sourceimpl<P: TECurveConfig> PartialEq<Projective<P>> for Affine<P>
impl<P: TECurveConfig> PartialEq<Projective<P>> for Affine<P>
sourcefn eq(&self, other: &Projective<P>) -> bool
fn eq(&self, other: &Projective<P>) -> bool
sourceimpl<P: TECurveConfig> PartialEq<Projective<P>> for Projective<P>
impl<P: TECurveConfig> PartialEq<Projective<P>> for Projective<P>
sourceimpl<P: TECurveConfig> ScalarMul for Projective<P>
impl<P: TECurveConfig> ScalarMul for Projective<P>
sourceimpl<'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>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
-
operator.sourcefn sub(self, other: &'a Projective<P>) -> Projective<P>
fn sub(self, other: &'a Projective<P>) -> Projective<P>
Performs the
-
operation. Read moresourceimpl<'a, P: TECurveConfig> Sub<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Sub<&'a Projective<P>> for Projective<P>
sourceimpl<'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>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
-
operator.sourcefn sub(self, other: &'a mut Projective<P>) -> Projective<P>
fn sub(self, other: &'a mut Projective<P>) -> Projective<P>
Performs the
-
operation. Read moresourceimpl<'a, P: TECurveConfig> Sub<&'a mut Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Sub<&'a mut Projective<P>> for Projective<P>
sourceimpl<'b, P: TECurveConfig> Sub<Projective<P>> for &'b Projective<P>
impl<'b, P: TECurveConfig> Sub<Projective<P>> for &'b Projective<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
-
operator.sourcefn sub(self, other: Projective<P>) -> Projective<P>
fn sub(self, other: Projective<P>) -> Projective<P>
Performs the
-
operation. Read moresourceimpl<P: TECurveConfig> Sub<Projective<P>> for Projective<P>
impl<P: TECurveConfig> Sub<Projective<P>> for Projective<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
-
operator.sourceimpl<P: TECurveConfig, T: Borrow<Affine<P>>> Sub<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> Sub<T> for Projective<P>
type Output = Projective<P>
type Output = Projective<P>
The resulting type after applying the
-
operator.sourceimpl<'a, P: TECurveConfig> SubAssign<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> SubAssign<&'a Projective<P>> for Projective<P>
sourcefn sub_assign(&mut self, other: &'a Self)
fn sub_assign(&mut self, other: &'a Self)
Performs the
-=
operation. Read moresourceimpl<'a, P: TECurveConfig> SubAssign<&'a mut Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> SubAssign<&'a mut Projective<P>> for Projective<P>
sourcefn sub_assign(&mut self, other: &'a mut Self)
fn sub_assign(&mut self, other: &'a mut Self)
Performs the
-=
operation. Read moresourceimpl<P: TECurveConfig> SubAssign<Projective<P>> for Projective<P>
impl<P: TECurveConfig> SubAssign<Projective<P>> for Projective<P>
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moresourceimpl<P: TECurveConfig, T: Borrow<Affine<P>>> SubAssign<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> SubAssign<T> for Projective<P>
sourcefn sub_assign(&mut self, other: T)
fn sub_assign(&mut self, other: T)
Performs the
-=
operation. Read moresourceimpl<'a, P: TECurveConfig> Sum<&'a Projective<P>> for Projective<P>
impl<'a, P: TECurveConfig> Sum<&'a Projective<P>> for Projective<P>
sourceimpl<P: TECurveConfig> Sum<Projective<P>> for Projective<P>
impl<P: TECurveConfig> Sum<Projective<P>> for Projective<P>
sourceimpl<P: TECurveConfig, T: Borrow<Affine<P>>> Sum<T> for Projective<P>
impl<P: TECurveConfig, T: Borrow<Affine<P>>> Sum<T> for Projective<P>
sourceimpl<M: TECurveConfig, ConstraintF: Field> ToConstraintField<ConstraintF> for Projective<M>where
M::BaseField: ToConstraintField<ConstraintF>,
impl<M: TECurveConfig, ConstraintF: Field> ToConstraintField<ConstraintF> for Projective<M>where
M::BaseField: ToConstraintField<ConstraintF>,
fn to_field_elements(&self) -> Option<Vec<ConstraintF>>
sourceimpl<P: TECurveConfig> Valid for Projective<P>
impl<P: TECurveConfig> Valid for Projective<P>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send
) -> Result<(), SerializationError>where
Self: 'a,
sourceimpl<P: TECurveConfig> VariableBaseMSM for Projective<P>
impl<P: TECurveConfig> VariableBaseMSM for Projective<P>
sourcefn msm(bases: &[Self::MulBase], scalars: &[Self::ScalarField]) -> Self
fn msm(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 moresourcefn msm_unchecked(
bases: &[Self::MulBase],
scalars: &[Self::ScalarField]
) -> Result<Self, usize>
fn msm_unchecked(
bases: &[Self::MulBase],
scalars: &[Self::ScalarField]
) -> Result<Self, usize>
Performs multi-scalar multiplication, without checking that
bases.len() == scalars.len()
. Read moresourcefn msm_bigint(
bases: &[Self::MulBase],
bigints: &[<Self::ScalarField as PrimeField>::BigInt]
) -> Self
fn msm_bigint(
bases: &[Self::MulBase],
bigints: &[<Self::ScalarField as PrimeField>::BigInt]
) -> Self
Optimized implementation of multi-scalar multiplication.
sourceimpl<P: TECurveConfig> Zero for Projective<P>
impl<P: TECurveConfig> Zero for Projective<P>
sourceimpl<P: TECurveConfig> Zeroize for Projective<P>
impl<P: TECurveConfig> Zeroize for Projective<P>
impl<P: TECurveConfig> Copy for Projective<P>where
P: TECurveConfig,
impl<P: TECurveConfig> 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more