diff options
author | Werner Koch <[email protected]> | 1998-02-11 03:25:44 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1998-02-11 03:25:44 +0000 |
commit | 4c0c155922b70b62793905490e210e9af4e3b18d (patch) | |
tree | a0d8d84a89cfd4579817a993715e750917961c3e /cipher/md5.c | |
parent | release 0.2.3 (diff) | |
download | gnupg-4c0c155922b70b62793905490e210e9af4e3b18d.tar.gz gnupg-4c0c155922b70b62793905490e210e9af4e3b18d.zip |
a couple of changes; but some parts are now broken
Diffstat (limited to '')
-rw-r--r-- | cipher/md5.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cipher/md5.c b/cipher/md5.c index c9f9a86b4..ef95c7ef8 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 */ |