Introduction to the qFALL Prototyping Library
by Marvin Beckmann, Phil Milewski, Sven Kilian Moog, Marcel Luca Schmidt, and Jan Niklas Siemer.
This book serves as a technical tutorial and reference guide for working with the qFALL Prototyping Library for Lattice Cryptography.
The library is written in Rust, leveraging its performance and memory safety guarantees. Therefore, we assume the reader has prior experience with the fundamental concepts of Rust. If you are new to the language, we highly recommend reading The Rust Programming Language book first. The qFALL libraries leverage a foreign function interface (FFI) to the highly-optimized C-library FLINT.
The qFALL library is architecturally designed into separate components that ensure modularity, usability, and performance. This documentation will guide you through the following structure:
How to use qFALL in Research
The qFALL prototyping libraries are explicitly designed to accelerate academic and industrial research into lattice-based cryptography. Our central objective is to provide an implementation environment that minimizes friction between theoretical work and practical code. This is achieved through research-close notation (using qFALL-maths’s mathematically intuitive types) and a well-defined collection of building blocks (in qFALL-schemes) that abstract complex primitives like trapdoors and samplers. This modular structure makes it easy to construct cryptographic schemes using high-level components and enables easy, one-by-one replacement of functions (e.g., swapping a reference Gaussian sampler for a highly optimized, constant-time version) without altering the surrounding scheme logic. This flexibility drastically speeds up the prototyping cycle, allowing researchers to rapidly test and benchmark different algorithmic components and parameter sets before fixing a specific optimized algorithm for the final implementation.
How to Use this Book
This book is just starting point, and not an entire reference. It helps you to get some familiarity with qFALL-math, but not with Rust (we advise Rust book for Rust basics).
Book Structure and Content
- Installation and Setup:
- A guide on how to install the required dependencies and add our libraries to your new or existing Rust project.
- The Mathematical Foundation (qFALL-math):
- This section details our lowest-level component. It includes all the arbitrary-precision mathematical features required for lattice-based cryptography, such as integer arithmetic, quotient rings (\(\mathbb{Z}_q\)), and polynomial ring operations. We cover its relationship with the underlying highly-optimized FLINT C library.
- The Cryptographic Tools (qFALL-tools):
- This component acts as the bridge between the foundational math and the schemes. It includes essential cryptographic primitives and interfaces, such as Gadget Trapdoors, algorithms for short basis generation, and the abstracted behavior of Preimage Sampleable Functions (PSFs).
- Cryptographic Schemes (qFALL-schemes):
- This section (often referred to as the crypto-crate) provides an overview of the explicit, high-level cryptographic constructions available, such as signature schemes and encryption algorithms, built using the components from qFALL-math and qFALL-schemes.
- Shared Features:
- A guide to advanced utilities available across the entire library suite, including benchmarking facilities, serialization features, and external interoperability.