From 6db7f4715cf897e026573b870598e89c0f20c3ce Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 7 Nov 2013 12:33:38 +0000 Subject: Use BS constant where possible --- src/modes/aead/ccm/ccm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modes') 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(0, length)); m_ad_buf.push_back(get_byte(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 } } -- cgit v1.2.3