[−][src]Struct gridiron::fp_256::Monty
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.
fn add(self, rhs: Monty) -> Monty
[src]
impl AddAssign<Monty> for Monty
[src]
fn add_assign(&mut self, other: 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.
fn div(self, rhs: Monty) -> Monty
[src]
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]
impl Mul<Fp256> for Monty
[src]
type Output = Fp256
The resulting type after applying the *
operator.
fn mul(self, rhs: Fp256) -> Fp256
[src]
impl Mul<Monty> for Monty
[src]
type Output = Monty
The resulting type after applying the *
operator.
fn mul(self, rhs: Monty) -> Monty
[src]
impl Mul<Monty> for Fp256
[src]
type Output = Fp256
The resulting type after applying the *
operator.
fn mul(self, rhs: Monty) -> Fp256
[src]
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.
fn mul(self, rhs: u32) -> Monty
[src]
impl Neg for Monty
[src]
impl One for Monty
[src]
impl Ord for Monty
[src]
fn cmp(&self, other: &Monty) -> 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<Monty> for Monty
[src]
impl PartialOrd<Monty> for Monty
[src]
fn partial_cmp(&self, other: &Monty) -> 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<u32> for Monty
[src]
Note that this reveals the exponent, but nothing else. If you need constant time for the exponent, use Pow<$classname>.
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.
fn sub(self, rhs: Monty) -> Monty
[src]
impl SubAssign<Monty> for Monty
[src]
fn sub_assign(&mut self, other: 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]
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>,