Intel HEXL
Intel Homomorphic Encryption Acceleration Library, accelerating the modular arithmetic operations used in homomorphic encryption.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
intel::hexl::MultiplyFactor Class Reference

Pre-computes a Barrett factor with which modular multiplication can be performed more efficiently. More...

#include <number-theory.hpp>

Public Member Functions

 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...
 

Detailed Description

Pre-computes a Barrett factor with which modular multiplication can be performed more efficiently.

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ 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: