Struct plonk_pallet::JubJubAffine [−][src]
pub struct JubJubAffine { /* fields omitted */ }
Expand description
This represents a Jubjub point in the affine (x, y)
coordinates.
Implementations
Constructs the neutral element (0, 1)
.
Multiplies this point by the cofactor, producing an
JubJubExtended
Determines if this point is of small order.
Determines if this point is torsion free and so is in the prime order subgroup.
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.
Performs a pre-processing step that produces an AffineNielsPoint
for use in multiple additions.
Constructs an JubJubAffine given x
and y
without checking
that the point is on the curve.
Trait Implementations
Determine if two items are equal. Read more
Returns the identity.
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.
Performs the conversion.
Performs the conversion.
This computes the negation of a point P = (x, y)
as -P = (-x, y)
.
type Output = JubJubAffine
type Output = JubJubAffine
The resulting type after applying the -
operator.
pub fn from_bytes(
b: &[u8; 32]
) -> Result<JubJubAffine, <JubJubAffine as Serializable<32_usize>>::Error>
pub fn from_bytes(
b: &[u8; 32]
) -> Result<JubJubAffine, <JubJubAffine as Serializable<32_usize>>::Error>
Attempts to interpret a byte representation of an affine point, failing if the element is not on the curve or non-canonical.
NOTE: ZIP 216 is enabled by default and the only way to interact with serialization. See: https://zips.z.cash/zip-0216 for more details.
type Error = Error
type Error = Error
The type returned in the event of a conversion error.
Auto Trait Implementations
impl RefUnwindSafe for JubJubAffine
impl Send for JubJubAffine
impl Sync for JubJubAffine
impl Unpin for JubJubAffine
impl UnwindSafe for JubJubAffine
Blanket Implementations
Mutably borrows from an owned value. Read more
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
impl<T, const N: usize> DeserializableSlice<N> for T where
T: Serializable<N>,
impl<T, const N: usize> DeserializableSlice<N> for T where
T: Serializable<N>,
fn from_slice(buf: &[u8]) -> Result<Self, Self::Error> where
Self::Error: BadLength,
fn from_slice(buf: &[u8]) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Deserialize a slice of u8
into [Self
]
fn from_reader<R>(buf: &mut R) -> Result<Self, Self::Error> where
R: Read,
Self::Error: BadLength,
fn from_reader<R>(buf: &mut R) -> Result<Self, Self::Error> where
R: Read,
Self::Error: BadLength,
Deserialize the type reading the bytes from a reader. The bytes read are removed from the reader. Read more
impl<T, const N: usize> ParseHexStr<N> for T where
T: Serializable<N>,
impl<T, const N: usize> ParseHexStr<N> for T where
T: Serializable<N>,
fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
Parse a string slice as bytes hex representation and returns `
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
pub fn unchecked_into(self) -> T
pub fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
pub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more