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::BaseField
y: P::BaseField
Implementations
impl<P: Parameters> GroupAffine<P>
[src]
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]
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]
impl<'a, P: Parameters> Add<&'a GroupAffine<P>> for GroupAffine<P>
[src]impl<'a, P: Parameters> AddAssign<&'a GroupAffine<P>> for GroupAffine<P>
[src]
impl<'a, P: Parameters> AddAssign<&'a GroupAffine<P>> for GroupAffine<P>
[src]fn add_assign(&mut self, other: &'a Self)
[src]
fn add_assign(&mut self, other: &'a Self)
[src]Performs the +=
operation. Read more
impl<P: Parameters> AffineCurve for GroupAffine<P>
[src]
impl<P: Parameters> AffineCurve for GroupAffine<P>
[src]fn from_x_coordinate(x: Self::BaseField, greatest: bool) -> Option<Self>
[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]
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]
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]
fn prime_subgroup_generator() -> Self
[src]Returns a fixed generator of unknown exponent.
fn from_random_bytes(bytes: &[u8]) -> Option<Self>
[src]
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]
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]
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]
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]
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]
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]
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]
fn to_x_coordinate(&self) -> Self::BaseField
[src]Returns the x-coordinate of the point.
fn to_y_coordinate(&self) -> Self::BaseField
[src]
fn to_y_coordinate(&self) -> Self::BaseField
[src]Returns the y-coordinate of the point.
#[must_use]fn mul_by_cofactor(&self) -> Self
[src]
#[must_use]fn mul_by_cofactor(&self) -> Self
[src]Multiply this element by the cofactor.
impl<P: Parameters> CanonicalDeserialize for GroupAffine<P>
[src]
impl<P: Parameters> CanonicalDeserialize for GroupAffine<P>
[src]fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
[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]
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]
impl<P: Parameters> CanonicalSerialize for GroupAffine<P>
[src]fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
[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]
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]
impl<P: Parameters> Clone for GroupAffine<P> where
P: Parameters,
[src]impl<P: Parameters> ConstantSerializedSize for GroupAffine<P>
[src]
impl<P: Parameters> ConstantSerializedSize for GroupAffine<P>
[src]const SERIALIZED_SIZE: usize
[src]
const UNCOMPRESSED_SIZE: usize
[src]
impl<P: Parameters> Debug for GroupAffine<P> where
P: Parameters,
[src]
impl<P: Parameters> Debug for GroupAffine<P> where
P: Parameters,
[src]impl<P: Parameters> Default for GroupAffine<P>
[src]
impl<P: Parameters> Default for GroupAffine<P>
[src]impl<'de, P: Parameters> Deserialize<'de> for GroupAffine<P> where
P::BaseField: Deserialize<'de>,
P::BaseField: Deserialize<'de>,
[src]
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]
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]
impl<P: Parameters> Display for GroupAffine<P>
[src]impl<P: Parameters> From<GroupAffine<P>> for GroupProjective<P>
[src]
impl<P: Parameters> From<GroupAffine<P>> for GroupProjective<P>
[src]fn from(p: GroupAffine<P>) -> GroupProjective<P>
[src]
fn from(p: GroupAffine<P>) -> GroupProjective<P>
[src]Performs the conversion.
impl<P: Parameters> From<GroupProjective<P>> for GroupAffine<P>
[src]
impl<P: Parameters> From<GroupProjective<P>> for GroupAffine<P>
[src]fn from(p: GroupProjective<P>) -> GroupAffine<P>
[src]
fn from(p: GroupProjective<P>) -> GroupAffine<P>
[src]Performs the conversion.
impl<P: Parameters> FromBytes for GroupAffine<P>
[src]
impl<P: Parameters> FromBytes for GroupAffine<P>
[src]impl<P: Parameters> Group for GroupAffine<P>
[src]
impl<P: Parameters> Group for GroupAffine<P>
[src]type ScalarField = P::ScalarField
fn double_in_place(&mut self) -> &mut Self
[src]
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]
impl<P: Parameters> Hash for GroupAffine<P> where
P: Parameters,
[src]impl<'a, P: Parameters> Mul<&'a <P as ModelParameters>::ScalarField> for GroupAffine<P>
[src]
impl<'a, P: Parameters> Mul<&'a <P as ModelParameters>::ScalarField> for GroupAffine<P>
[src]type Output = Self
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: &'a P::ScalarField) -> Self
[src]
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]
impl<'a, P: Parameters> MulAssign<&'a <P as ModelParameters>::ScalarField> for GroupAffine<P>
[src]fn mul_assign(&mut self, other: &'a P::ScalarField)
[src]
fn mul_assign(&mut self, other: &'a P::ScalarField)
[src]Performs the *=
operation. Read more
impl<P: Parameters> Neg for GroupAffine<P>
[src]
impl<P: Parameters> Neg for GroupAffine<P>
[src]impl<P: Parameters> PartialEq<GroupAffine<P>> for GroupAffine<P> where
P: Parameters,
[src]
impl<P: Parameters> PartialEq<GroupAffine<P>> for GroupAffine<P> where
P: Parameters,
[src]impl<P: Parameters> Serialize for GroupAffine<P> where
P::BaseField: Serialize,
P::BaseField: Serialize,
[src]
impl<P: Parameters> Serialize for GroupAffine<P> where
P::BaseField: Serialize,
P::BaseField: Serialize,
[src]impl<'a, P: Parameters> Sub<&'a GroupAffine<P>> for GroupAffine<P>
[src]
impl<'a, P: Parameters> Sub<&'a GroupAffine<P>> for GroupAffine<P>
[src]impl<'a, P: Parameters> SubAssign<&'a GroupAffine<P>> for GroupAffine<P>
[src]
impl<'a, P: Parameters> SubAssign<&'a GroupAffine<P>> for GroupAffine<P>
[src]fn sub_assign(&mut self, other: &'a Self)
[src]
fn sub_assign(&mut self, other: &'a Self)
[src]Performs the -=
operation. Read more
impl<P: Parameters> ToBytes for GroupAffine<P>
[src]
impl<P: Parameters> ToBytes for GroupAffine<P>
[src]impl<M: TEModelParameters, F: Field> ToConstraintField<F> for TEAffine<M> where
M::BaseField: ToConstraintField<F>,
[src]
impl<M: TEModelParameters, F: Field> ToConstraintField<F> for TEAffine<M> where
M::BaseField: ToConstraintField<F>,
[src]fn to_field_elements(&self) -> Result<Vec<F>, ConstraintFieldError>
[src]
impl<P: Parameters> Zero for GroupAffine<P>
[src]
impl<P: Parameters> Zero for GroupAffine<P>
[src]impl<P: Parameters> Copy for GroupAffine<P> where
P: Parameters,
[src]
P: Parameters,
impl<P: Parameters> Eq for GroupAffine<P> where
P: Parameters,
[src]
P: Parameters,
Auto Trait Implementations
impl<P> RefUnwindSafe for GroupAffine<P> where
P: RefUnwindSafe,
<P as ModelParameters>::BaseField: RefUnwindSafe,
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,
P: Unpin,
<P as ModelParameters>::BaseField: Unpin,
impl<P> UnwindSafe for GroupAffine<P> where
P: UnwindSafe,
<P as ModelParameters>::BaseField: UnwindSafe,
P: UnwindSafe,
<P as ModelParameters>::BaseField: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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> UniformRand for T where
Standard: Distribution<T>,
[src]
impl<T> UniformRand for T where
Standard: Distribution<T>,
[src]impl<V, T> VZip<V> for T where
V: MultiLane<T>,
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]
T: for<'de> Deserialize<'de>,