[−][src]Trait zkp_u256::Montgomery
Required methods
pub fn reduce_1_inline<M: MontgomeryParameters<UInt = Self>>(&self) -> Self
[src]
Modular reduction at most once
Note. Implementers must add the #[inline(always)]
attribute
pub fn redc_inline<M: MontgomeryParameters<UInt = Self>>(
lo: &Self,
hi: &Self
) -> Self
[src]
lo: &Self,
hi: &Self
) -> Self
Note. Implementers must add the #[inline(always)]
attribute
pub fn square_redc_inline<M: MontgomeryParameters<UInt = Self>>(&self) -> Self
[src]
Note. Implementers must add the #[inline(always)]
attribute
pub fn mul_redc_inline<M: MontgomeryParameters<UInt = Self>>(
&self,
rhs: &Self
) -> Self
[src]
&self,
rhs: &Self
) -> Self
Note. Implementers must add the #[inline(always)]
attribute
pub fn inv_redc<M: MontgomeryParameters<UInt = Self>>(&self) -> Option<Self>
[src]
Provided methods
pub fn to_montgomery<M: MontgomeryParameters<UInt = Self>>(&self) -> Self
[src]
pub fn from_montgomery<M: MontgomeryParameters<UInt = Self>>(&self) -> Self
[src]
pub fn reduce_1<M: MontgomeryParameters<UInt = Self>>(&self) -> Self
[src]
pub fn redc<M: MontgomeryParameters<UInt = Self>>(lo: &Self, hi: &Self) -> Self
[src]
pub fn square_redc<M: MontgomeryParameters<UInt = Self>>(&self) -> Self
[src]
pub fn mul_redc<M: MontgomeryParameters<UInt = Self>>(&self, rhs: &Self) -> Self
[src]
pub fn mul_mod<M: MontgomeryParameters<UInt = Self>>(&self, rhs: &Self) -> Self
[src]
Multiply two numbers in non-Montgomery form.
Combined to_montgomery
, mul_redc
, and from_montgomery
.
Normally this would require four mul_redc
operations, but two
of them cancel out, making this an efficient way to do a single
modular multiplication.
Requirements
Inputs are required to be reduced modulo M::MODULUS
.
Implementors
impl Montgomery for U256
[src]
pub fn reduce_1_inline<M: MontgomeryParameters<UInt = U256>>(&self) -> Self
[src]
pub fn redc_inline<M: MontgomeryParameters<UInt = U256>>(
lo: &Self,
hi: &Self
) -> Self
[src]
lo: &Self,
hi: &Self
) -> Self
pub fn square_redc_inline<M: MontgomeryParameters<UInt = U256>>(&self) -> Self
[src]
pub fn mul_redc_inline<M: MontgomeryParameters<UInt = U256>>(
&self,
rhs: &Self
) -> Self
[src]
&self,
rhs: &Self
) -> Self