Skip to content

Commit

Permalink
Test larger inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Firstyear committed Jan 5, 2024
1 parent e2c81c6 commit 08071b1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/soft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,23 @@ mod tests {
assert_eq!(&input, output.as_slice());
}

#[test]
fn aes_256_gcm_enc_dec_large() {
let _ = tracing_subscriber::fmt::try_init();

let input = [0xf; 256];
let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
let iv = b"\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07";
#[allow(clippy::expect_used)]
let (enc, tag) = aes_256_gcm_encrypt(&input, key, iv).expect("Unable to encrypt");

trace!(?enc, ?tag, key_len = key.len());
#[allow(clippy::expect_used)]
let output = aes_256_gcm_decrypt(&enc, &tag, key, iv).expect("Unable to decrypt");

assert_eq!(&input, output.as_slice());
}

#[test]
fn soft_hmac_hw_bound() {
let _ = tracing_subscriber::fmt::try_init();
Expand Down

0 comments on commit 08071b1

Please sign in to comment.