HEbase#

HEbase is the lower layer of HElayers, it contains abstract interfaces that can wrap an underlying HE library, providing a uniform API to access different libraries, thus allowing to write library agnostic and scheme-oblivious code (as much as possible).

Abstracting of multiple libraries and schemes#

Most HE computations are basically a series of additions, multiplications and rotations, supported by all underlying HE libraries. Hence most of the code written in HElayers will be library and scheme agnostic. However, some libraries and schemes offer unique functionalities that can be exploited for specific use cases. The HElayers SDK API provides all the functionality of the supported schemes and libraries, to maximize the use of each to its fullest extent.

To maintain scheme and library abstraction as much as possible, the following steps are taken:

  • HELayers attempts to compensate internally for missing functionality where possible. E.g., the “power” operator is directed to the library’s native power operator if it exists, or otherwise a generic algorithm inside helayers for evaluation of powers using multiplication is used.

  • A “traits” class HeTraits can be queried by the user to detect which functionality is supported by the underlying library. The user can use this information in one of two ways:

    • Assert that mandatory functions are present. This will provide immediate clear diagnostics, if choice of library and scheme mismatches required computation.

    • Condition on underlying traits, to choose one algorithm or another based on available functionality. This will take advantage of useful functionality where available, while maintaining general library and scheme obliviousness.

Main classes:#

Class name

Description

HeContext

The main access point to the underlying cryptographic library. Initialized during startup to a specific library and scheme. Most other classes receive a reference to it in their constructors.

HeTraits

A list of flags indicating the available functionality of the underlying library and scheme: floating point numbers, complex numbers, the bootstrapping operation, bitwise manipulation, automatic rescaling, and others. This class can be used in asserts to make sure the chosen library and scheme provides a minimal set of requirements for a given computation. Or, different algorithm choices can be made based on these traits.

CTile

A ciphertext object. Supports basic operators such as add, multiply, rotate, and others.

Encoder

A class for performing encryption, decryption, encode, and decode.

Debugging and Researching

See Debug Contexts to learn more about the debug and research capabilities of FHE applications that are available at the HEbase level.