[−][src]Struct gridiron::fp_480::Fp480
Methods
impl Fp480
[src]
pub fn to_monty(self) -> Monty
[src]
pub fn normalize_assign_little(&mut self)
[src]
See normalize_little_limbs.
pub fn normalize_little_limbs(limbs: [u32; 16]) -> [u32; 16]
[src]
This normalize should only be used when the input is at most 2*p-1.
pub fn normalize_little(self) -> Self
[src]
See normalize_little_limbs.
pub fn to_bytes_array(&self) -> [u8; 60]
[src]
Convert the value to a byte array which is PRIMEBYTES
long.
Ported from BearSSL br_i31_encode.
pub fn new(digits: [u32; 16]) -> Fp480
[src]
Create a new instance given the raw limbs form. Note that this is least significant bit first.
pub fn to_str_hex(&self) -> String
[src]
pub fn iter_bit(&self) -> FpBitIter<Fp480>
[src]
Trait Implementations
impl Add<Fp480> for Fp480
[src]
type Output = Fp480
The resulting type after applying the +
operator.
fn add(self, other: Fp480) -> Fp480
[src]
impl AddAssign<Fp480> for Fp480
[src]
fn add_assign(&mut self, other: Fp480)
[src]
impl Clone for Fp480
[src]
impl ConstantSwap for Fp480
[src]
fn swap_if(&mut self, other: &mut Fp480, swap: ConstantBool<u32>)
[src]
Swaps this with other if the value was true
impl Copy for Fp480
[src]
impl Debug for Fp480
[src]
impl Default for Fp480
[src]
impl Div<Fp480> for Fp480
[src]
type Output = Fp480
The resulting type after applying the /
operator.
fn div(self, rhs: Fp480) -> Fp480
[src]
impl Eq for Fp480
[src]
impl From<[u8; 60]> for Fp480
[src]
Assume element zero is most sig
impl From<[u8; 64]> for Fp480
[src]
impl From<u32> for Fp480
[src]
impl From<u64> for Fp480
[src]
impl From<u8> for Fp480
[src]
impl Inv for Fp480
[src]
impl LowerHex for Fp480
[src]
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.
impl Mul<Fp480> for Fp480
[src]
type Output = Fp480
The resulting type after applying the *
operator.
fn mul(self, rhs: Fp480) -> Fp480
[src]
impl Mul<Fp480> for Monty
[src]
type Output = Fp480
The resulting type after applying the *
operator.
fn mul(self, rhs: Fp480) -> Fp480
[src]
impl Mul<Monty> for Fp480
[src]
type Output = Fp480
The resulting type after applying the *
operator.
fn mul(self, rhs: Monty) -> Fp480
[src]
impl Mul<u32> for Fp480
[src]
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>
type Output = Fp480
The resulting type after applying the *
operator.
fn mul(self, rhs: u32) -> Fp480
[src]
impl MulAssign<Fp480> for Fp480
[src]
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.
fn mul_assign(&mut self, rhs: Fp480)
[src]
impl Neg for Fp480
[src]
impl One for Fp480
[src]
impl Ord for Fp480
[src]
fn cmp(&self, other: &Fp480) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Fp480> for Fp480
[src]
impl PartialOrd<Fp480> for Fp480
[src]
fn partial_cmp(&self, other: &Fp480) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Pow<Fp480> for Fp480
[src]
type Output = Fp480
The result after applying the operator.
fn pow(self, rhs: Fp480) -> Fp480
[src]
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).
impl Pow<u32> for Fp480
[src]
Reveals the exponent. If you need constant time, use Pow<$classname>
impl StructuralEq for Fp480
[src]
impl StructuralPartialEq for Fp480
[src]
impl Sub<Fp480> for Fp480
[src]
type Output = Fp480
The resulting type after applying the -
operator.
fn sub(self, other: Fp480) -> Fp480
[src]
impl SubAssign<Fp480> for Fp480
[src]
fn sub_assign(&mut self, other: Fp480)
[src]
impl Zero for Fp480
[src]
Auto Trait Implementations
impl RefUnwindSafe for Fp480
impl Send for Fp480
impl Sync for Fp480
impl Unpin for Fp480
impl UnwindSafe for Fp480
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,