Mercurial > hg > octave-lyh > gnulib-hg
changeset 2879:b9de4fb7b460
(rol): Define (from GnuPG).
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Mon, 25 Sep 2000 00:00:58 +0000 |
parents | 53969d50efee |
children | 2a7e5d634dca |
files | lib/md5.h |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/md5.h +++ b/lib/md5.h @@ -143,4 +143,19 @@ 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