Struct snarkvm_curves::templates::twisted_edwards_extended::GroupAffine[][src]

pub struct GroupAffine<P: Parameters> {
    pub x: P::BaseField,
    pub y: P::BaseField,
    // some fields omitted
}

Fields

x: P::BaseFieldy: P::BaseField

Implementations

impl<P: Parameters> GroupAffine<P>[src]

pub fn new(x: P::BaseField, y: P::BaseField) -> Self[src]

#[must_use]
pub fn scale_by_cofactor(&self) -> <Self as AffineCurve>::Projective
[src]

pub fn is_on_curve(&self) -> bool[src]

Checks that the current point is on the elliptic curve.

Trait Implementations

impl<'a, P: Parameters> Add<&'a GroupAffine<P>> for GroupAffine<P>[src]

type Output = Self

The resulting type after applying the + operator.

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

Performs the + operation. Read more

impl<'a, P: Parameters> AddAssign<&'a GroupAffine<P>> for GroupAffine<P>[src]

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

Performs the += operation. Read more

impl<P: Parameters> AffineCurve for GroupAffine<P>[src]

fn from_x_coordinate(x: Self::BaseField, greatest: bool) -> Option<Self>[src]

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.

fn from_y_coordinate(y: Self::BaseField, greatest: bool) -> Option<Self>[src]

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.

fn is_on_curve(&self) -> bool[src]

Checks that the current point is on the elliptic curve.

type BaseField = P::BaseField

type Projective = GroupProjective<P>

type ScalarField = P::ScalarField

fn prime_subgroup_generator() -> Self[src]

Returns a fixed generator of unknown exponent.

fn from_random_bytes(bytes: &[u8]) -> Option<Self>[src]

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

fn add(self, other: &Self) -> Self[src]

Performs the standard addition operation of this element with a given other element.

fn mul<S: Into<<Self::ScalarField as PrimeField>::BigInteger>>(
    &self,
    by: S
) -> GroupProjective<P>
[src]

Performs scalar multiplication of this element with mixed addition.

fn mul_by_cofactor_to_projective(&self) -> Self::Projective[src]

Multiply this element by the cofactor and output the resulting projective element. Read more

fn mul_by_cofactor_inv(&self) -> Self[src]

Multiply this element by the inverse of the cofactor modulo the size of Self::ScalarField. Read more

fn into_projective(&self) -> GroupProjective<P>[src]

Converts this element into its projective representation.

fn is_in_correct_subgroup_assuming_on_curve(&self) -> bool[src]

Checks that the point is in the prime order subgroup given the point on the curve.

fn to_x_coordinate(&self) -> Self::BaseField[src]

Returns the x-coordinate of the point.

fn to_y_coordinate(&self) -> Self::BaseField[src]

Returns the y-coordinate of the point.

#[must_use]
fn mul_by_cofactor(&self) -> Self
[src]

Multiply this element by the cofactor.

impl<P: Parameters> CanonicalDeserialize for GroupAffine<P>[src]

fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>[src]

Reads Self from reader.

fn deserialize_uncompressed<R: Read>(
    reader: &mut R
) -> Result<Self, SerializationError>
[src]

Reads Self from reader without compression.

impl<P: Parameters> CanonicalSerialize for GroupAffine<P>[src]

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>[src]

Serializes self into writer.

fn serialized_size(&self) -> usize[src]

fn serialize_uncompressed<W: Write>(
    &self,
    writer: &mut W
) -> Result<(), SerializationError>
[src]

Serializes self into writer without compression.

fn uncompressed_size(&self) -> usize[src]

impl<P: Parameters> Clone for GroupAffine<P> where
    P: Parameters
