diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-02-05 12:18:47 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-02-05 12:18:47 +0000 |
commit | 6df823853c84b63fd73d098aeebf602c9772fec8 (patch) | |
tree | 4aa4291af38588915100159548ac0c0fbbdedf41 /lib/gnutls_num.h | |
parent | e2ae85844011a353a7796ed748829d393ea0cd5a (diff) | |
download | gnutls-6df823853c84b63fd73d098aeebf602c9772fec8.tar.gz |
*** empty log message ***
Diffstat (limited to 'lib/gnutls_num.h')
-rw-r--r-- | lib/gnutls_num.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gnutls_num.h b/lib/gnutls_num.h index 0ce493be2a..b5d2d4e756 100644 --- a/lib/gnutls_num.h +++ b/lib/gnutls_num.h @@ -23,6 +23,14 @@ #define GMIN(x,y) (x<y)?x:y #define GMAX(x,y) (x>y)?x:y +#define rotl32(x,n) (((x) << ((uint16)(n))) | ((x) >> (32 - (uint16)(n)))) +#define rotr32(x,n) (((x) >> ((uint16)(n))) | ((x) << (32 - (uint16)(n)))) +#define rotl16(x,n) (((x) << ((uint16)(n))) | ((x) >> (16 - (uint16)(n)))) +#define rotr16(x,n) (((x) >> ((uint16)(n))) | ((x) << (16 - (uint16)(n)))) + +#define byteswap16(x) ((rotl16(x, 8) & 0x00ff) | (rotr16(x, 8) & 0xff00)) +#define byteswap32(x) ((rotl32(x, 8) & 0x00ff00ffUL) | (rotr32(x, 8) & 0xff00ff00UL)) + uint32 uint24touint32( uint24 num); uint24 uint32touint24( uint32 num); uint32 READuint32( const opaque* data); |