NTCP2: Remove debug code

This commit is contained in:
zzz
2018-08-02 11:48:55 +00:00
parent 2e85c2387c
commit 8fb7bd264f
4 changed files with 0 additions and 37 deletions
@@ -41,8 +41,6 @@ public class ChaChaPolyCipherState implements CipherState {
private final byte[] polyKey;
private long n;
private boolean haskey;
// I2P debug to be removed
private byte[] initialKey;
/**
* Constructs a new cipher state for the "ChaChaPoly" algorithm.
@@ -82,9 +80,6 @@ public class ChaChaPolyCipherState implements CipherState {
@Override
public void initializeKey(byte[] key, int offset) {
// I2P debug to be removed
initialKey = new byte[32];
System.arraycopy(key, 0, initialKey, 0, 32);
ChaChaCore.initKey256(input, key, offset);
n = 0;
haskey = true;
@@ -293,16 +288,6 @@ public class ChaChaPolyCipherState implements CipherState {
n = nonce;
}
/**
* I2P debug to be removed
* @return null if none yet
*/
public byte[] getKey() {
if (!haskey)
return null;
return initialKey;
}
/**
* I2P debug
*/
@@ -312,13 +297,6 @@ public class ChaChaPolyCipherState implements CipherState {
buf.append(" Cipher State:\n" +
" nonce: ");
buf.append(n);
buf.append("\n" +
" init key: ");
// I2P debug to be removed
if (haskey)
buf.append(net.i2p.data.Base64.encode(initialKey));
else
buf.append("null");
buf.append("\n poly key: ");
if (haskey)
buf.append(net.i2p.data.Base64.encode(polyKey));
@@ -155,9 +155,4 @@ public interface CipherState extends Destroyable {
* value goes backwards then security may be compromised.
*/
void setNonce(long nonce);
/**
* I2P debug to be removed
*/
public byte[] getKey();
}