What happens when output of chacha20 is also its input? #1095
-
In the code below, ChaCha20 is told to encrypt input (read from /* allocate memories */
unsigned char *mem = sodium_malloc(mem_size);
unsigned char *nonce = sodium_malloc(crypto_..._NONCEBYTES);
unsigned char *key = sodium_malloc(crypto_..._KEYBYTES);
... (e.g. initialise memories)
crypto_stream_chacha20_xor(mem, mem, mem_size, nonce, key);
... (e.g. increment nonce) My thought: From my reading of My questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is guaranteed to work. The docs:
|
Beta Was this translation helpful? Give feedback.
This is guaranteed to work. The docs: