fix multi2 as proposed by kmx

This commit is contained in:
Steffen Jaeckel 2012-11-18 18:44:14 +01:00
parent 8cda684a0e
commit 21ddcf3568

View File

@ -94,8 +94,8 @@ static void encrypt(ulong32 *p, int N, ulong32 *uk)
static void decrypt(ulong32 *p, int N, ulong32 *uk)
{
int n, t;
for (t = 4*((N&1)^1), n = N; ; ) {
switch (n >= 4 ? 4 : 0) {
for (t = 4*(((N-1)>>2)&1), n = N; ; ) {
switch (n<=4 ? n : ((n-1)%4)+1) {
case 4: pi4(p, uk+t); --n;
case 3: pi3(p, uk+t); --n;
case 2: pi2(p, uk+t); --n;