summaryrefslogtreecommitdiffhomepage
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-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);
}