From c76afb36054669759dd7a876e80b9779dbc79120 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 21 Mar 2012 14:13:15 +0000 Subject: [crypto] Use standard bit-rotation functions Signed-off-by: Michael Brown --- src/include/ipxe/rotate.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/include') 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 -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 ) ) ); } -- cgit v1.2.3-55-g7522