• Generate XChaCha20 stream for the given 32-byte key and 12-byte nonce (last 8 bytes of 24 byte nonce prefixed with 4 zero bytes) and write it into dst and return it.

    Nonces MUST be generated using an CSPRNG to generate a sufficiently random nonce such that a collision is highly unlikely to occur.

    stream is like streamXOR with all-zero src.

    Parameters

    • key: Uint8Array
    • nonce: Uint8Array
    • dst: Uint8Array

    Returns Uint8Array