|
Botan 3.14.1
Crypto and TLS for C&
|
#include <mp_core.h>
Public Member Functions | |
| constexpr W | div_2to1 (W n1, W n0) const |
| constexpr std::pair< W, W > | divmod_2to1_ct (W n1, W n0) const |
| constexpr std::pair< W, W > | divmod_2to1_vartime (W n1, W n0) const |
| constexpr W | mod_2to1 (W n1, W n0) const |
| constexpr W | reciprocal () const |
Static Public Member Functions | |
| static constexpr divide_precomp | setup (W divisor) |
| static constexpr divide_precomp | setup_vartime (W divisor) |
| static constexpr divide_precomp | setup_with_reciprocal (W divisor, W reciprocal) |
Setup for word level division/modulo operations
The general case uses a reciprocal of the normalized divisor, precomputed at construction time, following Algorithm 4 of Möller and Granlund "Improved Division by Invariant Integers" (IEEE Trans. Computers, 2011).
The 2/1 division operations run in constant time with respect to the numerator. The divisor is treated as public; construction and the choice of code path are variable time in it.
|
inlineconstexpr |
Definition at line 770 of file mp_core.h.
References divmod_2to1_vartime().
|
inlineconstexpr |
Definition at line 741 of file mp_core.h.
Referenced by divmod_2to1_vartime().
|
inlineconstexpr |
Definition at line 719 of file mp_core.h.
References divmod_2to1_ct().
Referenced by div_2to1(), and mod_2to1().
|
inlineconstexpr |
|
inlineconstexpr |
Definition at line 709 of file mp_core.h.
Referenced by setup(), setup_vartime(), and setup_with_reciprocal().
|
inlinestaticconstexpr |
Definition at line 695 of file mp_core.h.
References Botan::high_bit(), reciprocal(), and Botan::reciprocal_word_ct().
Referenced by Botan::BigInt::to_dec_string().
|
inlinestaticconstexpr |
Definition at line 687 of file mp_core.h.
References Botan::high_bit(), reciprocal(), and Botan::reciprocal_word().
Referenced by Botan::ct_divide_word(), Botan::ct_mod_word(), Botan::operator%(), and Botan::BigInt::operator%=().
|
inlinestaticconstexpr |
Definition at line 703 of file mp_core.h.
References reciprocal().