pub unsafe extern "C" fn Hacl_Bignum64_mod_exp_consttime(
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.
This function is constant-time over its argument b, at the cost of a slower execution time than mod_exp_vartime.
The function returns false if any of the following preconditions are violated, true otherwise. • n % 2 = 1 • 1 < n • b < pow2 bBits • a < n