You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wycheproof: Fix incorrect assertion for invalid encaps/decaps tests
The encaps and combined test functions asserted that K should NOT match
the expected value for invalid test cases where the binary succeeded.
This is wrong: for invalid inputs, the binary should reject the input
via input validation, not succeed and produce a different K.
Fix this by restructuring all test functions to branch on tc["result"]
first, then verify the binary's behavior:
- "invalid": assert the binary rejected the input (_error or decode_error)
- "valid": assert outputs match expected values
- anything else: fail with unexpected result
Additional changes:
- Remove "acceptable" as a result type (not used in any test vectors)
- In keygen_seed tests, only "valid" results exist; simplify accordingly
- In semi_expanded_decaps tests, assert that invalid tests are rejected
rather than silently ignoring errors on valid tests
- In combined tests, distinguish keygen decode errors from runtime errors,
and always verify ek when keygen succeeds
Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
0 commit comments