Struct dusk_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

Returns zero, the additive identity.

Returns one, the multiplicative identity.

Doubles this field element.

SHR impl

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.

Squares this element.

Generate a valid Scalar choosen uniformly using user- provided rng.

By rng we mean any Rng that implements: Rng + CryptoRng.

Computes the square root of this element, if it exists.

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.

Multiplies this element by another element

Subtracts another element from this element.

Adds this element to another element.

Negates this element.

Reduces bit representation of numbers, such that they can be evaluated in terms of the least significant bit.

Evaluate if a Scalar, from Fr is even or not.

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.

Computes the windowed-non-adjacent for a given an element in the JubJub Scalar field.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Select a or b according to choice. Read more

Conditionally assign other to self, according to choice. Read more

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more

Determine if two items are equal. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

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

The resulting type after applying the - operator.

Performs the unary - operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests greater than or equal to (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).

The type returned in the event of a conversion error.

The size of

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Negate self if choice == Choice(1); otherwise, leave it unchanged. Read more

Deserialize a slice of u8 into Self

Deserialize the type reading the bytes from a reader. The bytes read are removed from the reader. Read more

Performs the conversion.

Performs the conversion.

Parse a string slice as bytes hex representation and returns `

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.