summaryrefslogtreecommitdiff
path: root/cipher/md5.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/md5.c
parent2a8d5684daee285e1658856db147dd83fdb107d6 (diff)
downloadlibgcrypt-6d57d176567a469dd3caf8cae45702a1451a06ad.tar.gz
See ChangeLog: Mon Sep 13 10:55:14 CEST 1999 Werner Koch
Diffstat (limited to 'cipher/md5.c')
-rw-r--r--cipher/md5.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cipher/md5.c b/cipher/md5.c
index 035eaf11..bb930d04 100644
--- a/cipher/md5.c
+++ b/cipher/md5.c
@@ -37,6 +37,8 @@
#include "memory.h"
#include "dynload.h"
+#include "bithelp.h"
+
typedef struct {
u32 A,B,C,D; /* chaining variables */
@@ -104,15 +106,11 @@ transform( MD5_CONTEXT *ctx, byte *data )
do \
{ \
a += FF (b, c, d) + (*cwp++) + T; \
- CYCLIC (a, s); \
+ a = rol(a, s); \
a += b; \
} \
while (0)
- /* It is unfortunate that C does not provide an operator for
- cyclic rotation. Hope the C compiler is smart enough. */
-#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
-
/* Before we start, one word about the strange constants.
They are defined in RFC 1321 as
@@ -142,7 +140,7 @@ transform( MD5_CONTEXT *ctx, byte *data )
do \
{ \
a += f (b, c, d) + correct_words[k] + T; \
- CYCLIC (a, s); \
+ a = rol(a, s); \
a += b; \
} \
while (0)