pub trait MultiExponentiateBoundedExp<Exponent, BasesAndExponents>: Pow<Exponent> + Sizedwhere
BasesAndExponents: AsRef<[(Self, Exponent)]> + ?Sized,{
// Required method
fn multi_exponentiate_bounded_exp(
bases_and_exponents: &BasesAndExponents,
exponent_bits: usize
) -> Self;
}
Expand description
Performs modular multi-exponentiation using Montgomery’s ladder.
exponent_bits
represents the number of bits to take into account for the exponent.
See: Straus, E. G. Problems and solutions: Addition chains of vectors. American Mathematical Monthly 71 (1964), 806–808.
NOTE: this value is leaked in the time pattern.
Required Methods§
sourcefn multi_exponentiate_bounded_exp(
bases_and_exponents: &BasesAndExponents,
exponent_bits: usize
) -> Self
fn multi_exponentiate_bounded_exp( bases_and_exponents: &BasesAndExponents, exponent_bits: usize ) -> Self
Calculates x1 ^ k1 * ... * xn ^ kn
.
Object Safety§
This trait is not object safe.
Implementors§
impl<MOD: ResidueParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(Residue<MOD, LIMBS>, Uint<RHS_LIMBS>)]> for Residue<MOD, LIMBS>
Available on crate feature
alloc
only.impl<const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(DynResidue<LIMBS>, Uint<RHS_LIMBS>)]> for DynResidue<LIMBS>
Available on crate feature
alloc
only.