Struct snarkvm_curves::templates::twisted_edwards_extended::affine::Affine
source · [−]pub struct Affine<P: Parameters> {
pub x: P::BaseField,
pub y: P::BaseField,
}
Fields
x: P::BaseField
y: P::BaseField
Implementations
sourceimpl<P: Parameters> Affine<P>
impl<P: Parameters> Affine<P>
pub fn new(x: P::BaseField, y: P::BaseField) -> Self
pub fn scale_by_cofactor(&self) -> <Self as AffineCurve>::Projective
Trait Implementations
sourceimpl<P: Parameters> Add<&'_ &'_ Affine<P>> for Affine<P>
impl<P: Parameters> Add<&'_ &'_ Affine<P>> for Affine<P>
sourceimpl<'a, P: Parameters> Add<&'a Affine<P>> for Affine<P>
impl<'a, P: Parameters> Add<&'a Affine<P>> for Affine<P>
sourceimpl<'a, P: Parameters> Add<&'a mut Affine<P>> for Affine<P>
impl<'a, P: Parameters> Add<&'a mut Affine<P>> for Affine<P>
sourceimpl<P: Parameters> Add<Affine<P>> for Affine<P>
impl<P: Parameters> Add<Affine<P>> for Affine<P>
sourceimpl<P: Parameters> AddAssign<&'_ &'_ Affine<P>> for Affine<P>
impl<P: Parameters> AddAssign<&'_ &'_ Affine<P>> for Affine<P>
sourcefn add_assign(&mut self, other: &&Self)
fn add_assign(&mut self, other: &&Self)
Performs the +=
operation. Read more
sourceimpl<'a, P: Parameters> AddAssign<&'a Affine<P>> for Affine<P>
impl<'a, P: Parameters> AddAssign<&'a Affine<P>> for Affine<P>
sourcefn add_assign(&mut self, other: &'a Self)
fn add_assign(&mut self, other: &'a Self)
Performs the +=
operation. Read more
sourceimpl<'a, P: Parameters> AddAssign<&'a mut Affine<P>> for Affine<P>
impl<'a, P: Parameters> AddAssign<&'a mut Affine<P>> for Affine<P>
sourcefn add_assign(&mut self, other: &'a mut Self)
fn add_assign(&mut self, other: &'a mut Self)
Performs the +=
operation. Read more
sourceimpl<P: Parameters> AddAssign<Affine<P>> for Affine<P>
impl<P: Parameters> AddAssign<Affine<P>> for Affine<P>
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the +=
operation. Read more
sourceimpl<P: Parameters> AffineCurve for Affine<P>
impl<P: Parameters> AffineCurve for Affine<P>
sourcefn from_x_coordinate(x: Self::BaseField, greatest: bool) -> Option<Self>
fn from_x_coordinate(x: Self::BaseField, greatest: bool) -> Option<Self>
Attempts to construct an affine point given an x-coordinate. The point is not guaranteed to be in the prime order subgroup.
If and only if greatest
is set will the lexicographically
largest y-coordinate be selected.
sourcefn from_y_coordinate(y: Self::BaseField, greatest: bool) -> Option<Self>
fn from_y_coordinate(y: Self::BaseField, greatest: bool) -> Option<Self>
Attempts to construct an affine point given a y-coordinate. The point is not guaranteed to be in the prime order subgroup.
If and only if greatest
is set will the lexicographically
largest y-coordinate be selected.
sourcefn is_on_curve(&self) -> bool
fn is_on_curve(&self) -> bool
Checks that the current point is on the elliptic curve.
type BaseField = P::BaseField
type Projective = Projective<P>
sourcefn prime_subgroup_generator() -> Self
fn prime_subgroup_generator() -> Self
Returns a fixed generator of unknown exponent.
sourcefn from_random_bytes(bytes: &[u8]) -> Option<Self>
fn from_random_bytes(bytes: &[u8]) -> Option<Self>
Returns a group element if the set of bytes forms a valid group element, otherwise returns None. This function is primarily intended for sampling random group elements from a hash-function or RNG output. Read more
sourcefn mul_bits(&self, bits: impl Iterator<Item = bool>) -> Projective<P>
fn mul_bits(&self, bits: impl Iterator<Item = bool>) -> Projective<P>
Multiply this element by a big-endian boolean representation of an integer. Read more
sourcefn mul_by_cofactor_to_projective(&self) -> Self::Projective
fn mul_by_cofactor_to_projective(&self) -> Self::Projective
Multiply this element by the cofactor and output the resulting projective element. Read more
sourcefn mul_by_cofactor_inv(&self) -> Self
fn mul_by_cofactor_inv(&self) -> Self
Multiply this element by the inverse of the cofactor modulo the size of
Self::ScalarField
. Read more
sourcefn into_projective(&self) -> Projective<P>
fn into_projective(&self) -> Projective<P>
Converts this element into its projective representation.
sourcefn is_in_correct_subgroup_assuming_on_curve(&self) -> bool
fn is_in_correct_subgroup_assuming_on_curve(&self) -> bool
Checks that the point is in the prime order subgroup given the point on the curve.
sourcefn to_x_coordinate(&self) -> Self::BaseField
fn to_x_coordinate(&self) -> Self::BaseField
Returns the x-coordinate of the point.
sourcefn to_y_coordinate(&self) -> Self::BaseField
fn to_y_coordinate(&self) -> Self::BaseField
Returns the y-coordinate of the point.
sourcefn mul_by_cofactor(&self) -> Self
fn mul_by_cofactor(&self) -> Self
Multiply this element by the cofactor.
sourceimpl<P: Parameters> CanonicalDeserialize for Affine<P>
impl<P: Parameters> CanonicalDeserialize for Affine<P>
sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
Reads Self
from reader
.
sourcefn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
fn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
Reads Self
from reader
without compression.
sourceimpl<P: Parameters> CanonicalSerialize for Affine<P>
impl<P: Parameters> CanonicalSerialize for Affine<P>
sourcefn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
Serializes self
into writer
.
fn serialized_size(&self) -> usize
sourcefn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
fn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
Serializes self
into writer
without compression.
fn uncompressed_size(&self) -> usize
sourceimpl<P: Parameters> Clone for Affine<P> where
P: Parameters,
impl<P: Parameters> Clone for Affine<P> where
P: Parameters,
sourceimpl<P: Parameters> ConstantSerializedSize for Affine<P>
impl<P: Parameters> ConstantSerializedSize for Affine<P>
const SERIALIZED_SIZE: usize
const UNCOMPRESSED_SIZE: usize
sourceimpl<P: Parameters> Debug for Affine<P> where
P: Parameters,
impl<P: Parameters> Debug for Affine<P> where
P: Parameters,
sourceimpl<P: Parameters> Default for Affine<P>
impl<P: Parameters> Default for Affine<P>
sourceimpl<'de, P: Parameters> Deserialize<'de> for Affine<P> where
P::BaseField: Deserialize<'de>,
P::BaseField: Deserialize<'de>,
impl<'de, P: Parameters> Deserialize<'de> for Affine<P> where
P::BaseField: Deserialize<'de>,
P::BaseField: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<P: Parameters> Display for Affine<P>
impl<P: Parameters> Display for Affine<P>
sourceimpl<P: Parameters> Distribution<Affine<P>> for Standard
impl<P: Parameters> Distribution<Affine<P>> for Standard
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Affine<P>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Affine<P>
Generate a random value of T
, using rng
as the source of randomness.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
sourceimpl<P: Parameters> From<Affine<P>> for Projective<P>
impl<P: Parameters> From<Affine<P>> for Projective<P>
sourcefn from(p: Affine<P>) -> Projective<P>
fn from(p: Affine<P>) -> Projective<P>
Performs the conversion.
sourceimpl<P: Parameters> From<Projective<P>> for Affine<P>
impl<P: Parameters> From<Projective<P>> for Affine<P>
sourcefn from(p: Projective<P>) -> Affine<P>
fn from(p: Projective<P>) -> Affine<P>
Performs the conversion.
sourceimpl<P: Parameters> FromBytes for Affine<P>
impl<P: Parameters> FromBytes for Affine<P>
sourceimpl<P: Parameters> Group for Affine<P>
impl<P: Parameters> Group for Affine<P>
type ScalarField = P::ScalarField
sourcefn double_in_place(&mut self)
fn double_in_place(&mut self)
Sets self := self + self
.
sourceimpl<P: Parameters> Hash for Affine<P> where
P: Parameters,
impl<P: Parameters> Hash for Affine<P> where
P: Parameters,
sourceimpl<P: Parameters> Mul<<P as ModelParameters>::ScalarField> for Affine<P>
impl<P: Parameters> Mul<<P as ModelParameters>::ScalarField> for Affine<P>
type Output = Self
type Output = Self
The resulting type after applying the *
operator.
sourcefn mul(self, other: P::ScalarField) -> Self
fn mul(self, other: P::ScalarField) -> Self
Performs the *
operation. Read more
sourceimpl<P: Parameters> MulAssign<<P as ModelParameters>::ScalarField> for Affine<P>
impl<P: Parameters> MulAssign<<P as ModelParameters>::ScalarField> for Affine<P>
sourcefn mul_assign(&mut self, other: P::ScalarField)
fn mul_assign(&mut self, other: P::ScalarField)
Performs the *=
operation. Read more
sourceimpl<P: Parameters> Neg for Affine<P>
impl<P: Parameters> Neg for Affine<P>
sourceimpl<P: Parameters> PartialEq<Affine<P>> for Affine<P> where
P: Parameters,
impl<P: Parameters> PartialEq<Affine<P>> for Affine<P> where
P: Parameters,
sourceimpl<P: Parameters> Serialize for Affine<P> where
P::BaseField: Serialize,
P::BaseField: Serialize,
impl<P: Parameters> Serialize for Affine<P> where
P::BaseField: Serialize,
P::BaseField: Serialize,
sourceimpl<P: Parameters> Sub<&'_ &'_ Affine<P>> for Affine<P>
impl<P: Parameters> Sub<&'_ &'_ Affine<P>> for Affine<P>
sourceimpl<'a, P: Parameters> Sub<&'a Affine<P>> for Affine<P>
impl<'a, P: Parameters> Sub<&'a Affine<P>> for Affine<P>
sourceimpl<'a, P: Parameters> Sub<&'a mut Affine<P>> for Affine<P>
impl<'a, P: Parameters> Sub<&'a mut Affine<P>> for Affine<P>
sourceimpl<P: Parameters> Sub<Affine<P>> for Affine<P>
impl<P: Parameters> Sub<Affine<P>> for Affine<P>
sourceimpl<P: Parameters> SubAssign<&'_ &'_ Affine<P>> for Affine<P>
impl<P: Parameters> SubAssign<&'_ &'_ Affine<P>> for Affine<P>
sourcefn sub_assign(&mut self, other: &&Self)
fn sub_assign(&mut self, other: &&Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Parameters> SubAssign<&'a Affine<P>> for Affine<P>
impl<'a, P: Parameters> SubAssign<&'a Affine<P>> for Affine<P>
sourcefn sub_assign(&mut self, other: &'a Self)
fn sub_assign(&mut self, other: &'a Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Parameters> SubAssign<&'a mut Affine<P>> for Affine<P>
impl<'a, P: Parameters> SubAssign<&'a mut Affine<P>> for Affine<P>
sourcefn sub_assign(&mut self, other: &'a mut Self)
fn sub_assign(&mut self, other: &'a mut Self)
Performs the -=
operation. Read more
sourceimpl<P: Parameters> SubAssign<Affine<P>> for Affine<P>
impl<P: Parameters> SubAssign<Affine<P>> for Affine<P>
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Parameters> Sum<&'a Affine<P>> for Affine<P>
impl<'a, P: Parameters> Sum<&'a Affine<P>> for Affine<P>
sourceimpl<P: Parameters> Sum<Affine<P>> for Affine<P>
impl<P: Parameters> Sum<Affine<P>> for Affine<P>
sourceimpl<P: Parameters> ToBytes for Affine<P>
impl<P: Parameters> ToBytes for Affine<P>
sourceimpl<M: TwistedEdwardsParameters, F: Field> ToConstraintField<F> for TEAffine<M> where
M::BaseField: ToConstraintField<F>,
impl<M: TwistedEdwardsParameters, F: Field> ToConstraintField<F> for TEAffine<M> where
M::BaseField: ToConstraintField<F>,
fn to_field_elements(&self) -> Result<Vec<F>, ConstraintFieldError>
sourceimpl<P: Parameters> ToMinimalBits for Affine<P>
impl<P: Parameters> ToMinimalBits for Affine<P>
sourcefn to_minimal_bits(&self) -> Vec<bool>
fn to_minimal_bits(&self) -> Vec<bool>
Returns self
as a minimal boolean array.
impl<P: Parameters> Copy for Affine<P> where
P: Parameters,
impl<P: Parameters> Eq for Affine<P> where
P: Parameters,
Auto Trait Implementations
impl<P> RefUnwindSafe for Affine<P> where
<P as ModelParameters>::BaseField: RefUnwindSafe,
impl<P> Send for Affine<P>
impl<P> Sync for Affine<P>
impl<P> Unpin for Affine<P> where
<P as ModelParameters>::BaseField: Unpin,
impl<P> UnwindSafe for Affine<P> where
<P as ModelParameters>::BaseField: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more