forked from I2P_Developers/i2p.i2p
properly fake-encrypt the data (this class is only used by the simulator or anything else w/ -Di2p.encryption=off)
This commit is contained in:
@@ -45,7 +45,11 @@ public class AESEngine {
|
|||||||
if ((initializationVector == null) || (payload == null) || (sessionKey == null)
|
if ((initializationVector == null) || (payload == null) || (sessionKey == null)
|
||||||
|| (initializationVector.length != 16)) return null;
|
|| (initializationVector.length != 16)) return null;
|
||||||
|
|
||||||
byte cyphertext[] = new byte[payload.length + (16 - (payload.length % 16))];
|
byte cyphertext[] = null;
|
||||||
|
if ((payload.length % 16) == 0)
|
||||||
|
cyphertext = new byte[payload.length];
|
||||||
|
else
|
||||||
|
cyphertext = new byte[payload.length + (16 - (payload.length % 16))];
|
||||||
System.arraycopy(payload, 0, cyphertext, 0, payload.length);
|
System.arraycopy(payload, 0, cyphertext, 0, payload.length);
|
||||||
return cyphertext;
|
return cyphertext;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user