summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-09-25 00:00:58 +0000
committerJim Meyering <jim@meyering.net>2000-09-25 00:00:58 +0000
commitc3da9e25edb722299ced6398a494bd5ad7f0cb84 (patch)
tree62da6d2317a182ca2a6763b61ac1a923e04951cb
parentab367e6b1397ad91c2d31bc631a80314c6ecf0e7 (diff)
downloadcoreutils-c3da9e25edb722299ced6398a494bd5ad7f0cb84.tar.xz
(rol): Define (from GnuPG).
-rw-r--r--lib/md5.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/md5.h b/lib/md5.h
index b7645ec50..0a6aa5f66 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -143,4 +143,19 @@ extern int md5_stream __P ((FILE *stream, void *resblock));
digest. */
extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
+/* The following is from gnupg-1.0.2's cipher/bithelp.h. */
+/* Rotate a 32 bit integer by n bytes */
+#if defined(__GNUC__) && defined(__i386__)
+static inline md5_uint32
+rol(md5_uint32 x, int n)
+{
+ __asm__("roll %%cl,%0"
+ :"=r" (x)
+ :"0" (x),"c" (n));
+ return x;
+}
+#else
+# define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) )
+#endif
+
#endif