]> git.ipfire.org Git - thirdparty/nettle.git/commit
chacha: add variant that treats counter value as 32-bit
authorDaiki Ueno <dueno@redhat.com>
Mon, 9 Mar 2020 12:01:18 +0000 (13:01 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 9 Mar 2020 18:09:18 +0000 (19:09 +0100)
commit2176ccc158d220f2884a10980266899c495b77be
treeb911b0287da426c48957d6c47c125c8c697e1126
parenta9894036fc5e3c972d751ea28e64e23ddc77fc37
chacha: add variant that treats counter value as 32-bit

The ChaCha-Poly1305 implementation previously used the chacha_crypt
function that assumes the block counter is 64-bit long, while RFC 8439
defines that the counter is 32-bit long.  Although this should be fine
as long as up to 256 gigabytes of data is encrypted with the same key,
it would be nice to use a separate functions (chacha_set_counter32 and
chacha_crypt32) that assume the counter is 32-bit long.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
chacha-crypt.c
chacha-poly1305.c
chacha-set-nonce.c
chacha.h
nettle.texinfo
testsuite/chacha-test.c