@Override
  public HpkeKemEncapOutput authEncapsulate(
      byte[] recipientPublicKey, HpkeKemPrivateKey senderPrivateKey)
      throws GeneralSecurityException {
    KeyPair keyPair = EllipticCurves.generateKeyPair(curve);
    return authEncapsulate(recipientPublicKey, keyPair, senderPrivateKey);
  }
Helper function factored out to facilitate unit testing.
java_src/src/main/java/com/google/crypto/tink/hybrid/internal/NistCurvesHpkeKem.java