Skip to content

Commit e378985

Browse files
committed
Use proper 'public' API
1 parent 0379120 commit e378985

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tls/src/main/java/org/bouncycastle/tls/crypto/impl/bc/BcX25519.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public BcX25519(BcTlsCrypto crypto)
2525

2626
public byte[] generateEphemeral() throws IOException
2727
{
28-
crypto.getSecureRandom().nextBytes(privateKey);
28+
X25519.generatePrivateKey(crypto.getSecureRandom(), privateKey);
2929

3030
byte[] publicKey = new byte[X25519.POINT_SIZE];
31-
X25519.scalarMultBase(privateKey, 0, publicKey, 0);
31+
X25519.generatePublicKey(privateKey, 0, publicKey, 0);
3232
return publicKey;
3333
}
3434

tls/src/main/java/org/bouncycastle/tls/crypto/impl/bc/BcX448.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public BcX448(BcTlsCrypto crypto)
2525

2626
public byte[] generateEphemeral() throws IOException
2727
{
28-
crypto.getSecureRandom().nextBytes(privateKey);
28+
X448.generatePrivateKey(crypto.getSecureRandom(), privateKey);
2929

3030
byte[] publicKey = new byte[X448.POINT_SIZE];
31-
X448.scalarMultBase(privateKey, 0, publicKey, 0);
31+
X448.generatePublicKey(privateKey, 0, publicKey, 0);
3232
return publicKey;
3333
}
3434

0 commit comments

Comments
 (0)