X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=keccak%2Frotate64.h;h=a80d2b5e39025afa7f1f85fa9593a7cf1a5692ab;hb=701d813c99a7bd164e98f82c5651e6e7bdab404a;hp=4d60c4ce3ed24460c68bcef765039d26c2551ae3;hpb=25ccd391d2f02575799e94bf9aac1e108e7c0f3b;p=avr-crypto-lib.git diff --git a/keccak/rotate64.h b/keccak/rotate64.h index 4d60c4c..a80d2b5 100644 --- a/keccak/rotate64.h +++ b/keccak/rotate64.h @@ -33,11 +33,11 @@ #define ROTR_3 (8+3) -#define ROT_BIT(a) (((a)<=4)?((a)<<1):(0x01|((8-(a))<<1))) +#define ROT_BIT(a) (((a) <= 4) ? ((a) << 1) : (0x01 | ((8 - (a)) << 1))) //#define ROT_CODE(a,b) (((a)<<4) | ((b)&0x0f)) -#define ROT_CODE(a) ((((a)/8+((((a)%8)>4)?1:0))<<4) | ROT_BIT(((a)%8))) +#define ROT_CODE(a) ((((a) / 8 + ((((a) % 8) > 4) ? 1 : 0)) << 4) | ROT_BIT(((a) % 8))) //#define ROT_CODE(a) ((((a)/8)<<4) | ((a)%8)) /* rotations only to the left */ uint64_t rotate64_1bit_left(uint64_t a);