Pre-computes a Barrett factor with which modular multiplication can be performed more efficiently.
More...
#include <number-theory.hpp>
|
| MultiplyFactor ()=default |
|
| MultiplyFactor (uint64_t operand, uint64_t bit_shift, uint64_t modulus) |
| Computes and stores the Barrett factor floor((operand << bit_shift) / modulus). This is useful when modular multiplication of the form (x * operand) mod modulus is performed with same modulus and operand several times. Note, passing operand=1 can be used to pre-compute a Barrett factor for multiplications of the form (x * y) mod modulus, where only the modulus is re-used across calls to modular multiplication. More...
|
|
uint64_t | BarrettFactor () const |
| Returns the pre-computed Barrett factor. More...
|
|
uint64_t | Operand () const |
| Returns the operand corresponding to the Barrett factor. More...
|
|
Pre-computes a Barrett factor with which modular multiplication can be performed more efficiently.
◆ MultiplyFactor() [1/2]
intel::hexl::MultiplyFactor::MultiplyFactor |
( |
| ) |
|
|
default |
◆ MultiplyFactor() [2/2]
intel::hexl::MultiplyFactor::MultiplyFactor |
( |
uint64_t |
operand, |
|
|
uint64_t |
bit_shift, |
|
|
uint64_t |
modulus |
|
) |
| |
|
inline |
Computes and stores the Barrett factor floor((operand << bit_shift) / modulus). This is useful when modular multiplication of the form (x * operand) mod modulus is performed with same modulus and operand several times. Note, passing operand=1 can be used to pre-compute a Barrett factor for multiplications of the form (x * y) mod modulus, where only the modulus is re-used across calls to modular multiplication.
◆ BarrettFactor()
uint64_t intel::hexl::MultiplyFactor::BarrettFactor |
( |
| ) |
const |
|
inline |
Returns the pre-computed Barrett factor.
◆ Operand()
uint64_t intel::hexl::MultiplyFactor::Operand |
( |
| ) |
const |
|
inline |
Returns the operand corresponding to the Barrett factor.
The documentation for this class was generated from the following file: