[][src]Struct bls12_381::G1Affine

pub struct G1Affine { /* fields omitted */ }

This is an element of $\mathbb{G}_1$ represented in the affine coordinate space. It is ideal to keep elements in this representation to reduce memory usage and improve performance through the use of mixed curve model arithmetic.

Values of G1Affine are guaranteed to be in the $q$-order subgroup unless an "unchecked" API was misused.

Methods

impl G1Affine[src]

pub fn identity() -> G1Affine[src]

Returns the identity of the group: the point at infinity.

pub fn generator() -> G1Affine[src]

Returns a fixed generator of the group. See notes::design for how this generator is chosen.

pub fn to_compressed(&self) -> [u8; 48][src]

Serializes this element into compressed form. See notes::serialization for details about how group elements are serialized.

pub fn to_uncompressed(&self) -> [u8; 96][src]

Serializes this element into uncompressed form. See notes::serialization for details about how group elements are serialized.

pub fn from_uncompressed(bytes: &[u8; 96]) -> CtOption<Self>[src]

Attempts to deserialize an uncompressed element. See notes::serialization for details about how group elements are serialized.

pub fn from_uncompressed_unchecked(bytes: &[u8; 96]) -> CtOption<Self>[src]

Attempts to deserialize an uncompressed element, not checking if the element is on the curve and not checking if it is in the correct subgroup. This is dangerous to call unless you trust the bytes you are reading; otherwise, API invariants may be broken. Please consider using from_uncompressed() instead.

pub fn from_compressed(bytes: &[u8; 48]) -> CtOption<Self>[src]

Attempts to deserialize a compressed element. See notes::serialization for details about how group elements are serialized.

pub fn from_compressed_unchecked(bytes: &[u8; 48]) -> CtOption<Self>[src]

Attempts to deserialize an uncompressed element, not checking if the element is in the correct subgroup. This is dangerous to call unless you trust the bytes you are reading; otherwise, API invariants may be broken. Please consider using from_compressed() instead.

pub fn is_identity(&self) -> Choice[src]

Returns true if this element is the identity (the point at infinity).

pub fn is_torsion_free(&self) -> Choice[src]

Returns true if this point is free of an $h$-torsion component, and so it exists within the $q$-order subgroup $\mathbb{G}_1$. This should always return true unless an "unchecked" API was used.

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

Returns true if this point is on the curve. This should always return true unless an "unchecked" API was used.

Trait Implementations

impl<'a> From<&'a G1Projective> for G1Affine[src]

impl From<G1Projective> for G1Affine[src]

impl<'a> From<&'a G1Affine> for G1Projective[src]

impl From<G1Affine> for G1Projective[src]

impl Debug for G1Affine[src]

impl<'a, 'b> Sub<&'b G1Projective> for &'a G1Affine[src]

type Output = G1Projective

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'b G1Affine> for &'a G1Projective[src]

type Output = G1Projective

The resulting type after applying the - operator.

impl<'b> Sub<&'b G1Affine> for G1Projective[src]

type Output = G1Projective

The resulting type after applying the - operator.

impl<'a> Sub<G1Affine> for &'a G1Projective[src]

type Output = G1Projective

The resulting type after applying the - operator.

impl Sub<G1Affine> for G1Projective[src]

type Output = G1Projective

The resulting type after applying the - operator.

impl<'b> Sub<&'b G1Projective> for G1Affine[src]

type Output = G1Projective

The resulting type after applying the - operator.

impl<'a> Sub<G1Projective> for &'a G1Affine[src]

type Output = G1Projective

The resulting type after applying the - operator.

impl Sub<G1Projective> for G1Affine[src]

type Output = G1Projective

The resulting type after applying the - operator.

impl PartialEq<G1Affine> for G1Affine[src]

impl Eq for G1Affine[src]

impl<'a, 'b> Add<&'b G1Projective> for &'a G1Affine[src]

type Output = G1Projective

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'b G1Affine> for &'a G1Projective[src]

type Output = G1Projective

The resulting type after applying the + operator.

impl<'b> Add<&'b G1Affine> for G1Projective[src]

type Output = G1Projective

The resulting type after applying the + operator.

impl<'a> Add<G1Affine> for &'a G1Projective[src]

type Output = G1Projective

The resulting type after applying the + operator.

impl Add<G1Affine> for G1Projective[src]

type Output = G1Projective

The resulting type after applying the + operator.

impl<'b> Add<&'b G1Projective> for G1Affine[src]

type Output = G1Projective

The resulting type after applying the + operator.

impl<'a> Add<G1Projective> for &'a G1Affine[src]

type Output = G1Projective

The resulting type after applying the + operator.

impl Add<G1Projective> for G1Affine[src]

type Output = G1Projective

The resulting type after applying the + operator.

impl<'a, 'b> Mul<&'b Scalar> for &'a G1Affine[src]

type Output = G1Projective

The resulting type after applying the * operator.

impl<'b> Mul<&'b Scalar> for G1Affine[src]

type Output = G1Projective

The resulting type after applying the * operator.

impl<'a> Mul<Scalar> for &'a G1Affine[src]

type Output = G1Projective

The resulting type after applying the * operator.

impl Mul<Scalar> for G1Affine[src]

type Output = G1Projective

The resulting type after applying the * operator.

impl<'a> Neg for &'a G1Affine[src]

type Output = G1Affine

The resulting type after applying the - operator.

impl Neg for G1Affine[src]

type Output = G1Affine

The resulting type after applying the - operator.

impl AddAssign<G1Affine> for G1Projective[src]

impl<'b> AddAssign<&'b G1Affine> for G1Projective[src]

impl SubAssign<G1Affine> for G1Projective[src]

impl<'b> SubAssign<&'b G1Affine> for G1Projective[src]

impl Copy for G1Affine[src]

impl Clone for G1Affine[src]

impl Default for G1Affine[src]

impl ConstantTimeEq for G1Affine[src]

impl ConditionallySelectable for G1Affine[src]

Auto Trait Implementations

impl Unpin for G1Affine

impl Send for G1Affine

impl Sync for G1Affine

Blanket Implementations

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

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.

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

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.

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ConditionallyNegatable for T where
    T: ConditionallySelectable,
    &'a T: Neg,
    <&'a T as Neg>::Output == T, 
[src]