[][src]Struct gridiron::fp_480::Monty

pub struct Monty { /* fields omitted */ }

This is the Montgomery form of the $classname. This is typically used for its fast implementation of Multiplication as the conversion to Montgomery form + multiplication is as fast as normal multiplication + reduction.

If you are doing more than 1 multiplication, it's clearly a win.

Methods

impl Monty[src]

pub fn to_norm(self) -> Fp480[src]

Bring the montgomery form back into the $classname.

pub const fn new(limbs: [u32; 16]) -> Monty[src]

Constructor. Note that this is unsafe if the limbs happen to be greater than your PRIME. In that case you should use conversion to byte arrays or manually do the math on the limbs yourself.

Trait Implementations

impl ConstantSwap for Monty[src]

fn swap_if(&mut self, other: &mut Monty, swap: ConstantBool<u32>)[src]

Swaps this with other if the value was true

impl From<u8> for Monty[src]

impl From<u32> for Monty[src]

impl From<u64> for Monty[src]

impl From<[u8; 64]> for Monty[src]

impl Default for Monty[src]

impl Copy for Monty[src]

impl PartialOrd<Monty> for Monty[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Eq for Monty[src]

impl Ord for Monty[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialEq<Monty> for Monty[src]

impl Clone for Monty[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Monty[src]

impl Add<Monty> for Monty[src]

type Output = Monty

The resulting type after applying the + operator.

impl Sub<Monty> for Monty[src]

type Output = Monty

The resulting type after applying the - operator.

impl Mul<Monty> for Monty[src]

type Output = Monty

The resulting type after applying the * operator.

impl Mul<u32> for Monty[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 = Monty

The resulting type after applying the * operator.

impl Mul<Fp480> for Monty[src]

type Output = Fp480

The resulting type after applying the * operator.

impl Mul<Monty> for Fp480[src]

type Output = Fp480

The resulting type after applying the * operator.

impl Div<Monty> for Monty[src]

type Output = Monty

The resulting type after applying the / operator.

impl Neg for Monty[src]

type Output = Monty

The resulting type after applying the - operator.

impl AddAssign<Monty> for Monty[src]

impl SubAssign<Monty> for Monty[src]

impl Zero for Monty[src]

impl One for Monty[src]

impl Inv for Monty[src]

type Output = Monty

The result after applying the operator.

impl Pow<u32> for Monty[src]

Note that this reveals the exponent, but nothing else. If you need constant time for the exponent, use Pow<$classname>.

type Output = Monty

The result after applying the operator.

Auto Trait Implementations

impl Send for Monty

impl Sync for Monty

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]