Add test coverage for cas-lib 0.2.85 APIs (#90) - #94
Merged
Merged
Conversation
All APIs listed in #90 were already exposed by #91 and #92; this fills the remaining test gaps: AES-GCM-SIV X25519 key derivation, tamper and wrong-nonce rejection; Ed25519 key-pair verify failure paths; PBKDF2 salt/iteration/password sensitivity; SLH-DSA wrong-key and tampered signatures; ML-KEM freshness and wrong-key decapsulation; and a public API barrel-export guard. Adds matching Rust tests for SIV X25519 key derivation and Ed25519 key-pair verify failures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit of issue #90 found that every API it lists (AES-GCM-SIV, ML-KEM-1024, SLH-DSA, PBKDF2, Argon2 AES key derivation, AES-GCM
key_from_vec, Ed25519 verify-with-key-pair) is already exposed through the FFI and TS layers via #91 and #92, and nothing else public in cas-lib 0.2.85 is unexposed. This PR fills the remaining test gaps.TS tests (Playwright)
KeyFromByteskeys round-trip; key/nonce/tag sizes; tampered ciphertext and wrong nonce throwverifyWithKeyPairBytesrejects a different key pair and a tampered signature, agrees with public-key verify, throws on wrong-length inputsderivegenerates a fresh salt per call; derived key works as an AES-256-GCM keypublic-api.spec.ts: guards barrel exports of the new wrappers/methodsRust tests
Reviewer notes
key_from_x25519_shared_secretruns input through HKDF with no length check, so a wrong-length shared secret does not throw. Strict validation would be a cas-lib change.derive_aes_*was deferred is stale — Argon2 derive AES-128/256 keys #92 exposed it (salt is still random and not returned, so keys are non-reproducible; tests assert that).Test plan
cargo test --release— 61 passednpx playwright teston the 6 affected spec files — 114 passed (all 3 projects)Closes #90
🤖 Generated with Claude Code