[][src]Struct jubjub::AffinePoint

pub struct AffinePoint { /* fields omitted */ }

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

Methods

impl AffinePoint[src]

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

Constructs the neutral element (0, 1).

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(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_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 PartialEq<AffinePoint> for AffinePoint[src]

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

This method tests for !=.

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<'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 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 AddAssign<AffinePoint> for ExtendedPoint[src]

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

impl SubAssign<AffinePoint> for ExtendedPoint[src]

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

impl Debug for AffinePoint[src]

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<'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<ExtendedPoint> for AffinePoint[src]

impl Copy for AffinePoint[src]

impl Clone for AffinePoint[src]

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

Performs copy-assignment from source. Read more

impl Default for AffinePoint[src]

fn default() -> AffinePoint[src]

Returns the identity.

impl ConstantTimeEq for AffinePoint[src]

impl ConditionallySelectable for AffinePoint[src]

fn conditional_assign(&mut self, other: &Self, choice: Choice)[src]

Conditionally assign other to self, according to choice. Read more

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)[src]

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more

Auto Trait Implementations

impl Send for AffinePoint

impl Sync for AffinePoint

Blanket Implementations

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> From<T> for 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.