[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<P: Parameters> ConstantSerializedSize for GroupAffine<P>[src]

impl<P: Parameters> Debug for GroupAffine<P> where
    P: Parameters
[src]

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

Formats the value using the given formatter. Read more

impl<P: Parameters> Default for GroupAffine<P>[src]

fn default() -> Self[src]

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

impl<'de, P: Parameters> Deserialize<'de> for GroupAffine<P> where
    P::BaseField: Deserialize<'de>,
    P::BaseField: Deserialize<'de>, 
[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<P: Parameters> Display for GroupAffine<P>[src]

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

Formats the value using the given formatter. Read more

impl<P: Parameters> From<GroupAffine<P>> for GroupProjective<P>[src]

fn from(p: GroupAffine<P>) -> GroupProjective<P>[src]

Performs the conversion.

impl<P: Parameters> From<GroupProjective<P>> for GroupAffine<P>[src]

fn from(p: GroupProjective<P>) -> GroupAffine<P>[src]

Performs the conversion.

impl<P: Parameters> FromBytes for GroupAffine<P>[src]

fn read<R: Read>(reader: R) -> IoResult<Self>[src]

Reads Self from reader.

impl<P: Parameters> Group for GroupAffine<P>[src]

type ScalarField = P::ScalarField

#[must_use]
fn double(&self) -> Self
[src]

Returns self + self.

fn double_in_place(&mut self) -> &mut Self[src]

Sets self := self + self.

#[must_use]
fn mul(&self, other: &Self::ScalarField) -> Self
[src]

fn mul_assign(&mut self, other: &Self::ScalarField)[src]

impl<P: Parameters> Hash for GroupAffine<P> where
    P: Parameters
[src]

fn hash<__HP>(&self, __state: &mut __HP) where
    __HP: Hasher
[src]

Feeds this value into the given Hasher. Read more

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

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

impl<'a, P: Parameters> Mul<&'a <P as ModelParameters>::ScalarField> for GroupAffine<P>[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, other: &'a P::ScalarField) -> Self[src]

Performs the * operation. Read more

impl<'a, P: Parameters> MulAssign<&'a <P as ModelParameters>::ScalarField> for GroupAffine<P>[src]

fn mul_assign(&mut self, other: &'a P::ScalarField)[src]

Performs the *= operation. Read more

impl<P: Parameters> Neg for GroupAffine<P>[src]

type Output = Self

The resulting type after applying the - operator.

fn neg(self) -> Self[src]

Performs the unary - operation. Read more

impl<P: Parameters> PartialEq<GroupAffine<P>> for GroupAffine<P> where
    P: Parameters
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<P: Parameters> Serialize for GroupAffine<P> where
    P::BaseField: Serialize,
    P::BaseField: Serialize
[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl<'a, P: Parameters> Sub<&'a GroupAffine<P>> for GroupAffine<P>[src]

type Output = Self

The resulting type after applying the - operator.

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

Performs the - operation. Read more

impl<'a, P: Parameters> SubAssign<&'a GroupAffine<P>> for GroupAffine<P>[src]

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

Performs the -= operation. Read more

impl<P: Parameters> ToBytes for GroupAffine<P>[src]

fn write<W: Write>(&self, writer: W) -> IoResult<()>[src]

Serializes self into writer.

impl<M: TEModelParameters, F: Field> ToConstraintField<F> for TEAffine<M> where
    M::BaseField: ToConstraintField<F>, 
[src]

impl<P: Parameters> Zero for GroupAffine<P>[src]

fn zero() -> Self[src]

fn is_zero(&self) -> bool[src]

impl<P: Parameters> Copy for GroupAffine<P> where
    P: Parameters
[src]

impl<P: Parameters> Eq for GroupAffine<P> where
    P: Parameters
[src]

Auto Trait Implementations

impl<P> RefUnwindSafe for GroupAffine<P> where
    P: RefUnwindSafe,
    <P as ModelParameters>::BaseField: RefUnwindSafe

impl<P> Send for GroupAffine<P>

impl<P> Sync for GroupAffine<P>

impl<P> Unpin for GroupAffine<P> where
    P: Unpin,
    <P as ModelParameters>::BaseField: Unpin

impl<P> UnwindSafe for GroupAffine<P> where
    P: UnwindSafe,
    <P as ModelParameters>::BaseField: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> UniformRand for T where
    Standard: Distribution<T>, 
[src]

pub fn rand<R>(rng: &mut R) -> T where
    R: Rng + ?Sized
[src]

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

pub fn vzip(self) -> V

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]