]> git.codecow.com Git - Monocypher.git/commit
chacha20_*_ctr functions now return the new ctr
authorLoup Vaillant <loup@loup-vaillant.fr>
Sat, 30 Nov 2019 23:08:08 +0000 (00:08 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sat, 30 Nov 2019 23:08:08 +0000 (00:08 +0100)
commitc1ce546cef3c86112f76fd6e0759916203d691b9
tree0515ab08ff36aa794f9cf11c903767cf3cad31e2
parent630dc848a57a4dd5b4cc6074379a57e9c02dbaf9
chacha20_*_ctr functions now return the new ctr

This should facilitate building piecemeal streams.  Normally you'd just
increment the nonce, but in some (admittedly rare) cases we may want to
increment the counter instead.

Incrementing the counter is fairly dangerous, because we may overlap the
streams, thus revealing the XOR of two pieces of plain text. Using the
new return value makes sure this doesn't happen.
src/monocypher.c
src/monocypher.h
tests/test.c