summaryrefslogtreecommitdiffstats
path: root/CryptoPP/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'CryptoPP/misc.h')
-rw-r--r--CryptoPP/misc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/CryptoPP/misc.h b/CryptoPP/misc.h
index 8425c5362..7f32b860b 100644
--- a/CryptoPP/misc.h
+++ b/CryptoPP/misc.h
@@ -580,13 +580,13 @@ CRYPTOPP_DLL void CRYPTOPP_API UnalignedDeallocate(void *p);
template <class T> inline T rotlFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
- return T((x<<y) | (x>>(sizeof(T)*8-y)));
+ return y ? T((x<<y) | (x>>(sizeof(T)*8-y))) : x;
}
template <class T> inline T rotrFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
- return T((x>>y) | (x<<(sizeof(T)*8-y)));
+ return y ? T((x>>y) | (x<<(sizeof(T)*8-y))) : x;
}
template <class T> inline T rotlVariable(T x, unsigned int y)