[−][src]Struct jubjub::AffinePoint
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.
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<'b> AddAssign<&'b AffinePoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: &'b AffinePoint)
[src]
impl AddAssign<AffinePoint> for ExtendedPoint
[src]
fn add_assign(&mut self, rhs: AffinePoint)
[src]
impl Clone for AffinePoint
[src]
fn clone(&self) -> AffinePoint
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl CofactorCurveAffine for AffinePoint
[src]
type Scalar = Fr
type Curve = ExtendedPoint
fn identity() -> Self
[src]
fn generator() -> Self
[src]
fn is_identity(&self) -> Choice
[src]
fn to_curve(&self) -> Self::Curve
[src]
impl ConditionallySelectable for AffinePoint
[src]
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
[src]
pub fn conditional_assign(&mut self, other: &Self, choice: Choice)
[src]
pub fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
[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]
fn from(extended: ExtendedPoint) -> AffinePoint
[src]
impl GroupEncoding for AffinePoint
[src]
type Repr = [u8; 32]
The encoding of group elements. Read more
fn from_bytes(bytes: &Self::Repr) -> CtOption<Self>
[src]
fn from_bytes_unchecked(bytes: &Self::Repr) -> CtOption<Self>
[src]
fn to_bytes(&self) -> Self::Repr
[src]
impl<'a, 'b> Mul<&'b Fr> for &'a AffinePoint
[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 AffinePoint
[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 AffinePoint
[src]
type Output = ExtendedPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Fr) -> ExtendedPoint
[src]
impl Mul<Fr> for AffinePoint
[src]
type Output = ExtendedPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Fr) -> ExtendedPoint
[src]
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.
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<'b> SubAssign<&'b AffinePoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: &'b AffinePoint)
[src]
impl SubAssign<AffinePoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, rhs: AffinePoint)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Conv for T
impl<T> Conv for T
impl<T> FmtForward for T
pub fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
pub fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
pub fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
pub fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
pub fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
pub fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
pub fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
pub fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pipe for T where
T: ?Sized,
T: ?Sized,
pub fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_ref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
pub fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
pub fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
pub fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
pub fn pipe_as_mut<'a, U, R>(
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
pub fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
pub fn pipe_deref_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
R: 'a,
impl<T> Pipe for T
impl<T> PipeAsRef for T
pub fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Self: AsRef<T>,
T: 'a,
R: 'a,
pub fn pipe_as_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
impl<T> PipeBorrow for T
pub fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Self: Borrow<T>,
T: 'a,
R: 'a,
pub fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
impl<T> PipeDeref for T
pub fn pipe_deref<'a, R>(
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
pub fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
impl<T> PipeRef for T
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
R: 'a,
impl<T> Tap for T
pub fn tap(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
pub fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
impl<T> Tap for T
pub fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
pub fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
impl<T> TapDeref for T
pub fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
pub fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> TryConv for T
impl<T> TryConv for T
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.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,