summaryrefslogtreecommitdiff
path: root/chacha.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-09 22:51:19 -0500
committerJeffrey Walton <noloader@gmail.com>2021-03-09 22:51:19 -0500
commitf7e6af6344f2b1f3e4a6afe1ac2cc870af2d3944 (patch)
tree49c9d4a6760efec8114df7366a007befd08c5b5a /chacha.cpp
parent5c4c631e9291c57e237d6d40bb2c3456eb597f3d (diff)
downloadcryptopp-git-f7e6af6344f2b1f3e4a6afe1ac2cc870af2d3944.tar.gz
Add EnumToInt conversion macro for enum-enum conversion warnings (GH #1016)
Diffstat (limited to 'chacha.cpp')
-rw-r--r--chacha.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/chacha.cpp b/chacha.cpp
index c1b0f559..5c50d52c 100644
--- a/chacha.cpp
+++ b/chacha.cpp
@@ -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