Repository navigation
This release brings new protocols and curves, faster arithmetic across the
library, a large internal refactoring onto templates, and many security and
correctness fixes. Some configuration options and APIs changed, so please read
Breaking changes before upgrading.
Breaking changes
- Configuration names are prefixed. The global configuration symbols in
relic_conf.hand their values now carry theRLC_prefix (for example
RLC_WSIZE,RLC_ARCH,RLC_SEED), and other public symbols were renamed
to avoid clashes with other libraries.SEED=ZEROis nowSEED=NONE.
tools/relic-rename-conf.pymigrates existing code and build scripts. - Removed options and algorithms that were slower or no longer useful:
EP_MIXED,EB_MIXED,ED_MIXED,BN_MAGNI(now alwaysDOUBLE), the
SLIDEscalar multiplication in EC,FP_RDC=PMERS,BN_MOD=PMERS,
BN_GEN,RAND=RDRND(useSEED=RDRNDto seed HASH-DRBG),SEED=LIBC,
the GOST functions, the variable-time binary-field inversions, big-endian
support and the per-curve toggles in EP. STRIPnow only removes stored data (tables and constants) instead of
guarding code paths.CHECK=offstill reports errors: error codes are set, only the
expensive checks are skipped.- API changes: serialization functions return integer error codes; EC
hashing takes a domain separation tag; the RSA API was reworked with
per-call padding; the MKLHS, ERS/SMLERS, ETRS and ECIES APIs changed to
follow their papers more closely. - New defaults: JMPDS for prime field inversion, Lehmer's algorithm for
integer GCD (6-12x faster than the previous default), and cyclotomic
squaring for G_T.
Security fixes
- The portable (
easy) backend computed carries with short-circuit operators
that compilers turn into secret-dependent branches; they are now
branch-free. - Out-of-bounds writes in
bn_read_str/bn_read_rawand in MKLHS
verification with an empty input, and missing validation of ciphertext
points in Boneh-Goh-Nissim decryption (thanks to Andria Sax). - An out-of-bounds pointer when padding the last AES-CBC block.
- Corner cases in several protocols that could lead to forgeries, memory
safety fixes across the protocols, RSA padding bugs, and ECDSA hashing
messages twice. - An overflow reported in #318, and an unbounded Pippenger window (#322).
- Branch-prediction leaks in variable-time code paths, and a constant-time
Montgomery ladder with thegmp-secbackend.
New features
- Protocols: the AmorE family of pairing delegation protocols, batch
delegation (MV), aggregate BLS signatures, Pedersen commitments, a simple
OPRF, deterministic ECDSA (RFC 6979), OAEP+ for RSA and a stronger BDN
variant of BLS against rogue keys. - Curves: Ed448 and E-521 (closes #105), the SS3 supersingular curves
with a symmetric pairing, complete support for SG54 with E(Fp^9), and a
preset for GMT8-544. - Pairings: pairings and multi-pairings with a fixed argument in G_2
(pp_map_sim_fix,pc_map_sim_fix,PC_PRECO), used by the protocols,
and Tate pairings for more curves. - Hashing and randomness: SHA-3 and SHAKE,
expand_message_xmdover all
hash functions, XOFs, and HMAC-DRBG (RAND=HMACD). - Arithmetic: Pippenger's multi-scalar multiplication in all curve
modules, constant-time fixed-base multiplication in EPX and EB, constant-time
GLV and Frobenius decompositions, point tripling, cube roots in Fp2, Lucas
sequences, fused multiply-add/sub in BN,bn_next_prime,bn_set_int, and
sieve-based generation of strong and safe primes and Cunningham chains.
Performance
- Assembly backends for x64 from 4 to 12 limbs, now generated by
tools/relic-gen-x64.pyand checked bytools/relic-check-fp.c, with new
11- and 12-limb backends and faster 5-, 8- and 9-limb ones. - Faster inversion (Pornin's binary GCD), faster Legendre symbol, faster
subgroup membership testing in G_1 (thanks to Yu Dai), faster Frobenius
maps, cyclotomic cubing, lazy-reduced sparse multiplication in Fp24 and
Fp48, and G_T exponentiation that skips work on the identity. - Regular GLV scalar multiplication with techniques from a recent paper, and
shared inversions when normalizing precomputed tables.
Build and portability
- Shared and static libraries can be built together, and RELIC can be used as
a CMake subproject without name clashes (closes #207). - CMake respects user flags and
LDFLAGS, validates options, fails early when
GMP is missing, and no longer requires a C++ compiler. - Fixes for MSVC, MinGW, 32-bit x86, ARM Cortex-M4 (thanks to Kobi Brener),
AVR and MSP430, and many fixes to the ARM, GMP, HACL* and Fiat-Crypto
backends.
Internals
- The extension field, curve and pairing modules were refactored onto shared
templates, removing thousands of lines of duplicated code, with much wider
test coverage and many bug fixes found along the way.
Contributors
Thanks to Andria Sax, Kobi Brener, Kaz Kobara and Krzysztof Cabaj for their
contributions, and to everyone who reported issues.