diff options
| author | Michael Brown | 2012-03-21 15:13:15 +0100 |
|---|---|---|
| committer | Michael Brown | 2012-03-21 17:27:12 +0100 |
| commit | c76afb36054669759dd7a876e80b9779dbc79120 (patch) | |
| tree | d906b9faed1adf020c8aa81d097cfca97832018c /src/include | |
| parent | [tls] Support sending a client certificate (diff) | |
| download | ipxe-c76afb36054669759dd7a876e80b9779dbc79120.tar.gz ipxe-c76afb36054669759dd7a876e80b9779dbc79120.tar.xz ipxe-c76afb36054669759dd7a876e80b9779dbc79120.zip | |
[crypto] Use standard bit-rotation functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/ipxe/rotate.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/include/ipxe/rotate.h b/src/include/ipxe/rotate.h index 745d84e6c..ba271ca74 100644 --- a/src/include/ipxe/rotate.h +++ b/src/include/ipxe/rotate.h @@ -10,19 +10,23 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdint.h> -static inline uint32_t rol32 ( uint32_t data, unsigned int rotation ) { +static inline __attribute__ (( always_inline )) uint32_t +rol32 ( uint32_t data, unsigned int rotation ) { return ( ( data << rotation ) | ( data >> ( 32 - rotation ) ) ); } -static inline uint32_t ror32 ( uint32_t data, unsigned int rotation ) { +static inline __attribute__ (( always_inline )) uint32_t +ror32 ( uint32_t data, unsigned int rotation ) { return ( ( data >> rotation ) | ( data << ( 32 - rotation ) ) ); } -static inline uint64_t rol64 ( uint64_t data, unsigned int rotation ) { +static inline __attribute__ (( always_inline )) uint64_t +rol64 ( uint64_t data, unsigned int rotation ) { return ( ( data << rotation ) | ( data >> ( 64 - rotation ) ) ); } -static inline uint64_t ror64 ( uint64_t data, unsigned int rotation ) { +static inline __attribute__ (( always_inline )) uint64_t +ror64 ( uint64_t data, unsigned int rotation ) { return ( ( data >> rotation ) | ( data << ( 64 - rotation ) ) ); } |
