From: Viktor Dukhovni Date: Fri, 29 Jan 2016 00:04:49 +0000 (-0500) Subject: Keep RC5 bit shifts in [0..31] X-Git-Tag: OpenSSL_1_1_0-pre3~383 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=35ade23b02a02b5514941586030016b67ac0934e;p=oweals%2Fopenssl.git Keep RC5 bit shifts in [0..31] Reviewed-by: Richard Levitte --- diff --git a/crypto/rc5/rc5_locl.h b/crypto/rc5/rc5_locl.h index 9944440334..6b34f923a6 100644 --- a/crypto/rc5/rc5_locl.h +++ b/crypto/rc5/rc5_locl.h @@ -170,10 +170,10 @@ # endif #endif #ifndef ROTATE_l32 -# define ROTATE_l32(a,n) (((a)<<(n&0x1f))|(((a)&0xffffffff)>>(32-(n&0x1f)))) +# define ROTATE_l32(a,n) (((a)<<(n&0x1f))|(((a)&0xffffffff)>>((32-n)&0x1f))) #endif #ifndef ROTATE_r32 -# define ROTATE_r32(a,n) (((a)<<(32-(n&0x1f)))|(((a)&0xffffffff)>>(n&0x1f))) +# define ROTATE_r32(a,n) (((a)<<((32-n)&0x1f))|(((a)&0xffffffff)>>(n&0x1f))) #endif #define RC5_32_MASK 0xffffffffL