Struct gridiron::fp_256::Fp256 [−][src]
pub struct Fp256 { /* 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
Performs the +=
operation. Read more
Swaps this with other if the value was true
Assume element zero is most sig
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.
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>
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
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
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.
- x← Mont(x,R2 mod m), A←R mod m. (R mod m and R2 mod m may be pro-ided as inputs.)
- 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).
- A←Mont(A,1).
- Return(A).
Reveals the exponent. If you need constant time, use Pow<$classname>
Performs the -=
operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for Fp256
impl UnwindSafe for Fp256
Blanket Implementations
Mutably borrows from an owned value. Read more