0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00

Add ECPublicKey.generate

This commit is contained in:
Jack Lloyd 2020-11-05 17:32:28 -05:00
parent 4db424c3b2
commit a3f5b64257
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ public class Curve {
public static final int DJB_TYPE = 0x05;
public static ECKeyPair generateKeyPair() {
ECPrivateKey privateKey = new ECPrivateKey();
ECPrivateKey privateKey = ECPrivateKey.generate();
ECPublicKey publicKey = privateKey.publicKey();
return new ECKeyPair(publicKey, privateKey);
}

View File

@ -10,8 +10,8 @@ import org.signal.client.internal.Native;
public class ECPrivateKey {
private long handle;
ECPrivateKey() {
this.handle = Native.ECPrivateKey_Generate();
static ECPrivateKey generate() {
return new ECPrivateKey(Native.ECPrivateKey_Generate());
}
ECPrivateKey(byte[] privateKey) {