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§
- Lehmer
Matrix - ⚠️ 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.