scalable_rbe/lib.rs
1// Copyright 2026 Jan Niklas Siemer
2//
3// This file is part of scalable_rbe.
4//
5// scalable_rbe is free software: you can redistribute it and/or modify it under
6// the terms of the Mozilla Public License Version 2.0 as published by the
7// Mozilla Foundation. See <https://mozilla.org/en-US/MPL/2.0/>.
8
9//! # Prototype of 'Scalable Registration-Based Encryption from Lattices'
10//! This library contains a prototype of a Registration-Based Encryption (RBE) scheme.
11//! The post-quantum security of the implemented construction is based
12//! on the standard Learning with Errors assumption.
13//! The analysis enables several tweaks to significantly reduce ciphertext
14//! sizes in practical deployments. These can be achieved via small extensions of this prototype.
15//!
16//! The only operation that is not implemented by this prototype is the merge of two
17//! SIS-trees. Instead of adding public keys of identities into trees blindly, we
18//! insert them with the expected layout in our benchmarks.
19//!
20//! The layout of the library should provide an API that allows for quick and easy experiments.
21//! Thus, several fields and algorithms are `public`, which should not be public in a real application.
22//!
23//! **WARNING:** This is a prototype. It should not be deployed in real applications.
24//! More specifically, it does not provide constant-time security.
25//!
26//! ## External Libraries / Crates
27//! The implementation of this library makes use of Zama's [`concrete_ntt`] crate,
28//! which supports hardware accelerated NTT transforms and multiplication if `AVX2` or `AVX512`
29//! is supported (using the nightly toolchain for the latter).
30//! Furthermore, it uses the crates [`rand`] and [`rand_distr`] to generate 'cryptographically
31//! secure' randomness.
32//! We use the key-value database [`sled`] to store vectors in the registry and [`rayon`] to
33//! enable multi-threading in [`rbe::RBE::enc`].
34//! All benchmarks can be found in the directory `benches` and we rely on [`criterion`] to
35//! benchmark the implementation.
36
37pub mod dgs;
38pub mod mat;
39pub mod ntt;
40pub mod rbe;
41pub mod utils;