Repository navigation
wycheproof: test OAEP decryption - #740
Merged
tarcieri merged 1 commit intoNov 1, 2026
Merged
Conversation
tests/wycheproof.rs runs the PKCS#1 v1.5 and PSS signature vectors but no OAEP decryption vectors. Dropping `first_byte_is_zero`, `!nonzero_before_one` or `!looking_for_index` from the `valid` computation in src/algorithms/oaep.rs leaves the whole test suite green. Run the 22 rsa_oaep_*_test.json files from the Wycheproof submodule: 1098 vectors with SHA-1, SHA-2 and SHA-512/224, SHA-512/256 for the label hash and MGF1. Each of the three changes above makes 21 of the 22 files fail. The rsa_three_primes_oaep_* files are left out because multi-prime keys are not supported. Assisted-by: Claude Code:claude-opus-5-5
wihansaem1991
added a commit
to wihansaem1991/wihansaem1991.github.io
that referenced
this pull request
Nov 1, 2026
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.
tests/wycheproof.rsruns the PKCS#1 v1.5 and PSS signature vectors, but no OAEP decryption vectors. As a result, the padding checks insrc/algorithms/oaep.rsare not pinned down by the test suite: removing any one offirst_byte_is_zero,!nonzero_before_oneor!looking_for_indexfrom thevalidcomputation leavescargo test --releasegreen.This adds
test_rsa_oaep_decrypt, which runs the 22rsa_oaep_*_test.jsonfiles from the existing Wycheproof submodule (no submodule bump): 1098 vectors, with SHA-1, SHA-2 and SHA-512/224, SHA-512/256 used for the label hash and for MGF1. Valid vectors must decrypt to the expected message and invalid ones must be rejected.Results:
validcomputation inoaep.rstest_rsa_oaep_decryptfirst_byte_is_zero!nonzero_before_one!looking_for_index(
rsa_oaep_misc_test.jsonholds only valid vectors, so it still passes under those changes.)The
rsa_three_primes_oaep_*files are not included because multi-prime keys are not supported.Summary::failnow takes anyDebugvalue so it can report the decryption result.Checked with
cargo test --release --test wycheproof(default features and--no-default-features --features encoding),cargo clippy --all -- -D warningsandcargo fmt --all -- --check. The new cases add about 9 seconds in release mode.This test was written with an AI assistant (Claude Code), which also ran the tests and the mutations above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Sjtw7YxFWFKBH5rRZfwi9T