@Override
    public KeyPair generateKeyPair() {
        byte[] publicKeyBytes = new byte[32];
        byte[] privateKeyBytes = new byte[64];

        NativeCrypto.ED25519_keypair(publicKeyBytes, privateKeyBytes);

        // BoringSSL uses a 64-byte private key. We only need the seed, which is the first 32 bytes.
        byte[] privateKeySeed = Arrays.copyOf(privateKeyBytes, 32);

        return new KeyPair(new OpenSslEdDsaPublicKey(publicKeyBytes),
                new OpenSslEdDsaPrivateKey(privateKeySeed));
    }
An implementation of {@link KeyPairGenerator} for XDH keys which uses BoringSSL to perform all
the operations. This only supports EdDSA keys.
common/src/main/java/org/conscrypt/OpenSslEdDsaKeyPairGenerator.java