pub struct ConstMontyForm<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> { /* private fields */ }Expand description
An integer in Montgomery form modulo MOD, represented using LIMBS limbs.
The modulus is constant, so it cannot be set at runtime.
Internally, the value is stored in Montgomery form (multiplied by MOD::PARAMS.one) until it is retrieved.
Implementations§
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Sourcepub const fn add(&self, rhs: &ConstMontyForm<MOD, LIMBS>) -> Self
pub const fn add(&self, rhs: &ConstMontyForm<MOD, LIMBS>) -> Self
Adds rhs.
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Sourcepub const fn inv(&self) -> CtOption<Self>
👎Deprecated since 0.7.0: please use invert instead
pub const fn inv(&self) -> CtOption<Self>
please use invert instead
Computes self^-1 representing the multiplicative inverse of self,
i.e. self * self^-1 = 1.
If the number was invertible, the second element of the tuple is the truthy value, otherwise it is the falsy value (in which case the first element’s value is unspecified).
Sourcepub const fn invert(&self) -> CtOption<Self>
pub const fn invert(&self) -> CtOption<Self>
Computes self^-1 representing the multiplicative inverse of self,
i.e. self * self^-1 = 1.
If the number was invertible, the second element of the tuple is the truthy value, otherwise it is the falsy value (in which case the first element’s value is unspecified).
Sourcepub const fn inv_vartime(&self) -> CtOption<Self>
👎Deprecated since 0.7.0: please use invert_vartime instead
pub const fn inv_vartime(&self) -> CtOption<Self>
please use invert_vartime instead
Computes self^-1 representing the multiplicative inverse of self,
i.e. self * self^-1 = 1.
If the number was invertible, the second element of the tuple is the truthy value, otherwise it is the falsy value (in which case the first element’s value is unspecified).
This version is variable-time with respect to the value of self, but constant-time with
respect to MOD.
Sourcepub const fn invert_vartime(&self) -> CtOption<Self>
pub const fn invert_vartime(&self) -> CtOption<Self>
Computes self^-1 representing the multiplicative inverse of self,
i.e. self * self^-1 = 1.
If the number was invertible, the second element of the tuple is the truthy value, otherwise it is the falsy value (in which case the first element’s value is unspecified).
This version is variable-time with respect to the value of self, but constant-time with
respect to MOD.
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Sourcepub const fn jacobi_symbol(&self) -> JacobiSymbol
pub const fn jacobi_symbol(&self) -> JacobiSymbol
Compute the Jacobi symbol (self|modulus).
For a prime modulus, this corresponds to the Legendre symbol and indicates
whether self is quadratic residue.
Sourcepub const fn jacobi_symbol_vartime(&self) -> JacobiSymbol
pub const fn jacobi_symbol_vartime(&self) -> JacobiSymbol
Compute the Jacobi symbol (self|modulus).
For a prime modulus, this corresponds to the Legendre symbol and indicates
whether self is quadratic residue.
This method is variable-time with respect to the value of self.
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Sourcepub const fn pow<const RHS_LIMBS: usize>(
&self,
exponent: &Uint<RHS_LIMBS>,
) -> Self
pub const fn pow<const RHS_LIMBS: usize>( &self, exponent: &Uint<RHS_LIMBS>, ) -> Self
Raises to the exponent power.
Sourcepub const fn pow_bounded_exp<const RHS_LIMBS: usize>(
&self,
exponent: &Uint<RHS_LIMBS>,
exponent_bits: u32,
) -> Self
pub const fn pow_bounded_exp<const RHS_LIMBS: usize>( &self, exponent: &Uint<RHS_LIMBS>, exponent_bits: u32, ) -> Self
Raises to the exponent power,
with exponent_bits representing the number of (least significant) bits
to take into account for the exponent.
NOTE: exponent_bits may be leaked in the time pattern.
Sourcepub const fn pow_vartime<const RHS_LIMBS: usize>(
&self,
exponent: &Uint<RHS_LIMBS>,
) -> Self
pub const fn pow_vartime<const RHS_LIMBS: usize>( &self, exponent: &Uint<RHS_LIMBS>, ) -> Self
Raises to the exponent power.
This method is variable time in exponent.
Sourcepub fn pow_amm(&self, exponent: &Uint<LIMBS>) -> Self
pub fn pow_amm(&self, exponent: &Uint<LIMBS>) -> Self
Raises to the exponent power using Almost Montgomery Multiplication (AMM).
Sourcepub fn pow_amm_bounded_exp(
&self,
exponent: &Uint<LIMBS>,
exponent_bits: u32,
) -> Self
pub fn pow_amm_bounded_exp( &self, exponent: &Uint<LIMBS>, exponent_bits: u32, ) -> Self
Raises to the exponent power using Almost Montgomery Multiplication (AMM)
with exponent_bits representing the number of (least significant) bits
to take into account for the exponent.
NOTE: exponent_bits may be leaked in the time pattern.
Source§impl<const LIMBS: usize, MOD> ConstMontyForm<MOD, LIMBS>where
MOD: ConstPrimeMontyParams<LIMBS>,
impl<const LIMBS: usize, MOD> ConstMontyForm<MOD, LIMBS>where
MOD: ConstPrimeMontyParams<LIMBS>,
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstMontyForm<MOD, LIMBS>
Sourcepub const fn new(integer: &Uint<LIMBS>) -> Self
pub const fn new(integer: &Uint<LIMBS>) -> Self
Instantiates a new ConstMontyForm that represents this integer mod MOD.
Sourcepub const fn retrieve(&self) -> Uint<LIMBS>
pub const fn retrieve(&self) -> Uint<LIMBS>
Retrieves the integer currently encoded in this ConstMontyForm, guaranteed to be reduced.
Sourcepub const fn as_montgomery(&self) -> &Uint<LIMBS>
pub const fn as_montgomery(&self) -> &Uint<LIMBS>
Access the ConstMontyForm value in Montgomery form.
Sourcepub fn as_montgomery_mut(&mut self) -> &mut Uint<LIMBS>
pub fn as_montgomery_mut(&mut self) -> &mut Uint<LIMBS>
Mutably access the ConstMontyForm value in Montgomery form.
Sourcepub const fn from_montgomery(integer: Uint<LIMBS>) -> Self
pub const fn from_montgomery(integer: Uint<LIMBS>) -> Self
Create a ConstMontyForm from a value in Montgomery form.
Sourcepub const fn to_montgomery(&self) -> Uint<LIMBS>
pub const fn to_montgomery(&self) -> Uint<LIMBS>
Extract the value from the ConstMontyForm in Montgomery form.
Trait Implementations§
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Add<&ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Add<&ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
+ operator.Source§fn add(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn add(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
+ operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Add<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Add<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
+ operator.Source§fn add(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn add(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
+ operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Add<ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Add<ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
+ operator.Source§fn add(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn add(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
+ operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Add for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Add for ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
+ operator.Source§fn add(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn add(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
+ operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> AddAssign<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> AddAssign<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
+= operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> AddAssign for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> AddAssign for ConstMontyForm<MOD, LIMBS>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<MOD: Clone + ConstMontyParams<LIMBS>, const LIMBS: usize> Clone for ConstMontyForm<MOD, LIMBS>
impl<MOD: Clone + ConstMontyParams<LIMBS>, const LIMBS: usize> Clone for ConstMontyForm<MOD, LIMBS>
Source§fn clone(&self) -> ConstMontyForm<MOD, LIMBS>
fn clone(&self) -> ConstMontyForm<MOD, LIMBS>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<MOD, const LIMBS: usize> ConditionallySelectable for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS> + Copy,
Available on crate feature subtle only.
impl<MOD, const LIMBS: usize> ConditionallySelectable for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS> + Copy,
subtle only.Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstOne for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstOne for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstZero for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> ConstZero for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD, const LIMBS: usize> ConstantTimeEq for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
Available on crate feature subtle only.
impl<MOD, const LIMBS: usize> ConstantTimeEq for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
subtle only.Source§impl<MOD, const LIMBS: usize> CtAssign for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
impl<MOD, const LIMBS: usize> CtAssign for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
Source§impl<MOD, const LIMBS: usize> CtAssignSlice for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
impl<MOD, const LIMBS: usize> CtAssignSlice for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
Source§fn ct_assign_slice(dst: &mut [Self], src: &[Self], choice: Choice)
fn ct_assign_slice(dst: &mut [Self], src: &[Self], choice: Choice)
Source§impl<MOD, const LIMBS: usize> CtEq for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
impl<MOD, const LIMBS: usize> CtEq for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
Source§impl<MOD, const LIMBS: usize> CtEqSlice for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
impl<MOD, const LIMBS: usize> CtEqSlice for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
Source§fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice
fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice
a is equal to b in constant-time.Source§fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice
fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice
a is NOT equal to b in constant-time.Source§impl<MOD: Debug + ConstMontyParams<LIMBS>, const LIMBS: usize> Debug for ConstMontyForm<MOD, LIMBS>
impl<MOD: Debug + ConstMontyParams<LIMBS>, const LIMBS: usize> Debug for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Default for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Default for ConstMontyForm<MOD, LIMBS>
Source§impl<'de, MOD, const LIMBS: usize> Deserialize<'de> for ConstMontyForm<MOD, LIMBS>
Available on crate feature serde only.
impl<'de, MOD, const LIMBS: usize> Deserialize<'de> for ConstMontyForm<MOD, LIMBS>
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl<const LIMBS: usize, P: ConstMontyParams<LIMBS>> From<&ConstMontyForm<P, LIMBS>> for FixedMontyForm<LIMBS>
impl<const LIMBS: usize, P: ConstMontyParams<LIMBS>> From<&ConstMontyForm<P, LIMBS>> for FixedMontyForm<LIMBS>
Source§fn from(const_monty_form: &ConstMontyForm<P, LIMBS>) -> Self
fn from(const_monty_form: &ConstMontyForm<P, LIMBS>) -> Self
Source§impl<const LIMBS: usize, Params> From<&ConstMontyForm<Params, LIMBS>> for BoxedMontyFormwhere
Params: ConstMontyParams<LIMBS>,
Available on crate feature alloc only.
impl<const LIMBS: usize, Params> From<&ConstMontyForm<Params, LIMBS>> for BoxedMontyFormwhere
Params: ConstMontyParams<LIMBS>,
alloc only.Source§fn from(input: &ConstMontyForm<Params, LIMBS>) -> Self
fn from(input: &ConstMontyForm<Params, LIMBS>) -> Self
Source§impl<const LIMBS: usize, Params> From<ConstMontyForm<Params, LIMBS>> for BoxedMontyFormwhere
Params: ConstMontyParams<LIMBS>,
Available on crate feature alloc only.
impl<const LIMBS: usize, Params> From<ConstMontyForm<Params, LIMBS>> for BoxedMontyFormwhere
Params: ConstMontyParams<LIMBS>,
alloc only.Source§fn from(input: ConstMontyForm<Params, LIMBS>) -> Self
fn from(input: ConstMontyForm<Params, LIMBS>) -> Self
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Invert for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Invert for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Mul<&ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Mul<&ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
* operator.Source§fn mul(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn mul(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
* operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Mul<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Mul<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
* operator.Source§fn mul(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn mul(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
* operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Mul<ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Mul<ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
* operator.Source§fn mul(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn mul(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
* operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Mul for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Mul for ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
* operator.Source§fn mul(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn mul(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
* operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> MulAssign<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> MulAssign<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
Source§fn mul_assign(&mut self, rhs: &ConstMontyForm<MOD, LIMBS>)
fn mul_assign(&mut self, rhs: &ConstMontyForm<MOD, LIMBS>)
*= operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> MulAssign for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> MulAssign for ConstMontyForm<MOD, LIMBS>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(ConstMontyForm<MOD, LIMBS>, Uint<RHS_LIMBS>)]> for ConstMontyForm<MOD, LIMBS>
Available on crate feature alloc only.
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(ConstMontyForm<MOD, LIMBS>, Uint<RHS_LIMBS>)]> for ConstMontyForm<MOD, LIMBS>
alloc only.Source§fn multi_exponentiate_bounded_exp(
bases_and_exponents: &[(Self, Uint<RHS_LIMBS>)],
exponent_bits: u32,
) -> Self
fn multi_exponentiate_bounded_exp( bases_and_exponents: &[(Self, Uint<RHS_LIMBS>)], exponent_bits: u32, ) -> Self
x1 ^ k1 * ... * xn ^ kn.Source§impl<const N: usize, MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(ConstMontyForm<MOD, LIMBS>, Uint<RHS_LIMBS>); N]> for ConstMontyForm<MOD, LIMBS>
impl<const N: usize, MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(ConstMontyForm<MOD, LIMBS>, Uint<RHS_LIMBS>); N]> for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Neg for &ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Neg for &ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
- operator.Source§fn neg(self) -> ConstMontyForm<MOD, LIMBS>
fn neg(self) -> ConstMontyForm<MOD, LIMBS>
- operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Neg for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Neg for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> One for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> One for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> One for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> One for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: PartialEq + ConstMontyParams<LIMBS>, const LIMBS: usize> PartialEq for ConstMontyForm<MOD, LIMBS>
impl<MOD: PartialEq + ConstMontyParams<LIMBS>, const LIMBS: usize> PartialEq for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD, const LIMBS: usize> Random for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
Available on crate feature rand_core only.
impl<MOD, const LIMBS: usize> Random for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
rand_core only.Source§fn try_random_from_rng<R: TryRng + ?Sized>(
rng: &mut R,
) -> Result<Self, R::Error>
fn try_random_from_rng<R: TryRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>
Source§impl<const LIMBS: usize, MOD> Reduce<Uint<LIMBS>> for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
impl<const LIMBS: usize, MOD> Reduce<Uint<LIMBS>> for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Retrieve for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Retrieve for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD, const LIMBS: usize> Serialize for ConstMontyForm<MOD, LIMBS>
Available on crate feature serde only.
impl<MOD, const LIMBS: usize> Serialize for ConstMontyForm<MOD, LIMBS>
serde only.Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Square for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Square for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Sub<&ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Sub<&ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
- operator.Source§fn sub(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn sub(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
- operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Sub<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Sub<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
- operator.Source§fn sub(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn sub(self, rhs: &ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
- operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Sub<ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Sub<ConstMontyForm<MOD, LIMBS>> for &ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
- operator.Source§fn sub(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn sub(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
- operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Sub for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Sub for ConstMontyForm<MOD, LIMBS>
Source§type Output = ConstMontyForm<MOD, LIMBS>
type Output = ConstMontyForm<MOD, LIMBS>
- operator.Source§fn sub(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
fn sub(self, rhs: ConstMontyForm<MOD, LIMBS>) -> ConstMontyForm<MOD, LIMBS>
- operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> SubAssign<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> SubAssign<&ConstMontyForm<MOD, LIMBS>> for ConstMontyForm<MOD, LIMBS>
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
-= operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> SubAssign for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> SubAssign for ConstMontyForm<MOD, LIMBS>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreSource§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Zero for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Zero for ConstMontyForm<MOD, LIMBS>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Zero for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> Zero for ConstMontyForm<MOD, LIMBS>
impl<MOD: Copy + ConstMontyParams<LIMBS>, const LIMBS: usize> Copy for ConstMontyForm<MOD, LIMBS>
impl<MOD, const LIMBS: usize> CtSelectUsingCtAssign for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> DefaultIsZeroes for ConstMontyForm<MOD, LIMBS>
zeroize only.impl<MOD: Eq + ConstMontyParams<LIMBS>, const LIMBS: usize> Eq for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> StructuralPartialEq for ConstMontyForm<MOD, LIMBS>
Auto Trait Implementations§
impl<MOD, const LIMBS: usize> Freeze for ConstMontyForm<MOD, LIMBS>
impl<MOD, const LIMBS: usize> RefUnwindSafe for ConstMontyForm<MOD, LIMBS>where
MOD: RefUnwindSafe,
impl<MOD, const LIMBS: usize> Send for ConstMontyForm<MOD, LIMBS>
impl<MOD, const LIMBS: usize> Sync for ConstMontyForm<MOD, LIMBS>
impl<MOD, const LIMBS: usize> Unpin for ConstMontyForm<MOD, LIMBS>where
MOD: Unpin,
impl<MOD, const LIMBS: usize> UnsafeUnpin for ConstMontyForm<MOD, LIMBS>
impl<MOD, const LIMBS: usize> UnwindSafe for ConstMontyForm<MOD, LIMBS>where
MOD: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ConditionallyNegatable for T
impl<T> ConditionallyNegatable for T
Source§fn conditional_negate(&mut self, choice: Choice)
fn conditional_negate(&mut self, choice: Choice)
Source§impl<T> CtSelect for Twhere
T: CtSelectUsingCtAssign,
impl<T> CtSelect for Twhere
T: CtSelectUsingCtAssign,
Source§impl<T, const N: usize> CtSelectArray<N> for T
impl<T, const N: usize> CtSelectArray<N> for T
Source§impl<T, Exponent, BasesAndExponents> MultiExponentiate<Exponent, BasesAndExponents> for Twhere
T: MultiExponentiateBoundedExp<Exponent, BasesAndExponents>,
Exponent: Bounded,
BasesAndExponents: AsRef<[(T, Exponent)]> + ?Sized,
impl<T, Exponent, BasesAndExponents> MultiExponentiate<Exponent, BasesAndExponents> for Twhere
T: MultiExponentiateBoundedExp<Exponent, BasesAndExponents>,
Exponent: Bounded,
BasesAndExponents: AsRef<[(T, Exponent)]> + ?Sized,
Source§fn multi_exponentiate(bases_and_exponents: &BasesAndExponents) -> T
fn multi_exponentiate(bases_and_exponents: &BasesAndExponents) -> T
x1 ^ k1 * ... * xn ^ kn.