]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(ROL64): Use (uint64_t) 1 rather than 1L, for
authorNiels Möller <nisse@lysator.liu.se>
Thu, 24 Nov 2011 14:01:25 +0000 (15:01 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 24 Nov 2011 14:01:25 +0000 (15:01 +0100)
systems. Needed for M$ w64.
(RSHIFT64): Likewise. Also added a missing parenthesis.

Rev: nettle/ChangeLog:1.236
Rev: nettle/serpent-internal.h:1.2

ChangeLog
serpent-internal.h

index 945699eaca2d08f59287fd4b2bcd466c3ee0c5ef..dfb8c82413df0f7f9fab4537c93dcef7606ec378 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-11-24  Niels Möller  <nisse@lysator.liu.se>
 
+       * serpent-internal.h (ROL64): Use (uint64_t) 1 rather than 1L, for
+       systems. Needed for M$ w64.
+       (RSHIFT64): Likewise. Also added a missing parenthesis.
+
        From Martin Storsjö:
        * testsuite/symbols-test: Use $NM, falling back to nm if undefined.
        * testsuite/Makefile.in (check): Pass $(NM) in the environment of
index 66d5af494138c9d740fab71d3c312f95aa8b221a..dffd929673a053721af87900b9d6f7a68b287068 100644 (file)
@@ -55,8 +55,8 @@
 #if HAVE_NATIVE_64_BIT
 /* Operate independently on both halves of a 64-bit word. */
 #define ROL64(x,n) \
-  (((x) << (n) & ~(((1L << (n))-1) << 32)) \
-   |(((x) >> (32-(n))) & ~(((1L << (32-(n)))-1) << (n))))
+  (((x) << (n) & ~((((uint64_t) 1 << (n))-1) << 32)) \
+   |(((x) >> (32-(n))) & ~((((uint64_t) 1 << (32-(n)))-1) << (n))))
 
 #define KEYXOR64(x0,x1,x2,x3, subkey)                 \
   do {                                                \
@@ -68,7 +68,7 @@
   } while (0)
 
 #define RSHIFT64(x,n) \
-  ( ((x) << (n)) & ~(((1L << n) - 1) << 32))
+  ( ((x) << (n)) & ~((((uint64_t) 1 << (n)) - 1) << 32))
 #endif /* HAVE_NATIVE_64_BIT */
 
 #endif /* NETTLE_SERPENT_INTERNAL_H_INCLUDED */