[−][src]Struct jubjub::ExtendedPoint
This represents an extended point (U, V, Z, T1, T2)
with Z
nonzero, corresponding to the affine point
(U/Z, V/Z)
. We always have T1 * T2 = UV/Z
.
You can do the following things with a point in this form:
- Convert it into a point in the affine form.
- Add it to an
ExtendedPoint
,AffineNielsPoint
orExtendedNielsPoint
. - Double it using
double()
. - Compare it with another extended point using
PartialEq
orct_eq()
.
Methods
impl ExtendedPoint
[src]
pub const fn identity() -> Self
[src]
Constructs an extended point from the neutral element (0, 1)
.
pub fn is_identity(&self) -> Choice
[src]
Determines if this point is the identity.
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 contained 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 mul_by_cofactor(&self) -> ExtendedPoint
[src]
Multiplies this element by the cofactor 8
.
pub fn to_niels(&self) -> ExtendedNielsPoint
[src]
Performs a pre-processing step that produces an ExtendedNielsPoint
for use in multiple additions.
pub fn double(&self) -> ExtendedPoint
[src]
Computes the doubling of a point more efficiently than a point can be added to itself.
Trait Implementations
impl PartialEq<ExtendedPoint> for ExtendedPoint
[src]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> Add<&'b ExtendedNielsPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b ExtendedNielsPoint) -> ExtendedPoint
[src]
impl<'b> Add<&'b ExtendedNielsPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: &'b ExtendedNielsPoint) -> ExtendedPoint
[src]
impl<'a> Add<ExtendedNielsPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: ExtendedNielsPoint) -> ExtendedPoint
[src]
impl Add<ExtendedNielsPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: ExtendedNielsPoint) -> ExtendedPoint
[src]
impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b AffineNielsPoint) -> ExtendedPoint
[src]
impl<'b> Add<&'b AffineNielsPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: &'b AffineNielsPoint) -> ExtendedPoint
[src]
impl<'a> Add<AffineNielsPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: AffineNielsPoint) -> ExtendedPoint
[src]
impl Add<AffineNielsPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: AffineNielsPoint) -> ExtendedPoint
[src]
impl<'a, 'b> Add<&'b ExtendedPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b ExtendedPoint) -> ExtendedPoint
[src]
impl<'b> Add<&'b ExtendedPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: &'b ExtendedPoint) -> ExtendedPoint
[src]
impl<'a> Add<ExtendedPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: ExtendedPoint) -> ExtendedPoint
[src]
impl Add<ExtendedPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: ExtendedPoint) -> ExtendedPoint
[src]
impl<'a, 'b> Add<&'b AffinePoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b AffinePoint) -> ExtendedPoint
[src]
impl<'b> Add<&'b AffinePoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: &'b AffinePoint) -> ExtendedPoint
[src]
impl<'a> Add<AffinePoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: AffinePoint) -> ExtendedPoint
[src]
impl Add<AffinePoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, rhs: AffinePoint) -> ExtendedPoint
[src]
impl<'a, 'b> Sub<&'b ExtendedNielsPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b ExtendedNielsPoint) -> ExtendedPoint
[src]
impl<'b> Sub<&'b ExtendedNielsPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b ExtendedNielsPoint) -> ExtendedPoint
[src]
impl<'a> Sub<ExtendedNielsPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: ExtendedNielsPoint) -> ExtendedPoint
[src]
impl Sub<ExtendedNielsPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: ExtendedNielsPoint) -> ExtendedPoint
[src]
impl<'a, 'b> Sub<&'b AffineNielsPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b AffineNielsPoint) -> ExtendedPoint
[src]
impl<'b> Sub<&'b AffineNielsPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b AffineNielsPoint) -> ExtendedPoint
[src]
impl<'a> Sub<AffineNielsPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: AffineNielsPoint) -> ExtendedPoint
[src]
impl Sub<AffineNielsPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: AffineNielsPoint) -> ExtendedPoint
[src]
impl<'a, 'b> Sub<&'b ExtendedPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b ExtendedPoint) -> ExtendedPoint
[src]
impl<'b> Sub<&'b ExtendedPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b ExtendedPoint) -> ExtendedPoint
[src]
impl<'a> Sub<ExtendedPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: ExtendedPoint) -> ExtendedPoint
[src]
impl Sub<ExtendedPoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: ExtendedPoint) -> ExtendedPoint
[src]
impl<'a, 'b> Sub<&'b AffinePoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b AffinePoint) -> ExtendedPoint
[src]
impl<'b> Sub<&'b AffinePoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b AffinePoint) -> ExtendedPoint
[src]
impl<'a> Sub<AffinePoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: AffinePoint) -> ExtendedPoint
[src]
impl Sub<AffinePoint> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: AffinePoint) -> ExtendedPoint
[src]
impl<'a, 'b> Mul<&'b Fr> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the *
operator.
fn mul(self, other: &'b Fr) -> ExtendedPoint
[src]
impl<'b> Mul<&'b Fr> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Fr) -> ExtendedPoint
[src]
impl<'a> Mul<Fr> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Fr) -> ExtendedPoint
[src]
impl Mul<Fr> for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Fr) -> ExtendedPoint
[src]
impl Neg for ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn neg(self) -> ExtendedPoint
[src]
Computes the negation of a point P = (U, V, Z, T)
as -P = (-U, V, Z, -T1, T2)
. The choice of T1
is made without loss of generality.
impl AddAssign<ExtendedNielsPoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: ExtendedNielsPoint)
[src]
impl<'b> AddAssign<&'b ExtendedNielsPoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: &'b ExtendedNielsPoint)
[src]
impl AddAssign<AffineNielsPoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: AffineNielsPoint)
[src]
impl<'b> AddAssign<&'b AffineNielsPoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: &'b AffineNielsPoint)
[src]
impl AddAssign<ExtendedPoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: ExtendedPoint)
[src]
impl<'b> AddAssign<&'b ExtendedPoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: &'b ExtendedPoint)
[src]
impl AddAssign<AffinePoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: AffinePoint)
[src]
impl<'b> AddAssign<&'b AffinePoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: &'b AffinePoint)
[src]
impl SubAssign<ExtendedNielsPoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: ExtendedNielsPoint)
[src]
impl<'b> SubAssign<&'b ExtendedNielsPoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: &'b ExtendedNielsPoint)
[src]
impl SubAssign<AffineNielsPoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: AffineNielsPoint)
[src]
impl<'b> SubAssign<&'b AffineNielsPoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: &'b AffineNielsPoint)
[src]
impl SubAssign<ExtendedPoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: ExtendedPoint)
[src]
impl<'b> SubAssign<&'b ExtendedPoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: &'b ExtendedPoint)
[src]
impl SubAssign<AffinePoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: AffinePoint)
[src]
impl<'b> SubAssign<&'b AffinePoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: &'b AffinePoint)
[src]
impl MulAssign<Fr> for ExtendedPoint
[src]
fn mul_assign(&mut self, rhs: Fr)
[src]
impl<'b> MulAssign<&'b Fr> for ExtendedPoint
[src]
fn mul_assign(&mut self, rhs: &'b Fr)
[src]
impl Debug for ExtendedPoint
[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]
fn from(extended: ExtendedPoint) -> AffinePoint
[src]
impl Copy for ExtendedPoint
[src]
impl Clone for ExtendedPoint
[src]
fn clone(&self) -> ExtendedPoint
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for ExtendedPoint
[src]
fn default() -> ExtendedPoint
[src]
Returns the identity.
impl ConstantTimeEq for ExtendedPoint
[src]
impl ConditionallySelectable for ExtendedPoint
[src]
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
[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 ExtendedPoint
impl Sync for ExtendedPoint
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,