ChaCha20

expect object ChaCha20

ChaCha20 stream cipher implementation.

ChaCha20 is a high-speed stream cipher designed by Daniel J. Bernstein. Used in NIP-44 for encrypting/decrypting Nostr messages.

See also

actual object ChaCha20
actual object ChaCha20

Functions

Link copied to clipboard
expect fun decrypt(ciphertext: ByteArray, key: ByteArray, nonce: ByteArray): ByteArray

Decrypts ciphertext using ChaCha20.

actual fun decrypt(ciphertext: ByteArray, key: ByteArray, nonce: ByteArray): ByteArray
actual fun decrypt(ciphertext: ByteArray, key: ByteArray, nonce: ByteArray): ByteArray
Link copied to clipboard
expect fun encrypt(plaintext: ByteArray, key: ByteArray, nonce: ByteArray): ByteArray

Encrypts plaintext using ChaCha20.

actual fun encrypt(plaintext: ByteArray, key: ByteArray, nonce: ByteArray): ByteArray
actual fun encrypt(plaintext: ByteArray, key: ByteArray, nonce: ByteArray): ByteArray