Skip to content

RELIC version 0.8.0

Latest

Choose a tag to compare

@dfaranha dfaranha released this 15 Nov 16:06
· 4 commits to main since this release

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.h and their values now carry the RLC_ prefix (for example
    RLC_WSIZE, RLC_ARCH, RLC_SEED), and other public symbols were renamed
    to avoid clashes with other libraries. SEED=ZERO is now SEED=NONE.
    tools/relic-rename-conf.py migrates 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 always DOUBLE), the
    SLIDE scalar multiplication in EC, FP_RDC=PMERS, BN_MOD=PMERS,
    BN_GEN, RAND=RDRND (use SEED=RDRND to seed HASH-DRBG), SEED=LIBC,
    the GOST functions, the variable-time binary-field inversions, big-endian
    support and the per-curve toggles in EP.
  • STRIP now only removes stored data (tables and constants) instead of
    guarding code paths.
  • CHECK=off still 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_raw and 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 the gmp-sec backend.

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_xmd over 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.py and checked by tools/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.