Struct gridiron::fp_480::Fp480[][src]

pub struct Fp480 { /* fields omitted */ }

Implementations

See normalize_little_limbs.

This normalize should only be used when the input is at most 2*p-1.

See normalize_little_limbs.

Convert the value to a byte array which is PRIMEBYTES long. Ported from BearSSL br_i31_encode.

Create a new instance given the raw limbs form. Note that this is least significant bit first.

Trait Implementations

The resulting type after applying the + operator.

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

Swaps this with other if the value was true

Formats the value using the given formatter. Read more

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

The resulting type after applying the / operator.

Performs the / operation. Read more

Assume element zero is most sig

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The result after applying the operator.

Returns the multiplicative inverse of self. Read more

Prints the hex value of the number in big endian (most significant digit on the left and least on the right) to make debugging easier.

Formats the value using the given formatter.

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

Note that this reveals the u32, but nothing else. It’s expected that the u32 is not secret. If it is, you can use Mul<$classname>

The resulting type after applying the * operator.

Performs the * operation. Read more

Note that this uses a conversion to montgomery form and then multiplies by the other value to get back out. This takes less time than just doing the multiplication and doing a reduction.

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

Returns the multiplicative identity element of Self, 1. Read more

Returns true if self is equal to the multiplicative identity. Read more

Sets self to the multiplicative identity element of Self, 1.

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

14.94 Algorithm Montgomery exponentiation in Handbook of Applied Crypto INPUT:m=(ml−1···m0)b,R=bl,m′ =−m−1 modb,e=(et···e0)2 withet =1, and an integer x, 1 ≤ x < m. OUTPUT: xe mod m.

  1. x􏰁← Mont(x,R2 mod m), A←R mod m. (R mod m and R2 mod m may be pro-ided as inputs.)
  2. For i from t down to 0 do the following: 2.1 A←Mont(A,A). 2.2 If ei = 1 then A← Mont(A, x􏰁).
  3. A←Mont(A,1).
  4. Return(A).

The result after applying the operator.

Reveals the exponent. If you need constant time, use Pow<$classname>

The result after applying the operator.

Returns self to the power rhs. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

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

Performs the conversion.

Performs the conversion.

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.