[][src]Struct jubjub::AffinePoint

pub struct AffinePoint { /* fields omitted */ }

This represents a Jubjub point in the affine (u, v) coordinates.

Implementations

impl AffinePoint[src]

pub const fn identity() -> Self[src]

Constructs the neutral element (0, 1).

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

Determines if this point is the identity.

pub fn mul_by_cofactor(&self) -> ExtendedPoint[src]

Multiplies this point by the cofactor, producing an ExtendedPoint

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

Determines if this point is of small order.

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

Determines if this point is torsion free and so is in the prime order subgroup.

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

Determines if this point is prime order, or in other words that the smallest scalar multiplied by this point that produces the identity is r. This is equivalent to checking that the point is both torsion free and not the identity.

pub fn to_bytes(&self) -> [u8; 32][src]

Converts this element into its byte representation.

pub fn from_bytes(mut b: [u8; 32]) -> CtOption<Self>[src]

Attempts to interpret a byte representation of an affine point, failing if the element is not on the curve or non-canonical.

pub fn get_u(&self) -> Fq[src]

Returns the u-coordinate of this point.

pub fn get_v(&self) -> Fq[src]

Returns the v-coordinate of this point.

pub const fn to_extended(&self) -> ExtendedPoint[src]

Returns an ExtendedPoint for use in arithmetic operations.

pub const fn to_niels(&self) -> AffineNielsPoint[src]

Performs a pre-processing step that produces an AffineNielsPoint for use in multiple additions.

pub const fn from_raw_unchecked(u: Fq, v: Fq) -> AffinePoint[src]

Constructs an AffinePoint given u and v without checking that the point is on the curve.

Trait Implementations

impl<'a, 'b> Add<&'b AffinePoint> for &'a ExtendedPoint[src]

type Output = ExtendedPoint

The resulting type after applying the + operator.

impl<'b> Add<&'b AffinePoint> for ExtendedPoint[src]

type Output = ExtendedPoint

The resulting type after applying the + operator.

impl<'a> Add<AffinePoint> for &'a ExtendedPoint[src]

type Output = ExtendedPoint

The resulting type after applying the + operator.

impl Add<AffinePoint> for ExtendedPoint[src]

type Output = ExtendedPoint

The resulting type after applying the + operator.

impl<'b> AddAssign<&'b AffinePoint> for ExtendedPoint[src]

impl AddAssign<AffinePoint> for ExtendedPoint[src]

impl Clone for AffinePoint[src]

impl CofactorCurveAffine for AffinePoint[src]

type Scalar = Fr

type Curve = ExtendedPoint

impl ConditionallySelectable for AffinePoint[src]

impl ConstantTimeEq for AffinePoint[src]

impl Copy for AffinePoint[src]

impl Debug for AffinePoint[src]

impl Default for AffinePoint[src]

fn default() -> AffinePoint[src]

Returns the identity.

impl Display for AffinePoint[src]

impl Eq for AffinePoint[src]

impl<'a> From<&'a ExtendedPoint> for AffinePoint[src]

fn from(extended: &'a ExtendedPoint) -> AffinePoint[src]

Constructs an affine point from an extended point using the map (U, V, Z, T1, T2) => (U/Z, V/Z) as Z is always nonzero. This requires a field inversion and so it is recommended to perform these in a batch using batch_normalize instead.

impl From<AffinePoint> for ExtendedPoint[src]

fn from(affine: AffinePoint) -> ExtendedPoint[src]

Constructs an extended point (with Z = 1) from an affine point using the map (u, v) => (u, v, 1, u, v).

impl From<ExtendedPoint> for AffinePoint[src]

impl GroupEncoding for AffinePoint[src]

type Repr = [u8; 32]

The encoding of group elements. Read more

impl<'a, 'b> Mul<&'b Fr> for &'a AffinePoint[src]

type Output = ExtendedPoint

The resulting type after applying the * operator.

impl<'b> Mul<&'b Fr> for AffinePoint[src]

type Output = ExtendedPoint

The resulting type after applying the * operator.

impl<'a> Mul<Fr> for &'a AffinePoint[src]

type Output = ExtendedPoint

The resulting type after applying the * operator.

impl Mul<Fr> for AffinePoint[src]

type Output = ExtendedPoint

The resulting type after applying the * operator.

impl Neg for AffinePoint[src]

type Output = AffinePoint

The resulting type after applying the - operator.

fn neg(self) -> AffinePoint[src]

This computes the negation of a point P = (u, v) as -P = (-u, v).

impl PartialEq<AffinePoint> for AffinePoint[src]

impl StructuralEq for AffinePoint[src]

impl<'a, 'b> Sub<&'b AffinePoint> for &'a ExtendedPoint[src]

type Output = ExtendedPoint

The resulting type after applying the - operator.

impl<'b> Sub<&'b AffinePoint> for ExtendedPoint[src]

type Output = ExtendedPoint

The resulting type after applying the - operator.

impl<'a> Sub<AffinePoint> for &'a ExtendedPoint[src]

type Output = ExtendedPoint

The resulting type after applying the - operator.

impl Sub<AffinePoint> for ExtendedPoint[src]

type Output = ExtendedPoint

The resulting type after applying the - operator.

impl<'b> SubAssign<&'b AffinePoint> for ExtendedPoint[src]

impl SubAssign<AffinePoint> for ExtendedPoint[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> TryConv for T

impl<T> TryConv for T

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> 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.