]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Use ROTL32 in the ripemd160 code.
authorNiels Möller <nisse@lysator.liu.se>
Sat, 31 Mar 2012 19:37:13 +0000 (21:37 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Sat, 31 Mar 2012 19:37:13 +0000 (21:37 +0200)
ChangeLog
ripemd160-compress.c

index 36191aecd4ff49b0615f0a8091ecf1d14ef01094..d0bd872968410ac0ded79df02c2916b6d8b27a1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,8 @@
        * cast128.c (ROL): Deleted macro.
        (F1, F2, F3): Updated to use ROTL32 (reversed order of arguments).
        Also added proper do { ... } while (0) wrappers.
+       * ripemd160-compress.c (ROL32): Deleted macro.
+       (R): Updated to use ROTL32 (reversed order of arguments).
 
 2012-03-30  Niels Möller  <nisse@lysator.liu.se>
 
index 66b25b29379a2dfdbc607ef7447ce916272e8e55..675c4696c88c2b39e98b922f5d07b465d8665ae1 100644 (file)
 
 #include "macros.h"
 
-/****************
- * Rotate the 32 bit unsigned integer X by N bits left
- */
-
-#define ROL32(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) )
-
 
 /****************
  * Transform the message X which consists of 16 32-bit-words
@@ -76,8 +70,8 @@ _nettle_ripemd160_compress(uint32_t *state, const uint8_t *data)
 #define F3(x,y,z)   ( ((x) & (z)) | ((y) & ~(z)) )
 #define F4(x,y,z)   ( (x) ^ ((y) | ~(z)) )
 #define R(a,b,c,d,e,f,k,r,s) do { t = a + f(b,c,d) + k + x[r]; \
-          a = ROL32(t,s) + e;        \
-          c = ROL32(c,10);         \
+          a = ROTL32(s,t) + e;        \
+          c = ROTL32(10,c);         \
         } while(0)
 
   /* left lane */