Skip to content

Beryl v0.1.0

Choose a tag to compare

@crimson-knight crimson-knight released this 24 Nov 19:22
· 142 commits to main since this release
2c56823

The first release: cryptography for Amber V2 in pure Crystal. A program
that uses Beryl links no OpenSSL. TLS is not in this release.

  • Hashes and MACs (#1): SHA-224, SHA-256, SHA-384, SHA-512,
    SHA-512/256, HMAC and HKDF; MD5, SHA-1 and PBKDF2 for existing formats.
    On the processor's SHA instructions where it has them (#3).
  • Ciphers and AEADs (#2): XChaCha20-Poly1305, ChaCha20-Poly1305 and
    AES-GCM; AES-CBC for existing formats. On the processor's cipher
    instructions where it has them (#4).
  • Public key (#6, #7): X25519, Ed25519, P-256 ECDSA (RFC 6979 nonces)
    and ECDH, P-384 ECDSA verification, and RSA (PKCS #1 v1.5 and PSS
    signatures, OAEP encryption, 2,048 to 4,096-bit private keys). Field
    arithmetic follows fiat-crypto's output, with assembly on arm64 and
    x86-64 (#11, #13, #14, #15).
  • Certificates (#10): X.509 parsing and path validation
    (Beryl::Certificates.verify_server_chain).
  • Timing: on Arm every operation on a secret runs with Data Independent
    Timing on (#9); on x86-64 the curve multiplications take fresh operands
    in every window, gated by a two-of-three timing check in CI (#18).
  • One API that picks the algorithm: Beryl::Crypto uses the algorithm
    Beryl recommends today, Beryl::Crypto::V1 names each one, and
    Beryl::Crypto::Compatibility holds the old ones existing formats need.
  • Vendoring: rooted ::Beryl:: references move under the host's
    namespace when Beryl is vendored (#5).
  • Speed against OpenSSL, measured per operation, is in the README and
    docs/ (#8, #12, #17).
  • Beryl::VERSION reads 0.1.0.

Checks at the tagged commit

Release PR #20 (no code changes) on GitHub Actions, run 45465280680: 15 jobs green (specs, published vectors and the no-OpenSSL linkage proof; differentials against libcrypto on ubuntu-24.04 and ubuntu-24.04-arm; Valgrind and compiled-code constant-time checks; timing checks for HMAC, the ciphers, the curves and RSA at 2,048, 3,072 and 4,096 bits; Linux on AArch64). The merge commit has the same tree as the tested head.

Commit:          2c56823597f43e624317f55eb4d6822cc538cb71
Tree:            49f451dc737f07f7979c2bb433085ffdc21e04e4
Tarball:         beryl-0.1.0.tar.gz (git archive --format=tar.gz --prefix=beryl-0.1.0/ v0.1.0)
Tarball sha256:  0dbcd1e9a31f65ad33d723c5a3411dfc30828c9b5672cdf3eef38194f5c3d5a6