@AccessesPartialKey
  public static HybridDecrypt create(EciesPrivateKey key) throws GeneralSecurityException {
    EllipticCurves.CurveType curveType =
        EciesAeadHkdfHybridEncrypt.CURVE_TYPE_CONVERTER.toProtoEnum(
            key.getParameters().getCurveType());
    ECPrivateKey recipientPrivateKey =
        EllipticCurves.getEcPrivateKey(
            curveType,
            BigIntegerEncoding.toBigEndianBytes(
                key.getNistPrivateKeyValue().getBigInteger(InsecureSecretKeyAccess.get())));
    byte[] hkdfSalt = new byte[0];
    if (key.getParameters().getSalt() != null) {
      hkdfSalt = key.getParameters().getSalt().toByteArray();
    }
    return new EciesAeadHkdfHybridDecrypt(
        recipientPrivateKey,
        hkdfSalt,
        EciesAeadHkdfHybridEncrypt.toHmacAlgo(key.getParameters().getHashType()),
        EciesAeadHkdfHybridEncrypt.POINT_FORMAT_TYPE_CONVERTER.toProtoEnum(
            key.getParameters().getNistCurvePointFormat()),
        EciesAeadHkdfHybridEncrypt.createHelper(key.getParameters().getDemParameters()),
        key.getOutputPrefix().toByteArray());
  }
ECIES encryption with HKDF-KEM (key encapsulation mechanism) and AEAD-DEM (data encapsulation
mechanism).

@since 1.0.0
java_src/src/main/java/com/google/crypto/tink/subtle/EciesAeadHkdfHybridDecrypt.java