@Override
  public byte[] authDecapsulate(
      byte[] encapsulatedKey, HpkeKemPrivateKey recipientPrivateKey, byte[] senderPublicKey)
      throws GeneralSecurityException {
    ECPrivateKey privateKey =
        EllipticCurves.getEcPrivateKey(
            curve, recipientPrivateKey.getSerializedPrivate().toByteArray());
    ECPublicKey senderEphemeralPublicKey =
        EllipticCurves.getEcPublicKey(curve, PointFormatType.UNCOMPRESSED, encapsulatedKey);

    byte[] dhSharedSecret =
        Bytes.concat(
            EllipticCurves.computeSharedSecret(privateKey, senderEphemeralPublicKey),
            EllipticCurves.computeSharedSecret(
                privateKey,
                EllipticCurves.getEcPublicKey(
                    curve, PointFormatType.UNCOMPRESSED, senderPublicKey)));
    return deriveKemSharedSecret(
        dhSharedSecret,
        encapsulatedKey,
        recipientPrivateKey.getSerializedPublic().toByteArray(),
        senderPublicKey);
  }
Helper function factored out to facilitate unit testing.
java_src/src/main/java/com/google/crypto/tink/hybrid/internal/NistCurvesHpkeKem.java