why copyOf(), when its a new byte[] anyway

This commit is contained in:
Shikhar Bhushan
2010-03-21 14:46:35 +01:00
parent 8e9a773e92
commit 49e3d4ec27

View File

@@ -35,7 +35,6 @@
*/ */
package net.schmizz.sshj.transport.kex; package net.schmizz.sshj.transport.kex;
import net.schmizz.sshj.common.ByteArrayUtils;
import net.schmizz.sshj.common.SSHRuntimeException; import net.schmizz.sshj.common.SSHRuntimeException;
import net.schmizz.sshj.common.SecurityUtils; import net.schmizz.sshj.common.SecurityUtils;
@@ -95,7 +94,7 @@ public class DH {
} }
e = ((javax.crypto.interfaces.DHPublicKey) myKpair.getPublic()).getY(); e = ((javax.crypto.interfaces.DHPublicKey) myKpair.getPublic()).getY();
} }
return ByteArrayUtils.copyOf(e.toByteArray()); return e.toByteArray();
} }
public byte[] getK() { public byte[] getK() {
@@ -110,7 +109,7 @@ public class DH {
} }
K = new BigInteger(myKeyAgree.generateSecret()); K = new BigInteger(myKeyAgree.generateSecret());
} }
return ByteArrayUtils.copyOf(K.toByteArray()); return K.toByteArray();
} }
} }