Function ring::arithmetic::bigint::elem_exp_vartime

source ยท
pub(crate) fn elem_exp_vartime<M>(
    base: Elem<M, R>,
    exponent: NonZeroU64,
    m: &Modulus<'_, M>,
) -> Elem<M, R>
Expand description

Calculates base**exponent (mod m).

The run time is a function of the number of limbs in m and the bit length and Hamming Weight of exponent. The bounds on m are pretty obvious but the bounds on exponent are less obvious. Callers should document the bounds they place on the maximum value and maximum Hamming weight of exponent.