2 Commits

Author SHA1 Message Date
mnovak 6780abc0c2 fix: QA second review R2-01 to R2-05
R2-01: PublicKey::encapsulate, SecretKey::decapsulate and SharedSecret::as_bytes
are hazmat-only; release consumers reach keys only through exchange and seal.
R2-02: PublicKey::from_bytes refuses a non-canonical X25519 half (bit 255 set,
or a value of at least 2^255 - 19). Honest keys and the draft vectors pass.
R2-03: schedule::expand takes one static label and one fixed-width field, so
its info is injective by signature. v1 bytes unchanged (golden vectors pass).
R2-04: generate, initiate, respond and seal say the RNG must be the OS RNG.
R2-05: Initiation is ZeroizeOnDrop; seal's buffer stays Zeroizing until the
plaintext in it is encrypted, so the MessageTooLong path wipes it.
QA's A-33 case for PublicKey::encapsulate moves to exchange::respond, and its
A-08 test pins the new expand signature to the v1 encoding.
2026-11-25 08:37:11 +01:00
mnovak 3dfc75075f test(qa): second review, A-03/A-06/A-08/A-09/A-18/A-28/A-30/A-31 and R2-02 (non-canonical pk_X)
Completes the partial QA cases and adds the not-done ones that need no new
dependency: compile-time checks that no secret type is Copy, Clone, PartialEq
or Display (A-28, A-31, hand-rolled assert_not_impl), ZeroizeOnDrop markers,
redacted Debug, no input bytes in errors (A-30), distinct secrets for all 1120
ciphertext flips (A-03), a spliced key (A-06), deterministic implicit rejection
(A-18), and the KDF-encoding and purpose-separation unit tests (A-08, A-09).

qa_r2_02_non_canonical_x25519_public_key_is_refused FAILS on purpose: a pk_X
with bit 255 set parses, and the exchange then silently derives mismatched PSKs.
2026-11-25 08:16:44 +01:00