Intel HE Acceleration Library for FPGAs
Intel Homomorphic Encryption Acceleration Library for FPGAs, accelerating the modular arithmetic operations used in homomorphic encryption on Intel FPGAs.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hexl-fpga.h
Go to the documentation of this file.
1 // Copyright (C) 2020-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #ifndef __HEXL_FPGA_H__
5 #define __HEXL_FPGA_H__
6 
7 #include <cstdint>
8 
9 namespace intel {
10 namespace hexl {
22 
23 // DyadicMultiply Section
29 void set_worksize_DyadicMultiply(uint64_t ws);
41 void DyadicMultiply(uint64_t* results, const uint64_t* operand1,
42  const uint64_t* operand2, uint64_t n,
43  const uint64_t* moduli, uint64_t n_moduli);
44 
51 
52 // KeySwitch Section
58 void set_worksize_KeySwitch(uint64_t ws);
75 void KeySwitch(uint64_t* result, const uint64_t* t_target_iter_ptr, uint64_t n,
76  uint64_t decomp_modulus_size, uint64_t key_modulus_size,
77  uint64_t rns_modulus_size, uint64_t key_component_count,
78  const uint64_t* moduli, const uint64_t** k_switch_keys,
79  const uint64_t* modswitch_factors,
80  const uint64_t* twiddle_factors = nullptr);
81 
86 bool KeySwitchCompleted();
87 
89 //
90 // WARNING: The following NTT and INTT related APIs are deprecated since
91 // version 1.1. //
92 //
94 // NTT Section
95 
101 [[deprecated]] void _set_worksize_NTT(uint64_t ws);
115 [[deprecated]] void _NTT(uint64_t* operand,
116  const uint64_t* root_of_unity_powers,
117  const uint64_t* precon_root_of_unity_powers,
118  uint64_t coeff_modulus, uint64_t n);
124 [[deprecated]] bool _NTTCompleted();
125 
126 // INTT Section
132 [[deprecated]] void _set_worksize_INTT(uint64_t ws);
133 
150 [[deprecated]] void _INTT(uint64_t* operand,
151  const uint64_t* inv_root_of_unity_powers,
152  const uint64_t* precon_inv_root_of_unity_powers,
153  uint64_t coeff_modulus, uint64_t inv_n,
154  uint64_t inv_n_w, uint64_t n);
155 
161 [[deprecated]] bool _INTTCompleted();
162 
163 } // namespace hexl
164 } // namespace intel
165 
166 #endif
void set_worksize_KeySwitch(uint64_t ws)
Function set_worksize_KeySwitch Reserves software resources for the KeySwitch.
void set_worksize_DyadicMultiply(uint64_t ws)
Function set_worksize_DyadicMultiply Reserves software resources for the multiplication.
void _INTT(uint64_t *operand, const uint64_t *inv_root_of_unity_powers, const uint64_t *precon_inv_root_of_unity_powers, uint64_t coeff_modulus, uint64_t inv_n, uint64_t inv_n_w, uint64_t n)
Function _INTT [[deprecated]] Executes in place the inverse Number Theoretic Transform.
void _NTT(uint64_t *operand, const uint64_t *root_of_unity_powers, const uint64_t *precon_root_of_unity_powers, uint64_t coeff_modulus, uint64_t n)
Function _NTT [[deprecated]] Executes in place the Number Theoretic Transform.
void _set_worksize_INTT(uint64_t ws)
Function _set_worksize_INTT [[deprecated]] Reserves software resources for the inverse Number Theoret...
bool _INTTCompleted()
Function _INTTCompleted [[deprecated]] Executed after the INTT to wrap up the computation No paramete...
void DyadicMultiply(uint64_t *results, const uint64_t *operand1, const uint64_t *operand2, uint64_t n, const uint64_t *moduli, uint64_t n_moduli)
Function DyadicMultiply Executes ciphertext ciphertext multiplication.
void KeySwitch(uint64_t *result, const uint64_t *t_target_iter_ptr, uint64_t n, uint64_t decomp_modulus_size, uint64_t key_modulus_size, uint64_t rns_modulus_size, uint64_t key_component_count, const uint64_t *moduli, const uint64_t **k_switch_keys, const uint64_t *modswitch_factors, const uint64_t *twiddle_factors=nullptr)
Function KeySwitch Executes KeySwitch operation.
void release_FPGA_resources()
Function release_FPGA_resources Called without any parameter, releases the FPGA hardware resources on...
bool KeySwitchCompleted()
Function KeySwitchCompleted Executed after KeySwitch to sync up the outstanding KeySwitch tasks...
bool _NTTCompleted()
Function _NTTCompleted [[deprecated]] Executed after the NTT to wrap up the computation No parameters...
void acquire_FPGA_resources()
Function acquire_FPGA_resources Called without any parameter, reserves the FPGA hardware resources...
void _set_worksize_NTT(uint64_t ws)
Function _set_worksize_NTT [[deprecated]] Reserves software resources for the Number Theoretic Transf...
bool DyadicMultiplyCompleted()
Function DyadicMultiplyCompleted Executed after ciphertext ciphertext multiplication to wrap up the t...