Struct fullcodec_jubjub::JubJubScalar [−][src]
pub struct JubJubScalar(_);
Expand description
Represents an element of the scalar field $\mathbb{F}_r$ of the Jubjub elliptic curve construction.
Implementations
Converts a 512-bit little endian integer into an element of Fr by reducing modulo r.
Converts from an integer represented in little endian
into its (congruent) Fr
representation.
Generate a valid Scalar choosen uniformly using user- provided rng.
By rng
we mean any Rng that implements: Rng
+ CryptoRng
.
Exponentiates self
by by
, where by
is a
little-endian order integer exponent.
Exponentiates self
by by
, where by
is a
little-endian order integer exponent.
This operation is variable time with respect to the exponent. If the exponent is fixed, this operation is effectively constant time.
Computes the multiplicative inverse of this element, failing if the element is zero.
Reduces bit representation of numbers, such that they can be evaluated in terms of the least significant bit.
Compute the result from Scalar (mod 2^k)
.
Panics
If the given k is > 32 (5 bits) as the value gets greater than the limb.
Compute the result from Scalar (mods k)
.
Panics
If the given k > 32 (5 bits)
|| k == 0
as the value gets
greater than the limb.
Trait Implementations
Performs the +=
operation. Read more
Performs the +=
operation. Read more
type Output = ElgamalCipher
type Output = ElgamalCipher
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = ElgamalCipher
type Output = ElgamalCipher
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = JubJubExtended
type Output = JubJubExtended
The resulting type after applying the *
operator.
Performs the *
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Converts an element of Fr
into a byte representation in
little-endian byte order.
Attempts to convert a little-endian byte representation of
a field element into an element of Fr
, failing if the input
is not canonical (is not smaller than r).
type Error = BytesError
type Error = BytesError
The type returned in the event of a conversion error.
Performs the -=
operation. Read more
Performs the -=
operation. Read more
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: for<'a> Neg,
<&'a T as Neg>::Output == T,
impl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: for<'a> Neg,
<&'a T as Neg>::Output == T,
Negate self
if choice == Choice(1)
; otherwise, leave it
unchanged. Read more
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 `