[][src]Struct gridiron::fp_256::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) -> Fp256[src]

Bring the montgomery form back into the $classname.

pub const fn new(limbs: [u32; 9]) -> 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 Add<Monty> for Monty[src]

type Output = Monty

The resulting type after applying the + operator.

impl AddAssign<Monty> for Monty[src]

impl Clone for Monty[src]

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 Copy for Monty[src]

impl Debug for Monty[src]

impl Default for Monty[src]

impl Div<Monty> for Monty[src]

type Output = Monty

The resulting type after applying the / operator.

impl Eq for Monty[src]

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

impl From<u32> for Monty[src]

impl From<u64> for Monty[src]

impl From<u8> for Monty[src]

impl Inv for Monty[src]

type Output = Monty

The result after applying the operator.

impl Mul<Fp256> for Monty[src]

type Output = Fp256

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<Monty> for Fp256[src]

type Output = Fp256

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 Neg for Monty[src]

type Output = Monty

The resulting type after applying the - operator.

impl One for Monty[src]

impl Ord for Monty[src]

impl PartialEq<Monty> for Monty[src]

impl PartialOrd<Monty> for Monty[src]

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.

impl StructuralEq for Monty[src]

impl StructuralPartialEq for Monty[src]

impl Sub<Monty> for Monty[src]

type Output = Monty

The resulting type after applying the - operator.

impl SubAssign<Monty> for Monty[src]

impl Zero for Monty[src]

Auto Trait Implementations

impl RefUnwindSafe for Monty

impl Send for Monty

impl Sync for Monty

impl Unpin for Monty

impl UnwindSafe for Monty

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.