pub unsafe extern "C" fn Hacl_Bignum64_mod_exp_vartime(
    len: u32,
    n: *mut u64,
    a: *mut u64,
    bBits: u32,
    b: *mut u64,
    res: *mut u64
) -> bool
Expand description

Write a ^ b mod n in res.

The arguments a, n and the outparam res are meant to be len limbs in size, i.e. uint64_t[len].

The argument b is a bignum of any size, and bBits is an upper bound on the number of significant bits of b. A tighter bound results in faster execution time. When in doubt, the number of bits for the bignum size is always a safe default, e.g. if b is a 4096-bit bignum, bBits should be 4096.

The function is NOT constant-time on the argument b. See the mod_exp_consttime_* functions for constant-time variants.

The function returns false if any of the following preconditions are violated, true otherwise. • n % 2 = 1 • 1 < n • b < pow2 bBits • a < n