Module algorithms

Expand description

⚠️ Collection of bignum algorithms.

Warning. Most functions in this module are currently not considered part of the stable API and may be changed or removed in future minor releases.

Modules§

div
⚠️ Collection of division algorithms.

Structs§

LehmerMatrix
⚠️ Lehmer update matrix

Functions§

adc
adc_n
lhs += rhs + carry
add_nx1
Computes lhs += a and returns the carry.
addmul
⚠️ Computes result += a * b and checks for overflow.
addmul_n
Computes wrapping lhs += a * b when all arguments are the same length.
addmul_nx1
Computes lhs += a * b and returns the carry.
borrowing_sub
carrying_add
cmp
Compare two u64 slices in reverse order.
div
⚠️ Division with remainder.
gcd
⚠️ Lehmer’s GCD algorithms.
gcd_extended
⚠️ Lehmer’s extended GCD.
inv_mod
⚠️ Modular inversion using extended GCD.
mul_nx1
Computes lhs *= a and returns the carry.
mul_redc
Computes a * b * 2^(-BITS) mod modulus
sbb
sbb_n
lhs -= rhs - borrow
shift_left_small
shift_right_small
square_redc
Computes a^2 * 2^(-BITS) mod modulus
submul_nx1
Computes lhs -= a * b and returns the borrow.