Skip to content

Commit

Permalink
fix siv debug_assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
LuoZijun committed Dec 30, 2020
1 parent 773d32d commit 618cda7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/blockmode/siv.rs
Expand Up @@ -108,7 +108,7 @@ macro_rules! impl_block_cipher_with_siv_cmac_mode {
// https://tools.ietf.org/html/rfc4493#section-2.4
if cfg!(debug_assertions) {
if last_block.is_some() {
assert!(m.len() >= Self::BLOCK_LEN);
assert!(m.len() > 0);
}
}
let mlen = if last_block.is_some() { m.len() + Self::BLOCK_LEN } else { m.len() };
Expand Down Expand Up @@ -406,7 +406,6 @@ macro_rules! impl_block_cipher_with_siv_cmac_mode {

// T = S2V(K1, AD1, ..., ADn, P)
let tag = self.s2v(components, &ciphertext_in_plaintext_out, opts);

// Verify
constant_time_eq(tag_in, &tag[..Self::TAG_LEN])
}
Expand Down

0 comments on commit 618cda7

Please sign in to comment.