Commit Graph

7 Commits

Author SHA1 Message Date
Daniel King
f589275d80 Minor style and formatting fixes.
This change corrects some minor style violations, mostly for spacing
around parentheses.
2018-05-10 13:22:14 +02:00
Daniel King
47252c739d Correct signedness of printf specifier in self tests 2018-05-10 13:22:14 +02:00
Daniel King
d00afaf2ba Adjust verbose self-test output to match other ciphers. 2018-05-10 13:21:40 +02:00
Daniel King
f28c2aa64e Allow some parameters to be NULL if the length is 0.
This change permits users of the ChaCha20/Poly1305 algorithms
(and the AEAD construction thereof) to pass NULL pointers for
data that they do not need, and avoids the need to provide a valid
buffer for data that is not used.
2018-05-10 13:20:52 +02:00
Daniel King
31ac12e004 Implement AEAD-ChaCha20-Poly1305.
This implementation is based off the description in RFC 7539.

The ChaCha20 code is also updated to provide a means of generating
keystream blocks with arbitrary counter values. This is used to
generated the one-time Poly1305 key in the AEAD construction.
2018-05-10 13:20:52 +02:00
Daniel King
0fe7b5b8c5 Add ChaCha20 to the Cipher module 2018-05-10 13:19:31 +02:00
Daniel King
a98ff5eadf Initial implementation of ChaCha20 2018-05-10 13:19:31 +02:00