Skip to content

api all

Nicolas Gama edited this page May 26, 2024 · 1 revision

SPQlios library

The SPQlios library provides fast arithmetic for Fully Homomorphic Encryption, and other lattice constructions that arise in post quantum cryptography.

Namely, it is divided into 4 sections:

  • DFT low-level api: The low-level DFT section support FFT over 64-bit floats, as well as NTT modulo one fixed 120-bit modulus. It is an upgrade of the original spqlios-fft module embedded in the TFHE library since 2016. The DFT section exposes the traditional DFT, inverse DFT and coefficient-wise multiplications in DFT space.
  • VEC_ZNX arithmetic api The VEC_ZNX section exposes fast algebra over vectors of small integer polynomials modulo $X^N+1$. It provides in particular efficient (prepared) vector-matrix products, scalar-vector products, convolution products, and element-wise products. These are operations that naturally occur on gadget-decomposed Ring-LWE coordinates.
  • RNX arithmetic api The RNX section is a simpler variant of VEC_ZNX, to represent single polynomials modulo $X^N+1$ (either over the reals or over the torus) when the coefficient precision fits on 64-bit doubles. The small vector-matrix API of the RNX section is particularly adapted to reproducing the fastest CGGI-based bootstrappings.
  • ZN scalar api The ZN section focuses on vector and matrix algebra over scalars (used by scalar LWE or by scalar key switches, but also in ring-less LWE-based schemes like Frodo, FrodoPIR and SimplePIR).

A high value target for hardware accelerations

SPQlios is more than a library, it is also a good target for hardware developers. On one hand, the arithmetic operations that are defined in the library have a clear standalone mathematical definition. And at the same time, the amount of work in each operation is sufficiently large so that meaningful functions only require a few of these.

This makes the SPQlios API a high value target for hardware acceleration that targets FHE.

SPQLios is not an FHE library, but a huge enabler

SPQlios itself is not an FHE library: there is no ciphertext, plaintext or key. It is a mathematical library that exposes efficient algebra over polynomials. Using the functions exposed, it is possible to quickly build efficient FHE libraries, with support for the main schemes based on Ring-LWE: BFV, BGV, CGGI, DM, CKKS, and switching between those schemes in a Chimera fashion.