Use blockSize in error message thrown

pull/461/head
Jeffrey Walton 2017-08-12 20:29:33 -04:00
parent 7d21cdd54e
commit 95ee8975b4
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 3 additions and 1 deletions

View File

@ -332,7 +332,7 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const
const unsigned int blockSize = blockCipher.BlockSize(); const unsigned int blockSize = blockCipher.BlockSize();
CRYPTOPP_ASSERT(blockSize == REQUIRED_BLOCKSIZE); CRYPTOPP_ASSERT(blockSize == REQUIRED_BLOCKSIZE);
if (blockSize != REQUIRED_BLOCKSIZE) if (blockSize != REQUIRED_BLOCKSIZE)
throw InvalidArgument(AlgorithmName() + ": block size of underlying block cipher is not 16"); throw InvalidArgument(AlgorithmName() + ": block size of underlying block cipher is not " + IntToString(blockSize));
int tableSize, i, j, k; int tableSize, i, j, k;
@ -342,6 +342,7 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const
// Avoid "parameter not used" error and suppress Coverity finding // Avoid "parameter not used" error and suppress Coverity finding
(void)params.GetIntValue(Name::TableSize(), tableSize); (void)params.GetIntValue(Name::TableSize(), tableSize);
tableSize = s_clmulTableSizeInBlocks * blockSize; tableSize = s_clmulTableSizeInBlocks * blockSize;
CRYPTOPP_ASSERT(tableSize > (int)blockSize);
} }
else else
#elif CRYPTOPP_BOOL_ARM_PMULL_AVAILABLE #elif CRYPTOPP_BOOL_ARM_PMULL_AVAILABLE
@ -350,6 +351,7 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const
// Avoid "parameter not used" error and suppress Coverity finding // Avoid "parameter not used" error and suppress Coverity finding
(void)params.GetIntValue(Name::TableSize(), tableSize); (void)params.GetIntValue(Name::TableSize(), tableSize);
tableSize = s_clmulTableSizeInBlocks * blockSize; tableSize = s_clmulTableSizeInBlocks * blockSize;
CRYPTOPP_ASSERT(tableSize > (int)blockSize);
} }
else else
#endif #endif