Intel HEXL
Intel Homomorphic Encryption Acceleration Library, accelerating the modular arithmetic operations used in homomorphic encryption.
Public Member Functions | List of all members
intel::hexl::NTT Class Reference

Performs negacyclic forward and inverse number-theoretic transform (NTT), commonly used in RLWE cryptography. More...

#include <ntt.hpp>

Public Member Functions

 NTT ()
 Initializes an empty NTT object. More...
 
 ~NTT ()
 Destructs the NTT object. More...
 
 NTT (uint64_t degree, uint64_t p)
 Performs pre-computation necessary for forward and inverse transforms. More...
 
 NTT (uint64_t degree, uint64_t p, uint64_t root_of_unity)
 Initializes an NTT object with degree degree and modulus p. More...
 
void ComputeForward (uint64_t *result, const uint64_t *operand, uint64_t input_mod_factor, uint64_t output_mod_factor)
 Compute forward NTT. Results are bit-reversed. More...
 
void ComputeInverse (uint64_t *result, const uint64_t *operand, uint64_t input_mod_factor, uint64_t output_mod_factor)
 

Detailed Description

Performs negacyclic forward and inverse number-theoretic transform (NTT), commonly used in RLWE cryptography.

The number-theoretic transform (NTT) specializes the discrete Fourier transform (DFT) to the finite field \( \mathbb{Z}_p / (X^N + 1) \).

Constructor & Destructor Documentation

◆ NTT() [1/3]

intel::hexl::NTT::NTT ( )

Initializes an empty NTT object.

◆ ~NTT()

intel::hexl::NTT::~NTT ( )

Destructs the NTT object.

◆ NTT() [2/3]

intel::hexl::NTT::NTT ( uint64_t  degree,
uint64_t  p 
)

Performs pre-computation necessary for forward and inverse transforms.

Initializes an NTT object with degree degree and modulus p.

Parameters
[in]degreea.k.a. N. Size of the NTT transform. Must be a power of 2
[in]pPrime modulus. Must satisfy \( p == 1 \mod 2N \)

◆ NTT() [3/3]

intel::hexl::NTT::NTT ( uint64_t  degree,
uint64_t  p,
uint64_t  root_of_unity 
)

Initializes an NTT object with degree degree and modulus p.

Parameters
[in]degreea.k.a. N. Size of the NTT transform. Must be a power of 2
[in]pPrime modulus. Must satisfy \( p == 1 \mod 2N \)
[in]root_of_unity2N'th root of unity in \( \mathbb{Z_p} \).

Performs pre-computation necessary for forward and inverse transforms

Member Function Documentation

◆ ComputeForward()

void intel::hexl::NTT::ComputeForward ( uint64_t *  result,
const uint64_t *  operand,
uint64_t  input_mod_factor,
uint64_t  output_mod_factor 
)

Compute forward NTT. Results are bit-reversed.

Parameters
[out]resultStores the result
[in]operandData on which to compute the NTT
[in]input_mod_factorAssume input operand are in [0, input_mod_factor * p). Must be 1, 2 or 4.
[in]output_mod_factorReturns output operand in [0, output_mod_factor * p). Must be 1 or 4.

◆ ComputeInverse()

void intel::hexl::NTT::ComputeInverse ( uint64_t *  result,
const uint64_t *  operand,
uint64_t  input_mod_factor,
uint64_t  output_mod_factor 
)

Compute inverse NTT. Results are bit-reversed.

Parameters
[out]resultStores the result
[in]operandData on which to compute the NTT
[in]input_mod_factorAssume input operand are in [0, input_mod_factor * p). Must be 1 or 2.
[in]output_mod_factorReturns output operand in [0, output_mod_factor * p). Must be 1 or 2.

The documentation for this class was generated from the following file: