Struct dusk_jubjub::JubJubAffine [−][src]
pub struct JubJubAffine { /* fields omitted */ }
This represents a Jubjub point in the affine (x, y)
coordinates.
Implementations
impl JubJubAffine
[src]
impl JubJubAffine
[src]pub const fn identity() -> Self
[src]
Constructs the neutral element (0, 1)
.
pub fn mul_by_cofactor(&self) -> JubJubExtended
[src]
Multiplies this point by the cofactor, producing an
JubJubExtended
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 get_x(&self) -> BlsScalar
[src]
Returns the x
-coordinate of this point.
pub fn get_y(&self) -> BlsScalar
[src]
Returns the y
-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(x: BlsScalar, y: BlsScalar) -> JubJubAffine
[src]
Constructs an JubJubAffine given x
and y
without checking
that the point is on the curve.
Trait Implementations
impl<'a, 'b> Add<&'b JubJubAffine> for &'a JubJubExtended
[src]
impl<'a, 'b> Add<&'b JubJubAffine> for &'a JubJubExtended
[src]type Output = JubJubExtended
The resulting type after applying the +
operator.
fn add(self, other: &'b JubJubAffine) -> JubJubExtended
[src]
impl<'b> Add<&'b JubJubAffine> for JubJubExtended
[src]
impl<'b> Add<&'b JubJubAffine> for JubJubExtended
[src]type Output = JubJubExtended
The resulting type after applying the +
operator.
fn add(self, rhs: &'b JubJubAffine) -> JubJubExtended
[src]
impl<'a> Add<JubJubAffine> for &'a JubJubExtended
[src]
impl<'a> Add<JubJubAffine> for &'a JubJubExtended
[src]type Output = JubJubExtended
The resulting type after applying the +
operator.
fn add(self, rhs: JubJubAffine) -> JubJubExtended
[src]
impl Add<JubJubAffine> for JubJubExtended
[src]
impl Add<JubJubAffine> for JubJubExtended
[src]type Output = JubJubExtended
The resulting type after applying the +
operator.
fn add(self, rhs: JubJubAffine) -> JubJubExtended
[src]
impl<'b> AddAssign<&'b JubJubAffine> for JubJubExtended
[src]
impl<'b> AddAssign<&'b JubJubAffine> for JubJubExtended
[src]fn add_assign(&mut self, rhs: &'b JubJubAffine)
[src]
impl AddAssign<JubJubAffine> for JubJubExtended
[src]
impl AddAssign<JubJubAffine> for JubJubExtended
[src]fn add_assign(&mut self, rhs: JubJubAffine)
[src]
impl Clone for JubJubAffine
[src]
impl Clone for JubJubAffine
[src]fn clone(&self) -> JubJubAffine
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl ConditionallySelectable for JubJubAffine
[src]
impl ConditionallySelectable for JubJubAffine
[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 JubJubAffine
[src]
impl ConstantTimeEq for JubJubAffine
[src]impl Copy for JubJubAffine
[src]
impl Copy for JubJubAffine
[src]impl Default for JubJubAffine
[src]
impl Default for JubJubAffine
[src]fn default() -> JubJubAffine
[src]
Returns the identity.
impl<'a> From<&'a JubJubExtended> for JubJubAffine
[src]
impl<'a> From<&'a JubJubExtended> for JubJubAffine
[src]fn from(extended: &'a JubJubExtended) -> JubJubAffine
[src]
Constructs an affine point from an extended point
using the map (X, Y, Z, T1, T2) => (XZ, Y/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<JubJubAffine> for JubJubExtended
[src]
impl From<JubJubAffine> for JubJubExtended
[src]fn from(affine: JubJubAffine) -> JubJubExtended
[src]
Constructs an extended point (with Z = 1
) from
an affine point using the map (x, y) => (x, y, 1, x, y)
.
impl From<JubJubExtended> for JubJubAffine
[src]
impl From<JubJubExtended> for JubJubAffine
[src]fn from(extended: JubJubExtended) -> JubJubAffine
[src]
impl Neg for JubJubAffine
[src]
impl Neg for JubJubAffine
[src]type Output = JubJubAffine
The resulting type after applying the -
operator.
fn neg(self) -> JubJubAffine
[src]
This computes the negation of a point P = (x, y)
as -P = (-x, y)
.
impl PartialEq<JubJubAffine> for JubJubAffine
[src]
impl PartialEq<JubJubAffine> for JubJubAffine
[src]impl Serializable<32_usize> for JubJubAffine
[src]
impl Serializable<32_usize> for JubJubAffine
[src]type Error = BytesError
The type returned in the event of a conversion error.
fn to_bytes(&self) -> [u8; 32]
[src]
Converts this element into its byte representation.
fn from_bytes(b: &[u8; 32]) -> Result<Self, Self::Error>
[src]
Attempts to interpret a byte representation of an affine point, failing if the element is not on the curve or non-canonical.
pub const SIZE: usize
[src]
impl<'a, 'b> Sub<&'b JubJubAffine> for &'a JubJubExtended
[src]
impl<'a, 'b> Sub<&'b JubJubAffine> for &'a JubJubExtended
[src]type Output = JubJubExtended
The resulting type after applying the -
operator.
fn sub(self, other: &'b JubJubAffine) -> JubJubExtended
[src]
impl<'b> Sub<&'b JubJubAffine> for JubJubExtended
[src]
impl<'b> Sub<&'b JubJubAffine> for JubJubExtended
[src]type Output = JubJubExtended
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b JubJubAffine) -> JubJubExtended
[src]
impl<'a> Sub<JubJubAffine> for &'a JubJubExtended
[src]
impl<'a> Sub<JubJubAffine> for &'a JubJubExtended
[src]type Output = JubJubExtended
The resulting type after applying the -
operator.
fn sub(self, rhs: JubJubAffine) -> JubJubExtended
[src]
impl Sub<JubJubAffine> for JubJubExtended
[src]
impl Sub<JubJubAffine> for JubJubExtended
[src]type Output = JubJubExtended
The resulting type after applying the -
operator.
fn sub(self, rhs: JubJubAffine) -> JubJubExtended
[src]
impl<'b> SubAssign<&'b JubJubAffine> for JubJubExtended
[src]
impl<'b> SubAssign<&'b JubJubAffine> for JubJubExtended
[src]fn sub_assign(&mut self, rhs: &'b JubJubAffine)
[src]
impl SubAssign<JubJubAffine> for JubJubExtended
[src]
impl SubAssign<JubJubAffine> for JubJubExtended
[src]fn sub_assign(&mut self, rhs: JubJubAffine)
[src]
Auto Trait Implementations
impl RefUnwindSafe for JubJubAffine
impl RefUnwindSafe for JubJubAffine
impl Send for JubJubAffine
impl Send for JubJubAffine
impl Sync for JubJubAffine
impl Sync for JubJubAffine
impl Unpin for JubJubAffine
impl Unpin for JubJubAffine
impl UnwindSafe for JubJubAffine
impl UnwindSafe for JubJubAffine
Blanket Implementations
impl<T, const N: usize> DeserializableSlice<N> for T where
T: Serializable<N>,
[src]
impl<T, const N: usize> DeserializableSlice<N> for T where
T: Serializable<N>,
[src]impl<T, const N: usize> ParseHexStr<N> for T where
T: Serializable<N>,
[src]
impl<T, const N: usize> ParseHexStr<N> for T where
T: Serializable<N>,
[src]pub fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
[src]
Self::Error: BadLength,
Self::Error: InvalidChar,