diff options
author | lloyd <[email protected]> | 2013-11-08 21:01:49 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-11-08 21:01:49 +0000 |
commit | 51bdb06ac838b426cacdb4dd8a2efecbf67820ac (patch) | |
tree | 24904f3debd38b367b595dcecdee8084c0464591 /src/modes | |
parent | 068caf3bf6b8923a133d2ab8a265d935f87246ed (diff) | |
parent | f205292f8fde3c206f77e80a21fa9b9e2513bb86 (diff) |
merge of '5e53891d2c77f27a22d07ed26923745f9a5f3336'
and 'a895552efd212665d83064e9517976ef63f41368'
Diffstat (limited to 'src/modes')
-rw-r--r-- | src/modes/aead/ccm/ccm.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modes/aead/ccm/ccm.cpp b/src/modes/aead/ccm/ccm.cpp index 898964ff4..fb35172cc 100644 --- a/src/modes/aead/ccm/ccm.cpp +++ b/src/modes/aead/ccm/ccm.cpp @@ -20,7 +20,7 @@ CCM_Mode::CCM_Mode(BlockCipher* cipher, size_t tag_size, size_t L) : m_L(L), m_cipher(cipher) { - if(m_cipher->block_size() != 16) + if(m_cipher->block_size() != BS) throw std::invalid_argument(m_cipher->name() + " cannot be used with CCM mode"); if(L < 2 || L > 8) @@ -85,7 +85,7 @@ void CCM_Mode::set_associated_data(const byte ad[], size_t length) m_ad_buf.push_back(get_byte<u16bit>(0, length)); m_ad_buf.push_back(get_byte<u16bit>(1, length)); m_ad_buf += std::make_pair(ad, length); - while(m_ad_buf.size() % 16) + while(m_ad_buf.size() % BS) m_ad_buf.push_back(0); // pad with zeros to full block size } } |