Releases: symbolicsoft/hpke-ng
Releases · symbolicsoft/hpke-ng
hpke-ng v0.1.0
- Breaking:
Contextis split into one-directionalSenderContextandReceiverContext.setup_sender_*now returnsSenderContext(exposesseal+export);setup_receiver_*returnsReceiverContext(exposesopen+export). Neither implementsClone. A sender and the matching receiver derive the identical(key, base_nonce), so a single type that could both seal and open made using one session in both directions a catastrophic AEAD(key, nonce)reuse — the split turns that misuse into a compile error. For a bidirectional channel, run a separate HPKE setup per direction or derive independent per-direction keys viaexport(RFC 9180 §9.8). - New
HpkeError::InvalidKeyMaterialvariant. ML-KEM-768/1024derive_key_pairrequires exactly 64 bytes of(d, z)seed (draft-connolly-cfrg-hpke-mlkem §3.2); any other IKM length now returnsInvalidKeyMaterialrather than a less specific error. - Internal hardening: the key schedule is split into PSK-free (Base/Auth) and PSK-bearing (PSK/AuthPSK) fast paths selected by sealed
PskFreeMode/PskModemarker tags instead of a rawu8mode byte. Routing a PSK mode through the PSK-free path (or vice versa) is now a compile error. The tags are#[doc(hidden)]and not part of the public API.
hpke-ng v0.1.0-rc.3
- Performance: cache the recipient's serialized public key in
DhPrivateKey<D>so DHdecap/auth_decapskip the per-call base-point scalar multiplication (X25519 decap −41%, P-curve decap proportionally larger). - Performance: cache the expanded
x_wing::DecapsulationKeyinXWingPrivateKey(X-Wing decap −38% — same trick as ML-KEM, previously missed for X-Wing). - Performance: cache the parsed
EncapsulationKeyin PQ public-key wrappers (ML-KEM encap −30% to −37%, X-Wing encap −14%). - Performance:
Aeadtrait now exposes a cachedCipherassociated type built once viaAead::initat key schedule time; AES-GCMContext::sealskips the per-call key schedule + GHash precompute. Sealed trait — no external impact. - Performance:
Kdf::extract/expandaccept piecewise slices (&[&[u8]]) to avoid materialising labeled-IKM/infoVecs. Sealed trait — no external impact. - Across 62 head-to-head benchmarks vs
hpke-rs, hpke-ng now wins 43 (was 27), ties 14, loses 5 — losses are all onderive_key_pair/generatepaths the one-time cost paid for the per-call decap/encap savings.
hpke-ng v0.1.0-rc.2
- Expose
sk_to_byteswhich serializes a private key to bytes (zeroized on drop).
hpke-ng v0.1.0-rc.1
- First release candidate. Read the announcement: https://symbolic.software/blog/2026-05-08-hpke-ng/