diff options
Diffstat (limited to 'app/src/main/java/com/wireguard/crypto/Keypair.java')
-rw-r--r-- | app/src/main/java/com/wireguard/crypto/Keypair.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/src/main/java/com/wireguard/crypto/Keypair.java b/app/src/main/java/com/wireguard/crypto/Keypair.java index 71c7066c..bd6fd90f 100644 --- a/app/src/main/java/com/wireguard/crypto/Keypair.java +++ b/app/src/main/java/com/wireguard/crypto/Keypair.java @@ -1,7 +1,5 @@ package com.wireguard.crypto; -import android.util.Base64; - import java.security.SecureRandom; /** @@ -11,7 +9,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.KEY_LENGTH]; secureRandom.nextBytes(privateKey); privateKey[0] &= 248; privateKey[31] &= 127; @@ -20,7 +18,7 @@ public class Keypair { } private static byte[] generatePublicKey(byte[] privateKey) { - final byte[] publicKey = new byte[KeyEncoding.WG_KEY_LEN]; + final byte[] publicKey = new byte[KeyEncoding.KEY_LENGTH]; Curve25519.eval(publicKey, 0, privateKey, null); return publicKey; } |