Skip to content

Commit

Permalink
Switch to debug_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Nov 15, 2024
1 parent b54d8d8 commit dcb21a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aws-lc-rs/src/cipher/aes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub const AES_BLOCK_LEN: usize = 16;
pub(crate) fn encrypt_block(aes_key: &AES_KEY, mut block: Block) -> Block {
{
let block_ref = block.as_mut();
assert!(block_ref.len() == AES_BLOCK_LEN);
debug_assert_eq!(block_ref.len(), AES_BLOCK_LEN);
aes_ecb_encrypt(aes_key, block_ref);
}
block
Expand Down Expand Up @@ -219,7 +219,7 @@ pub(super) fn encrypt_ecb_mode(

// This is a sanity check that should not happen. We validate in `encrypt` that in_out.len() % block_len == 0
// for this mode.
assert!(in_out_iter.into_remainder().is_empty());
debug_assert!(in_out_iter.into_remainder().is_empty());

Ok(context.into())
}
Expand Down Expand Up @@ -251,7 +251,7 @@ pub(super) fn decrypt_ecb_mode<'in_out>(

// This is a sanity check hat should not fail. We validate in `decrypt` that in_out.len() % block_len == 0 for
// this mode.
assert!(in_out_iter.into_remainder().is_empty());
debug_assert!(in_out_iter.into_remainder().is_empty());
}

Ok(in_out)
Expand Down

0 comments on commit dcb21a1

Please sign in to comment.