diff options
author | Werner Koch <wk@gnupg.org> | 2003-01-20 16:58:20 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2003-01-20 16:58:20 +0000 |
commit | efc0a843677ac2a68b10d81483096b6cdfa7fad7 (patch) | |
tree | 3fc63561293bca2eed505bdf621e784bcb87c88c /cipher/bithelp.h | |
parent | 31caedad38e64bd5e2ba6665ca73bd9c8ec9b505 (diff) | |
download | libgcrypt-efc0a843677ac2a68b10d81483096b6cdfa7fad7.tar.gz |
* basic.c (check_one_md): Kludge to check a one million "a".
(check_digests): Add checks for SHA-256.
* sha256.c: New.
* bithelp.h (ror): New.
* Makfile.am: Add sha256.c.
* md.c (oid_table): Add values for SHA256 et al.
(gcry_md_get_algo_dlen): Likewise
* configure.ac (LIBGCRYPT_LT_REVISION): Bumbed up.
Diffstat (limited to 'cipher/bithelp.h')
-rw-r--r-- | cipher/bithelp.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cipher/bithelp.h b/cipher/bithelp.h index c9fda651..15053243 100644 --- a/cipher/bithelp.h +++ b/cipher/bithelp.h @@ -22,7 +22,7 @@ /**************** - * Rotate a 32 bit integer by n bytes + * Rotate the 32 bit unsigned integer X by N bits left/right */ #if defined(__GNUC__) && defined(__i386__) static inline u32 @@ -34,7 +34,20 @@ rol( u32 x, int n) return x; } #else - #define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) +#define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) +#endif + +#if defined(__GNUC__) && defined(__i386__) +static inline u32 +ror(u32 x, int n) +{ + __asm__("rorl %%cl,%0" + :"=r" (x) + :"0" (x),"c" (n)); + return x; +} +#else +#define ror(x,n) ( ((x) >> (n)) | ((x) << (32-(n))) ) #endif |