Integrating FPGA-based function call with OpenFHE

Hello,

I am using Xilinx Vitis 2022.2 and I have created an application project which includes a function with an interface that can be used by OpenFHE to substitute a build-in function call. This function is launched on a FPGA. Now, I want to subsitute the original OpenFHE function call with my custom-made function. However, having no experience with cmake, I am not sure how I can include my code into OpenFHE. Should I compile my design with Vitis and then use the .o file inside cmake to be build alongside the OpenFHE library? Should I import the OpenFHE library into Vitis and work directly on the library inside the Vitis environment? Should I do it in another way?

Any help will be highly appreciated! Let me know if you need further information.
George

Hi @geoago,

Thank you for your question. Hardware acceleration is enabled in OpenFHE using a Hardware Abstraction Layer interface (you can find some information here: Core Lattice Hardware Abstraction Layer Documentation — OpenFHE documentation). The high-level idea is that some capabilities in core/math and core/lattice have an an abstract interface and support implementation of hardware-specific backends (in separate repositories) to override the default functionality. The Intel HEXL backend is a good example of this setup: GitHub - openfheorg/openfhe-hexl: Intel HEXL library backend for OpenFHE, which uses AVX-512 instructions to accelerate the execution of OpenFHE cryptographic capabilities.

As of v1.0.4, the following math capabilities are included in the HAL in core/math (https://github.com/openfheorg/openfhe-development/tree/v1.0.4/src/core/include/math/hal):

  • integers
  • vectors over finite fields
  • Number Theoretic Transforms

The following math capabilities are included in the HAL in core/lattice (https://github.com/openfheorg/openfhe-development/tree/v1.0.4/src/core/include/lattice/hal):

  • Double-CRT polynomials

In v1.1.0, we will also add regular polynomials (native or multiprecision) to the HAL. This code is already available in the dev branch, and v1.1.0 will be released by the end of July 2023.

Hence the recommended approach is to add a new repository, which would include the FPGA implementation of the capabilities you want to override. Please feel free to directly reach out to me for more details about adding an OpenFHE backend.