Using word32 for bitfied manimulation instead of mixing signed and unsigned.

This commit is contained in:
clemahieu 2017-01-24 10:23:23 -06:00
commit f13fd15364

View file

@ -20,18 +20,18 @@ inline word32 WAKE_Base::M(word32 x, word32 y)
void WAKE_Base::GenKey(word32 k0, word32 k1, word32 k2, word32 k3)
{
// this code is mostly copied from David Wheeler's paper "A Bulk Data Encryption Algorithm"
signed int x, z, p;
word32 x, z, p;
// x and z were declared as "long" in Wheeler's paper, which is a signed type. I don't know if that was intentional, but it's too late to change it now. -- Wei 7/4/2010
CRYPTOPP_COMPILE_ASSERT(sizeof(x) == 4);
static int tt[10]= {
(int)0x726a8f3b, // table
(int)0xe69a3b5c,
(int)0xd3c71fe5,
(int)0xab3c73d2,
(int)0x4d3a8eb3,
(int)0x0396d6e8,
(int)0x3d4c2f7a,
(int)0x9ee27cf3, } ;
word32 tt[10]= {
0x726a8f3bu, // table
0xe69a3b5cu,
0xd3c71fe5u,
0xab3c73d2u,
0x4d3a8eb3u,
0x0396d6e8u,
0x3d4c2f7au,
0x9ee27cf3u, } ;
t[0] = k0;
t[1] = k1;
t[2] = k2;