From c3afe5be2c0677aa28cd2c9a49b001a5570f321a Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Wed, 9 Aug 2017 02:44:46 -0500 Subject: [PATCH] Keypair: Convert to java-style array declarations Signed-off-by: Jason A. Donenfeld --- app/src/main/java/com/wireguard/crypto/Keypair.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/wireguard/crypto/Keypair.java b/app/src/main/java/com/wireguard/crypto/Keypair.java index f98b5e21..71c7066c 100644 --- a/app/src/main/java/com/wireguard/crypto/Keypair.java +++ b/app/src/main/java/com/wireguard/crypto/Keypair.java @@ -11,7 +11,7 @@ import java.security.SecureRandom; public class Keypair { private static byte[] generatePrivateKey() { final SecureRandom secureRandom = new SecureRandom(); - final byte privateKey[] = new byte[KeyEncoding.WG_KEY_LEN]; + final byte[] privateKey = new byte[KeyEncoding.WG_KEY_LEN]; secureRandom.nextBytes(privateKey); privateKey[0] &= 248; privateKey[31] &= 127; @@ -19,20 +19,20 @@ public class Keypair { return privateKey; } - private static byte[] generatePublicKey(byte privateKey[]) { - final byte publicKey[] = new byte[KeyEncoding.WG_KEY_LEN]; + private static byte[] generatePublicKey(byte[] privateKey) { + final byte[] publicKey = new byte[KeyEncoding.WG_KEY_LEN]; Curve25519.eval(publicKey, 0, privateKey, null); return publicKey; } - private final byte privateKey[]; - private final byte publicKey[]; + private final byte[] privateKey; + private final byte[] publicKey; public Keypair() { this(generatePrivateKey()); } - private Keypair(byte privateKey[]) { + private Keypair(byte[] privateKey) { this.privateKey = privateKey; publicKey = generatePublicKey(privateKey); }