Overview

hpke-ng is a Rust implementation of Hybrid Public Key Encryption, the cryptographic scheme standardized in RFC 9180 that composes a Key Encapsulation Mechanism (KEM), a Key Derivation Function (KDF), and an Authenticated Encryption with Associated Data (AEAD) cipher into a single, modular construction for public-key encryption of arbitrary-length plaintexts. The design is crypto-agile, in the sense that protocol designers can swap primitives (e.g. X25519 → a post-quantum KEM) without rewriting the surrounding code — which makes HPKE the building block underneath modern protocols like Messaging Layer Security (MLS), TLS Encrypted Client Hello, and the post-quantum extensions to Signal’s X3DH.

Below are the pull requests I have submitted or plan to submit, with links to the diffs and a short note on what each one changes.

Pull Requests

  • #3 (Merged)Refactor authenticated DHKEM paths to eliminate intermediate heap allocation. Replaced the intermediate Vec concatenation in auth_encap / auth_decap / auth_encap_with_ikm with a new extract_and_expand_pieces that accepts DH slices directly, mirroring the pattern already used for kem_context, and added the previously-missing X25519 auth_encap / auth_decap benchmarks.
  • #4 (Merged)Expand test coverage for auth KEM paths and context sequence number boundaries. Added a direct unit test for extract_and_expand_pieces, a KEM-layer auth_encap / auth_decap roundtrip test, and a strengthened boundary test that verifies the last valid seal before MessageLimitReached; also strengthened open_rejects_at_message_limit, added #[inline] to both extract_and_expand variants, and renamed sk_s_authedsk_sender in encap_with.
  • More coming soon!

← Back to Academia


Tags: