aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main/java/com/wireguard/crypto/Keypair.java
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-08-09 02:44:46 -0500
committerSamuel Holland <samuel@sholland.org>2017-08-09 02:44:46 -0500
commitc3afe5be2c0677aa28cd2c9a49b001a5570f321a (patch)
treef6927aca9b3392049d8d60cb8166f4d4562f969d /app/src/main/java/com/wireguard/crypto/Keypair.java
parentConstant time base64 (diff)
downloadwireguard-android-c3afe5be2c0677aa28cd2c9a49b001a5570f321a.tar.xz
wireguard-android-c3afe5be2c0677aa28cd2c9a49b001a5570f321a.zip
Keypair: Convert to java-style array declarations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/crypto/Keypair.java')
-rw-r--r--app/src/main/java/com/wireguard/crypto/Keypair.java12
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);
}