RELIC is a modern research-oriented cryptographic meta-toolkit with emphasis on efficiency and flexibility. RELIC can be used to build efficient and usable cryptographic toolkits tailored for specific security levels and algorithmic choices.
RELIC is an ongoing project and features will be added on demand. The focus is to provide:
- Ease of portability and inclusion of architecture-dependent code
- Simple experimentation with alternative implementations
- Tests and benchmarks for every implemented function
- Flexible configuration
- Maximum efficiency
RELIC implements to date:
- Multiple-precision integer arithmetic
- Arithmetic in prime and binary fields and their extensions (prime, binary)
- Elliptic curves over prime and binary fields, including NIST, SECG and pairing-friendly curves (BN, BLS12, BLS24, BLS48, KSS), and Edwards curves
- Pairings for embedding degrees from 1 to 54, with an interface for pairing-based protocols
- Hash functions, the AES block cipher and random number generators
- Secret sharing and triples for multi-party computation
- Cryptographic protocols:
- Encryption: RSA, ECIES, Boneh-Franklin IBE, and homomorphic encryption by Paillier, Damgård-Jurik and Boneh-Goh-Nissim
- Signatures: RSA, ECDSA, Schnorr, BLS, Camenisch-Lysyanskaya, Pointcheval-Sanders, linearly homomorphic and threshold ring signatures
- Key agreement: ECDH, ECMQV and Sakai-Ohgishi-Kasahara
- Others: zero-knowledge proofs, private set intersection, an oblivious pseudorandom function and pairing delegation
Instructions for building the library can be found in the Wiki.
To reduce code size, configure with -DSTRIP=on. This compiles the library with -ffunction-sections -fdata-sections and drops precomputed tables of algorithms that were not selected. Unused functions are then removed at link time, which only happens for static linking: applications linking against librelic_s.a must pass -Wl,--gc-sections (or -Wl,-dead_strip on macOS, /OPT:REF with MSVC) to their own linker. The shared library is not reduced.
You can probably get some help over the official mailing list at relic-discuss@googlegroups.com
If you like the library, please consider supporting development through Paypal. If you use our work in your research, please cite as
@misc{relic-toolkit,
author = {D. F. Aranha and C. P. L. Gouvêa and T. Markmann and R. S. Wahby and K. Liao},
title = {{RELIC is an Efficient LIbrary for Cryptography}},
howpublished = {\url{https://github.com/relic-toolkit/relic}},
}
This work is dual-licensed under Apache 2.0 and LGPL 2.1-or-above to encourage collaboration with other research groups and contributions from the industry. You can choose between one of them if you use this work.
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1
Starting from version 0.3.3, static linking and changes in the configuration or build system are explicitly exempted from representing derived works. Please refer to the LICENSE files for additional details.
RELIC is at best alpha-quality software. Implementations may not be correct or secure and may include patented algorithms. There are many configuration options which make the library horribly insecure. Backward API compatibility with early versions may not necessarily be maintained. Side-channel and fault injection attacks are not considered in particular, unless it is explicitly noted. Use at your own risk.

