From 35ade23b02a02b5514941586030016b67ac0934e Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Thu, 28 Jan 2016 19:04:49 -0500 Subject: [PATCH] Keep RC5 bit shifts in [0..31] Reviewed-by: Richard Levitte --- crypto/rc5/rc5_locl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.25.1