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
{{ message }}
Repository navigation
bug: CBC mode test fails randomly on out of bounds #218
// remove PKCS#7 padding by checking the last byte and removing all intermediate bytes
let last_byte = plaintext[plaintext.len() - 1];
if plaintext[plaintext.len() - last_byte as usize] == last_byte {
plaintext.truncate(plaintext.len() - last_byte as usize);
}
this is where the failure stems from, it seems last_byte is zero
Activity
mahmudsudo commentedon Feb 10, 2025
I would suggest restricting the values/length of the generated numbers
Autoparallel commentedon Feb 17, 2025
Do you know that these numbers being hit are sometimes too big/small?
mahmudsudo commentedon Feb 18, 2025
this is where the failure stems from, it seems last_byte is zero
Autoparallel commentedon Feb 18, 2025
Ah 1/256 chance then. No wonder we haven't seen this but still likely enough to fail.
Autoparallel commentedon Feb 18, 2025
@mahmudsudo good find there by the way. Marked this as "good first issue" since this shouldn't be too hard to fix.
mahmudsudo commentedon Feb 19, 2025
On second thought , a little check on the value of last_byte might help
mahmudsudo commentedon Nov 16, 2025
can i take the issue now ?