diff options
author | Samuel Holland <samuel@sholland.org> | 2017-08-09 02:44:46 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-08-09 02:44:46 -0500 |
commit | bd3e665aebd25e7d9fda3b7cd1edc7352f79283f (patch) | |
tree | f6927aca9b3392049d8d60cb8166f4d4562f969d /app/src/main/java/com/wireguard | |
parent | 5083a0175438db7e15ef8996261f8e51e39570c7 (diff) |
Keypair: Convert to java-style array declarations
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r-- | app/src/main/java/com/wireguard/crypto/Keypair.java | 12 |
1 files 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); } |