summaryrefslogtreecommitdiff
path: root/gcm.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-08-12 20:29:33 -0400
committerJeffrey Walton <noloader@gmail.com>2017-08-12 20:29:33 -0400
commit95ee8975b4fcc132c839dfa47bd80dbaeee7ed54 (patch)
tree78d8ad9cc777e417864f3de9a7b4dfe73ac75b78 /gcm.cpp
parent7d21cdd54e95a936c7b4a946a7d5739a2366769c (diff)
downloadcryptopp-git-95ee8975b4fcc132c839dfa47bd80dbaeee7ed54.tar.gz
Use blockSize in error message thrown
Diffstat (limited to 'gcm.cpp')
-rw-r--r--gcm.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcm.cpp b/gcm.cpp
index 6d389a1b..86a0a3a6 100644
--- a/gcm.cpp
+++ b/gcm.cpp
@@ -332,7 +332,7 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const
const unsigned int blockSize = blockCipher.BlockSize();
CRYPTOPP_ASSERT(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;
@@ -342,6 +342,7 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const
// Avoid "parameter not used" error and suppress Coverity finding
(void)params.GetIntValue(Name::TableSize(), tableSize);
tableSize = s_clmulTableSizeInBlocks * blockSize;
+ CRYPTOPP_ASSERT(tableSize > (int)blockSize);
}
else
#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
(void)params.GetIntValue(Name::TableSize(), tableSize);
tableSize = s_clmulTableSizeInBlocks * blockSize;
+ CRYPTOPP_ASSERT(tableSize > (int)blockSize);
}
else
#endif