diff options
author | lloyd <[email protected]> | 2013-11-07 12:33:38 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-11-07 12:33:38 +0000 |
commit | 6db7f4715cf897e026573b870598e89c0f20c3ce (patch) | |
tree | 7ffd7fe35e05c74b68566861f97f4aa8879f9187 /src/modes/aead | |
parent | efc05f53973ec51a7092512247c6cdd270229d16 (diff) |
Use BS constant where possible
Diffstat (limited to 'src/modes/aead')
-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 } } |