The RBC library provides data structures and algorithms to perform code-based cryptography in the rank metric setting. It also provides implementations of various rank-based cryptosystems. The RBC library focuses on high performances without sacrificing usability. Some functionalities are implemented in a constant-time way whenever relevant for the security of the supported schemes. The RBC library currently only support finite fields of the form F2m.
Architecture. The RBC library relies on a two-step build approach. First, the src/core and build folders are populated during the preprocessing step. Next, the library is generated within the bin folder during the compilation step. The RBC library is organized as follows:
- bin - Files generated during compilation
- build - Files generated during preprocessing
- doc - Documentation of the library
- lib - Third party implementations used
- script - Scripts used for preprocessing and testing
- src/core - Core layer of the library (data structures and arithmetic over F2m)
- src/code - Code layer of the library (LRPC codes and Gabidulin codes)
- src/params - Parameters for the schemes implemented in the library
- src/schemes - Scheme layer of the library (ROLLO and RQC)
- test - Example, KAT, unit test and benchmark files for the library
- config.yml - Configuration file of the library
- doxygen.conf - Documentation configuration file
- license.txt - License file of the library (LGPL)
- rbc-lib.py - Script to execute in order to compile the library
Third-party implementations. The RBC library relies on several cryptographic primitives that are outside the scope of rank-based cryptography such as a PRNG, a seedexpander, SHA2, FIPS202 and AES. Implementations for theses primitives are provided in the lib folder for convenience but are not part of the RBC library. In particular, they are released under their respective licenses ; refer to each implementation for additional details. In addition, the Minunit framework and the MPFQ library are used to provide unit tests against the RBC library.
Requirements. The following softwares and librairies are required: python3 (build), python3-yalm (build), gcc (build) and openssl (runtime, optional). The python command is required to be aliased to python3 in version 3.5 or superior.
Configuration. The RBC library can be parametrized by editing config.yml. The main available options are the following:
- rbc_core_layer_implem: [ref, avx] - Implementation to be used for the core layer. The avx tag generates faster code but requires pclmul and avx support.
- rbc_build_parameters: [rolloI, rolloII, rqc] - Supported schemes along with their security levels (128, 192 or 256) to be included in the library.
- rbc_compile_example: [True, False] - Compilation of the working examples of the schemes included in the library.
- rbc_compile_unit_test: [True, False] - Compilation of the core layer unit tests for the parameters of the schemes included in the library.
- rbc_compile_kat: [True, False] - Compilation of the Known Answer Tests for the schemes included in the library.
- rbc_compile_benchmark: [True, False] - Compilation of benchmarks for the schemes included in the library.
Preprocessing & Compilation. Run python rbc-lib.py to preprocess and compile the RBC library. This should generate a librbc.a archive and an include folder as well as several binaries with respect to the options specified in the config.yml file.
Documentation. The following softwares are required: doxygen, a TeX environment and bibtex. Run doxygen doxygen.conf in order to generate the documentation then browse doc/html/index.html to access it.