summaryrefslogtreecommitdiff
path: root/cipher/rmd160.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1999-09-13 08:56:41 +0000
committerWerner Koch <wk@gnupg.org>1999-09-13 08:56:41 +0000
commit6d57d176567a469dd3caf8cae45702a1451a06ad (patch)
treef67dd15f0bd2e5d8bccbd8b100d6191efbd54fd5 /cipher/rmd160.c
parent2a8d5684daee285e1658856db147dd83fdb107d6 (diff)
downloadlibgcrypt-6d57d176567a469dd3caf8cae45702a1451a06ad.tar.gz
See ChangeLog: Mon Sep 13 10:55:14 CEST 1999 Werner Koch
Diffstat (limited to 'cipher/rmd160.c')
-rw-r--r--cipher/rmd160.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/cipher/rmd160.c b/cipher/rmd160.c
index e8771883..ecd65b35 100644
--- a/cipher/rmd160.c
+++ b/cipher/rmd160.c
@@ -29,6 +29,8 @@
#include "cipher.h" /* only used for the rmd160_hash_buffer() prototype */
#include "dynload.h"
+#include "bithelp.h"
+
/*********************************
* RIPEMD-160 is not patented, see (as of 25.10.97)
* http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html
@@ -153,19 +155,6 @@ rmd160_init( RMD160_CONTEXT *hd )
}
-#if defined(__GNUC__) && defined(__i386__)
-static inline u32
-rol(int n, u32 x)
-{
- __asm__("roll %%cl,%0"
- :"=r" (x)
- :"0" (x),"c" (n));
- return x;
-}
-#else
- #define rol(n,x) ( ((x) << (n)) | ((x) >> (32-(n))) )
-#endif
-
/****************
* Transform the message X which consists of 16 32-bit-words
@@ -218,8 +207,8 @@ transform( RMD160_CONTEXT *hd, byte *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 = rol(s,t) + e; \
- c = rol(10,c); \
+ a = rol(t,s) + e; \
+ c = rol(c,10); \
} while(0)
/* left lane */