From: Niels Möller Date: Sat, 31 Mar 2012 19:37:13 +0000 (+0200) Subject: Use ROTL32 in the ripemd160 code. X-Git-Tag: nettle_2.5_release_20120707~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4a28f551c96a7fe731fd47b5544169a19594462;p=thirdparty%2Fnettle.git Use ROTL32 in the ripemd160 code. --- diff --git a/ChangeLog b/ChangeLog index 36191aec..d0bd8729 100644 --- 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 diff --git a/ripemd160-compress.c b/ripemd160-compress.c index 66b25b29..675c4696 100644 --- a/ripemd160-compress.c +++ b/ripemd160-compress.c @@ -30,12 +30,6 @@ #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 */