Remove unused USE_FAKE_CRYPTO

This commit is contained in:
zzz
2015-11-23 19:49:56 +00:00
parent 302ec7767a
commit 2400a77e25

View File

@ -38,7 +38,6 @@ import net.i2p.util.SystemVersion;
*/
public class CryptixAESEngine extends AESEngine {
private final static CryptixRijndael_Algorithm _algo = new CryptixRijndael_Algorithm();
private final static boolean USE_FAKE_CRYPTO = false;
// keys are now cached in the SessionKey objects
//private CryptixAESKeyCache _cache;
@ -103,12 +102,6 @@ public class CryptixAESEngine extends AESEngine {
if (length % 16 != 0)
throw new IllegalArgumentException("Only lengths mod 16 are supported here");
if (USE_FAKE_CRYPTO) {
_log.warn("AES Crypto disabled! Using trivial XOR");
System.arraycopy(payload, payloadIndex, out, outIndex, length);
return;
}
if (USE_SYSTEM_AES && length >= MIN_SYSTEM_AES_LENGTH) {
try {
SecretKeySpec key = new SecretKeySpec(sessionKey.getData(), "AES");
@ -156,12 +149,6 @@ public class CryptixAESEngine extends AESEngine {
throw new IllegalArgumentException("out is too small (out.length=" + out.length
+ " outIndex=" + outIndex + " length=" + length);
if (USE_FAKE_CRYPTO) {
_log.warn("AES Crypto disabled! Using trivial XOR");
System.arraycopy(payload, payloadIndex, out, outIndex, length);
return ;
}
if (USE_SYSTEM_AES && length >= MIN_SYSTEM_AES_LENGTH) {
try {
SecretKeySpec key = new SecretKeySpec(sessionKey.getData(), "AES");