summaryrefslogtreecommitdiff
path: root/misc.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-18 12:15:53 -0400
committerJeffrey Walton <noloader@gmail.com>2021-03-18 12:15:53 -0400
commit949b7632f11b4edaddfd05edb5042fbc0580348c (patch)
treefc1c02a58c86391964ebd4deeb4639f2ec0b6a41 /misc.cpp
parentbb5b48d1dc4bbd39df0d65e34d403275a5543207 (diff)
downloadcryptopp-git-949b7632f11b4edaddfd05edb5042fbc0580348c.tar.gz
Fold count==0 tests in xorbuf
Diffstat (limited to 'misc.cpp')
-rw-r--r--misc.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/misc.cpp b/misc.cpp
index 2fac84e5..f50a56ce 100644
--- a/misc.cpp
+++ b/misc.cpp
@@ -84,8 +84,6 @@ void xorbuf(byte *buf, const byte *mask, size_t count)
_mm_xor_ps(_mm_castsi128_ps(b), _mm_castsi128_ps(m))));
buf += 16; mask += 16; count -= 16;
}
-
- if (count == 0) return;
# endif
# if defined(__aarch64__) || defined(__aarch32__) || defined(_M_ARM64)
while (count >= 16)
@@ -93,8 +91,6 @@ void xorbuf(byte *buf, const byte *mask, size_t count)
vst1q_u8(buf, veorq_u8(vld1q_u8(buf), vld1q_u8(mask)));
buf += 16; mask += 16; count -= 16;
}
-
- if (count == 0) return;
# endif
#endif // CRYPTOPP_DISABLE_ASM
@@ -113,9 +109,10 @@ void xorbuf(byte *buf, const byte *mask, size_t count)
buf += 16; mask += 16; count -= 16;
}
+#endif
+ // One of the arch specific xor's may have cleared the request
if (count == 0) return;
-#endif
while (count >= 4)
{
@@ -161,8 +158,6 @@ void xorbuf(byte *output, const byte *input, const byte *mask, size_t count)
_mm_xor_ps(_mm_castsi128_ps(b), _mm_castsi128_ps(m))));
output += 16; input += 16; mask += 16; count -= 16;
}
-
- if (count == 0) return;
# endif
# if defined(__aarch64__) || defined(__aarch32__) || defined(_M_ARM64)
while (count >= 16)
@@ -170,8 +165,6 @@ void xorbuf(byte *output, const byte *input, const byte *mask, size_t count)
vst1q_u8(output, veorq_u8(vld1q_u8(input), vld1q_u8(mask)));
output += 16; input += 16; mask += 16; count -= 16;
}
-
- if (count == 0) return;
# endif
#endif // CRYPTOPP_DISABLE_ASM
@@ -190,9 +183,10 @@ void xorbuf(byte *output, const byte *input, const byte *mask, size_t count)
output += 16; input += 16; mask += 16; count -= 16;
}
+#endif
+ // One of the arch specific xor's may have cleared the request
if (count == 0) return;
-#endif
while (count >= 4)
{