diff options
author | Jeffrey Walton <noloader@gmail.com> | 2021-03-09 22:51:19 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2021-03-09 22:51:19 -0500 |
commit | f7e6af6344f2b1f3e4a6afe1ac2cc870af2d3944 (patch) | |
tree | 49c9d4a6760efec8114df7366a007befd08c5b5a /chacha.cpp | |
parent | 5c4c631e9291c57e237d6d40bb2c3456eb597f3d (diff) | |
download | cryptopp-git-f7e6af6344f2b1f3e4a6afe1ac2cc870af2d3944.tar.gz |
Add EnumToInt conversion macro for enum-enum conversion warnings (GH #1016)
Diffstat (limited to 'chacha.cpp')
-rw-r--r-- | chacha.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -102,7 +102,7 @@ void ChaCha_OperateKeystream(KeystreamOperation operation, {
while (iterationCount >= 8 && MultiBlockSafe(state[12], 8))
{
- const bool xorInput = (operation & static_cast<int>(INPUT_NULL)) != static_cast<int>(INPUT_NULL);
+ const bool xorInput = (operation & EnumToInt(INPUT_NULL)) != EnumToInt(INPUT_NULL);
ChaCha_OperateKeystream_AVX2(state, xorInput ? input : NULLPTR, output, rounds);
// MultiBlockSafe avoids overflow on the counter words
@@ -120,7 +120,7 @@ void ChaCha_OperateKeystream(KeystreamOperation operation, {
while (iterationCount >= 4 && MultiBlockSafe(state[12], 4))
{
- const bool xorInput = (operation & static_cast<int>(INPUT_NULL)) != static_cast<int>(INPUT_NULL);
+ const bool xorInput = (operation & EnumToInt(INPUT_NULL)) != EnumToInt(INPUT_NULL);
ChaCha_OperateKeystream_SSE2(state, xorInput ? input : NULLPTR, output, rounds);
// MultiBlockSafe avoids overflow on the counter words
@@ -138,7 +138,7 @@ void ChaCha_OperateKeystream(KeystreamOperation operation, {
while (iterationCount >= 4 && MultiBlockSafe(state[12], 4))
{
- const bool xorInput = (operation & static_cast<int>(INPUT_NULL)) != static_cast<int>(INPUT_NULL);
+ const bool xorInput = (operation & EnumToInt(INPUT_NULL)) != EnumToInt(INPUT_NULL);
ChaCha_OperateKeystream_NEON(state, xorInput ? input : NULLPTR, output, rounds);
// MultiBlockSafe avoids overflow on the counter words
@@ -156,7 +156,7 @@ void ChaCha_OperateKeystream(KeystreamOperation operation, {
while (iterationCount >= 4 && MultiBlockSafe(state[12], 4))
{
- const bool xorInput = (operation & static_cast<int>(INPUT_NULL)) != static_cast<int>(INPUT_NULL);
+ const bool xorInput = (operation & EnumToInt(INPUT_NULL)) != EnumToInt(INPUT_NULL);
ChaCha_OperateKeystream_ALTIVEC(state, xorInput ? input : NULLPTR, output, rounds);
// MultiBlockSafe avoids overflow on the counter words
|