Skip to content

fix: update aes128 decrypt test for PKCS#7 padding validation#22191

Closed
AztecBot wants to merge 1 commit into
merge-train/spartanfrom
claudebox/fix-merge-train-spartan-22187
Closed

fix: update aes128 decrypt test for PKCS#7 padding validation#22191
AztecBot wants to merge 1 commit into
merge-train/spartanfrom
claudebox/fix-merge-train-spartan-22187

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Summary

  • The aes_encrypt_then_decrypt_with_bad_sym_key_is_caught test was failing because PR fix(aes128): validate PKCS#7 padding in decryptBufferCBC #22179 added PKCS#7 padding validation to the AES128 decrypt oracle.
  • Previously, decrypting with the wrong key returned Some(garbage) — the test relied on MAC comparison to detect bad decryption.
  • Now the oracle returns None when padding is invalid (which happens with wrong-key decryption), so the .unwrap() call panicked before reaching the MAC check.
  • Updated the test to assert that try_aes128_decrypt returns None with a bad key, and updated the doc comment to reflect the new behavior.

Test plan

  • nargo check compiles cleanly with no errors
  • CI should pass the previously-failing oracle::aes128_decrypt::test::aes_encrypt_then_decrypt_with_bad_sym_key_is_caught test

ClaudeBox log: https://claudebox.work/s/4d7f4a8137228683?run=1

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Mar 31, 2026
@spypsy

spypsy commented Apr 1, 2026

Copy link
Copy Markdown
Member

closing in favour of #22179

@spypsy spypsy closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants