I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit e973185b authored by zzz's avatar zzz
Browse files

Crypto: Initialize array earlier (ticket #1989)

parent 040af114
No related branches found
No related tags found
No related merge requests found
......@@ -569,15 +569,19 @@ public final class CryptixRijndael_Algorithm // implicit no-argument constructor
int KC = k.length / 4;
int[] tk; // new int[KC];
int i, j;
// the return value
Object[] sessionKey;
if (keyData == null) {
Ke = new int[ROUNDS + 1][BC];
Kd = new int[ROUNDS + 1][BC];
tk = new int[KC];
sessionKey = new Object[] { Ke, Kd};
} else {
Ke = keyData.Ke;
Kd = keyData.Kd;
tk = keyData.tk;
sessionKey = keyData.key;
}
// copy user material bytes into temporary ints
......@@ -636,14 +640,6 @@ public final class CryptixRijndael_Algorithm // implicit no-argument constructor
Kd[r][j] = _U1[(tt >>> 24) & 0xFF] ^ _U2[(tt >>> 16) & 0xFF] ^ _U3[(tt >>> 8) & 0xFF] ^ _U4[tt & 0xFF];
}
}
// assemble the encryption (Ke) and decryption (Kd) round keys into
// one sessionKey object
Object[] sessionKey;
if (keyData == null)
sessionKey = new Object[] { Ke, Kd};
else
sessionKey = keyData.key;
//if (_RDEBUG) trace(_OUT, "makeKey()");
return sessionKey;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment