hpkeDecrypt

expect fun hpkeDecrypt(cipherSuite: Algorithm, receiverPrivateKey: EcPrivateKey, cipherText: ByteArray, aad: ByteArray, encapsulatedPublicKey: EcPublicKey): ByteArray

Decrypts data using HPKE according to RFC 9180.

The ciphertext and encapsulated key should be received from the sender and both parties must also agree on the AAD to use.

Return

the plaintext.

Parameters

cipherSuite

the cipher suite for selecting the KEM, KDF, and encryption algorithm. Presently only Algorithm.HPKE_BASE_P256_SHA256_AES128GCM is supported.

receiverPrivateKey

the private key of the receiver, curve must match the cipher suite.

cipherText

the data to decrypt.

aad

additional authenticated data.

encapsulatedPublicKey

the encapsulated key.

actual fun hpkeDecrypt(cipherSuite: <Error class: unknown class>, receiverPrivateKey: <Error class: unknown class>, cipherText: ByteArray, aad: ByteArray, encapsulatedPublicKey: <Error class: unknown class>): ByteArray
actual fun hpkeDecrypt(cipherSuite: Algorithm, receiverPrivateKey: EcPrivateKey, cipherText: ByteArray, aad: ByteArray, encapsulatedPublicKey: EcPublicKey): ByteArray

Decrypts data using HPKE according to RFC 9180.

The ciphertext and encapsulated key should be received from the sender and both parties must also agree on the AAD to use.

Return

the plaintext.

Parameters

cipherSuite

the cipher suite for selecting the KEM, KDF, and encryption algorithm. Presently only Algorithm.HPKE_BASE_P256_SHA256_AES128GCM is supported.

receiverPrivateKey

the private key of the receiver, curve must match the cipher suite.

cipherText

the data to decrypt.

aad

additional authenticated data.

encapsulatedPublicKey

the encapsulated key.