Skip to content

test: make the RSA-PSS encode vectors kill the emBits and masking mut… - #70

Merged
miladrahimi merged 1 commit into
mainfrom
feature/ed25519-ed448
Aug 1, 2026
Merged

test: make the RSA-PSS encode vectors kill the emBits and masking mut…#70
miladrahimi merged 1 commit into
mainfrom
feature/ed25519-ed448

Conversation

@miladrahimi

Copy link
Copy Markdown
Owner

…ants

The Infection run on this PR flaked: the emBits = modBits - 1 mutant in AbstractRsaPssSigner::sign() escaped, and a local run lost the same coin flip on 0xFF >> $clearBits in encode(). Neither escape was new to this branch. Both mutants only shift bits in the leading byte of the encoded message, so every test that signs with a random salt catches them only about half the time, and the fixed-salt vector could not catch them at all: with the old salt that byte was 0x6B, whose top and bottom bits are already clear, so the mutated encoders produced the very same signature.

Pin the salt to one whose masked data block starts with 0xFF, and add a second vector under the 2047-bit key, which has two excess bits to clear where the 2041-bit key has none. Every bit of the clearing step is then observable in a deterministic signature, for both shapes of modulus. The OpenSSL CLI verifies both vectors (PSS, salt length 32).

…ants

The Infection run on this PR flaked: the `emBits = modBits - 1` mutant in
AbstractRsaPssSigner::sign() escaped, and a local run lost the same coin
flip on `0xFF >> $clearBits` in encode(). Neither escape was new to this
branch. Both mutants only shift bits in the leading byte of the encoded
message, so every test that signs with a random salt catches them only
about half the time, and the fixed-salt vector could not catch them at
all: with the old salt that byte was 0x6B, whose top and bottom bits are
already clear, so the mutated encoders produced the very same signature.

Pin the salt to one whose masked data block starts with 0xFF, and add a
second vector under the 2047-bit key, which has two excess bits to clear
where the 2041-bit key has none. Every bit of the clearing step is then
observable in a deterministic signature, for both shapes of modulus. The
OpenSSL CLI verifies both vectors (PSS, salt length 32).
@sonarqubecloud

sonarqubecloud Bot commented Aug 1, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cd1a649) to head (060bd29).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #70   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       290       290           
===========================================
  Files             44        44           
  Lines            629       629           
===========================================
  Hits             629       629           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@miladrahimi
miladrahimi merged commit fb06348 into main Aug 1, 2026
23 checks passed
@miladrahimi
miladrahimi deleted the feature/ed25519-ed448 branch August 1, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant