changeset 2906:b0a98c9f01df

(md5_process_block) [OP]: Use `rol', not CYCLIC. [CYCLIC]: Remove now-unused definition.
author Jim Meyering <jim@meyering.net>
date Sun, 22 Oct 2000 21:09:43 +0000
parents 9a24f37aecd0
children 4bf91e973063
files lib/md5.c
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -304,19 +304,16 @@
         {								\
 	  a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T;		\
 	  ++words;							\
-	  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 to the strange constants.
 	 They are defined in RFC 1321 as
 
-	 T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
+	 T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64, or
+	 perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin $_))}'
        */
 
       /* Round 1.  */
@@ -345,7 +342,7 @@
       do 								\
 	{								\
 	  a += f (b, c, d) + correct_words[k] + T;			\
-	  CYCLIC (a, s);						\
+	  a = rol (a, s);						\
 	  a += b;							\
 	}								\
       while (0)