summaryrefslogtreecommitdiff
path: root/cipher/md5.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-02-11 03:25:43 +0000
committerWerner Koch <wk@gnupg.org>1998-02-11 03:25:43 +0000
commit05690451b89ca1df9e81b50f306f0f87ae3b80a6 (patch)
tree69ffa304be307409ece88034418ae3e8d4408a0b /cipher/md5.c
parenta7f3283cc053fff72bb81c230504bbd9d675de1d (diff)
downloadlibgcrypt-05690451b89ca1df9e81b50f306f0f87ae3b80a6.tar.gz
a couple of changes; but some parts are now broken
Diffstat (limited to 'cipher/md5.c')
-rw-r--r--cipher/md5.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/cipher/md5.c b/cipher/md5.c
index c9f9a86b..ef95c7ef 100644
--- a/cipher/md5.c
+++ b/cipher/md5.c
@@ -93,7 +93,18 @@ static byte PADDING[64] = {
#define I(x, y, z) ((y) ^ ((x) | (~z)))
/* ROTATE_LEFT rotates x left n bits */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+#if defined(__GNUC__) && defined(__i386__)
+static inline u32
+ROTATE_LEFT(u32 x, int n)
+{
+ __asm__("roll %%cl,%0"
+ :"=r" (x)
+ :"0" (x),"c" (n));
+ return x;
+}
+#else
+ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+#endif
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */
/* Rotation is separate from addition to prevent recomputation */