Cleared UB in cast.cpp due to use of rotVariable. On PowerPC, the specialization that uses inline assembler will activate. The inline assembly uses __rlwnm which takes a mask and does not suffer C/C++ UB
parent
ac0f94c23a
commit
7b629dcfa6
6
cast.cpp
6
cast.cpp
|
|
@ -15,15 +15,15 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
|
||||
/* CAST uses three different round functions */
|
||||
#define f1(l, r, km, kr) \
|
||||
t = rotlVariable(km + r, kr); \
|
||||
t = rotlMod(km + r, kr); \
|
||||
l ^= ((S[0][U8a(t)] ^ S[1][U8b(t)]) - \
|
||||
S[2][U8c(t)]) + S[3][U8d(t)];
|
||||
#define f2(l, r, km, kr) \
|
||||
t = rotlVariable(km ^ r, kr); \
|
||||
t = rotlMod(km ^ r, kr); \
|
||||
l ^= ((S[0][U8a(t)] - S[1][U8b(t)]) + \
|
||||
S[2][U8c(t)]) ^ S[3][U8d(t)];
|
||||
#define f3(l, r, km, kr) \
|
||||
t = rotlVariable(km - r, kr); \
|
||||
t = rotlMod(km - r, kr); \
|
||||
l ^= ((S[0][U8a(t)] + S[1][U8b(t)]) ^ \
|
||||
S[2][U8c(t)]) - S[3][U8d(t)];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue