decrypt

open suspend override fun decrypt(ciphertext: ByteArray): ByteArray(source)

Decrypts the given ciphertext without associated data and returns the resulting plaintext as a ByteArray.

Throws an exception if the authentication tag verification fails, indicating the ciphertext has been tampered with.

Use decryptBlocking when calling from non-suspending code.


open suspend override fun decrypt(ciphertext: ByteString): ByteString(source)

Decrypts the given ciphertext without associated data and returns the resulting plaintext as a ByteString.

Throws an exception if the authentication tag verification fails, indicating the ciphertext has been tampered with.

Use decryptBlocking when calling from non-suspending code.


open suspend fun decrypt(ciphertext: ByteArray, associatedData: ByteArray?): ByteArray(source)

Decrypts the given ciphertext with optional associatedData and returns the resulting plaintext as a ByteArray.

Throws an exception if the authentication tag verification fails, indicating the ciphertext or associated data has been tampered with.

Use decryptBlocking when calling from non-suspending code.


open suspend fun decrypt(ciphertext: ByteString, associatedData: ByteString?): ByteString(source)

Decrypts the given ciphertext with optional associatedData and returns the resulting plaintext as a ByteString.

Throws an exception if the authentication tag verification fails, indicating the ciphertext or associated data has been tampered with.

Use decryptBlocking when calling from non-suspending code.