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.
Builds a throwaway crate that depends on arcanum without features and runs
cargo check --offline on small programs: the safe API compiles (control), a
non-CryptoRng RNG is refused (A-33), and no _derand/from_seed entry point is
reachable (A-34). Each was checked by reintroducing the bug.
qa_r2_01_raw_shared_secret_is_not_reachable_without_hazmat FAILS on purpose:
PublicKey::encapsulate(..).1.as_bytes() hands a release consumer the raw
one-way X-Wing secret, the single-direction PSK that A-15 rules out.
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.
X-Wing is composed from ml-kem, x25519-dalek, sha3 and shake and matches the
draft's vectors. The PSK comes from a mutual exchange (each peer encapsulates
to the other, QA A-15) bound to the full transcript in Arcanum's own HKDF layer
(QA D-QA-1). Low-order X25519 values are refused. Deterministic entry points
sit behind the off-by-default hazmat feature, enabled only for the tests.