0.2.0
⚠️ Backwards incompatible changes for 0.1.0
- [
PR-2]derive_context/1now returns{:error, :id_too_long}when a Sender or Recipient ID exceeds 7 bytes, where the NIF previously panicked. Callers that pattern-match only on{:ok, _}for an over-long ID now hit a clean error. - [
PR-2] When a context sets:id_context,protect_requestnow emits thehflag plus the kid context on the wire (RFC 8613 §6.1), andunprotect_requestrejects a mismatch with:unknown_id_context. Default output (no:id_context) is unchanged and still matches the RFC C.4/C.5/C.7 vectors bit for bit.
Bug fixes
- [
PR-2] ID length is now validated atderive_context: IDs longer than the nonce allows (7 bytes) return{:error, :id_too_long}instead of reaching a Rustassert!and panicking inside the NIF. - [
PR-2]id_contextis now wired through end to end. It was derived into the keys but discarded, soprotect_requestcould never emit the kid context andunprotect_requestnever checked it.
Enhancements
- [
PR-2] Sequence-number persistence hook (RFC 8613 Appendix B.1):OSCORE.sender_seq/1reads the Sender Sequence Number counter andderive_context's:sender_seqoption restores it, so the counter can survive a restart and the same AEAD nonce is never reused under the same key. - [
PR-2] Added adebug_assertdocumenting the<= 8-byte invariant inbe_bytes_to_u64.