@Override
  public byte[] decrypt(final byte[] ciphertext, final byte[] contextInfo)
      throws GeneralSecurityException {
    int modSizeInBytes = RsaKem.bigIntSizeInBytes(recipientPrivateKey.getModulus());
    if (ciphertext.length < modSizeInBytes) {
      throw new GeneralSecurityException(
          String.format(
              "Ciphertext must be of at least size %d bytes, but got %d",
              modSizeInBytes, ciphertext.length));
    }

    // Decrypt the token to obtain the raw shared secret.
    ByteBuffer cipherBuffer = ByteBuffer.wrap(ciphertext);
    byte[] token = new byte[modSizeInBytes];
    cipherBuffer.get(token);
    Cipher rsaCipher = Cipher.getInstance("RSA/ECB/NoPadding");
    rsaCipher.init(Cipher.DECRYPT_MODE, recipientPrivateKey);
    byte[] sharedSecret = rsaCipher.doFinal(token);

    // KDF: derive a DEM key from the shared secret, salt, and contextInfo.
    byte[] demKey =
        Hkdf.computeHkdf(
            hkdfHmacAlgo, sharedSecret, hkdfSalt, contextInfo, aeadFactory.getKeySizeInBytes());

    // DEM: decrypt the payload.
    Aead aead = aeadFactory.createAead(demKey);
    byte[] demPayload = new byte[cipherBuffer.remaining()];
    cipherBuffer.get(demPayload);
    return aead.decrypt(demPayload, RsaKem.EMPTY_AAD);
  }
Hybrid encryption with RSA-KEM as defined in Shoup's ISO standard proposal as KEM, and AEAD as
DEM and HKDF as KDF.

<p>Shoup's ISO standard proposal is available at https://www.shoup.net/iso/std6.pdf.
java_src/src/main/java/com/google/crypto/tink/hybrid/subtle/RsaKemHybridDecrypt.java