Intel HEXL
Intel Homomorphic Encryption Acceleration Library, accelerating the modular arithmetic operations used in homomorphic encryption.
ntt.hpp
Go to the documentation of this file.
1 // Copyright (C) 2020-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #pragma once
5 
6 #include <stdint.h>
7 
8 #include <memory>
9 #include <vector>
10 
11 namespace intel {
12 namespace hexl {
13 
19 class NTT {
20  public:
22  NTT();
23 
25  ~NTT();
26 
33  NTT(uint64_t degree, uint64_t p);
34 
43  NTT(uint64_t degree, uint64_t p, uint64_t root_of_unity);
44 
52  void ComputeForward(uint64_t* result, const uint64_t* operand,
53  uint64_t input_mod_factor, uint64_t output_mod_factor);
54 
62  void ComputeInverse(uint64_t* result, const uint64_t* operand,
63  uint64_t input_mod_factor, uint64_t output_mod_factor);
64 
65  class NTTImpl;
66 
67  private:
68  std::shared_ptr<NTTImpl> m_impl;
69 };
70 
71 } // namespace hexl
72 } // namespace intel
intel::hexl::NTT::ComputeForward
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.
intel::hexl::NTT::ComputeInverse
void ComputeInverse(uint64_t *result, const uint64_t *operand, uint64_t input_mod_factor, uint64_t output_mod_factor)
intel
Definition: eltwise-add-mod.hpp:8
intel::hexl::NTT::~NTT
~NTT()
Destructs the NTT object.
intel::hexl::NTT
Performs negacyclic forward and inverse number-theoretic transform (NTT), commonly used in RLWE crypt...
Definition: ntt.hpp:19
intel::hexl::NTT::NTT
NTT()
Initializes an empty NTT object.