• Generate ChaCha20 stream for the given 32-byte key and 8-byte or 12-byte nonce and write it into dst and return it.

    Never use the same key and nonce to generate more than one stream.

    If nonceInplaceCounterLength is not 0, it behaves the same with respect to the nonce as described in the streamXOR documentation.

    stream is like streamXOR with all-zero src.

    Parameters

    • key: Uint8Array
    • nonce: Uint8Array
    • dst: Uint8Array
    • nonceInplaceCounterLength: number = 0

    Returns Uint8Array