chacha20-crypt ( data key nonce counter -- result )
ChaCha20 stream cipher

Next:chacha20-crypt-bytes ( data key-bytes nonce-bytes counter -- result )


Vocabulary
crypto.chacha20

Inputs
dataa byte-array
key8 u32 values (256 bits)
nonce3 u32 values (96 bits)
counterstarting block counter


Outputs
resulta byte-array


Word description
Encrypts or decrypts data using ChaCha20. XOR is symmetric, so the same function works for both encryption and decryption.

Examples
USING: byte-arrays crypto.chacha20 ; "Hello" >byte-array 8 0 <array> 3 0 <array> 1 chacha20-crypt 8 0 <array> 3 0 <array> 1 chacha20-crypt >string
! => "Hello"


Definition