New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Chacha20 cipher, and poly1305 mac #72
Conversation
A second commit adds the poly1305 mac. Another extension (AEAD construction of poy1305/chacha20) is on its way. I'm curious about feedback in respect to the 1305 interface. NB: manually ensured that 598fd89 compiles (and test run) fine on a 32bit switch. |
that's it, again ensured manually that 036c143 compiles and works on a 32bit switch. |
Differences include: - OCaml API (no separate expand and encrypt/decrypt), - support for IETF mode (nonce 12 bytes, counter 32bit) - reduced allocation overhead
This mostly fits into a hash algorithm, but only computes a mac. The difference is that val empty has a key argument to initialize the context. This is based on https://github.com/floodyberry/poly1305-donna.git
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redo my approval with changes.
…mirage-crypto-rng-mirage (0.8.1) CHANGES: * Add Chacha20 implementation (based on abeaumont/ocaml-chacha), supporting both DJB's original specification (nonce 64 bit, counter 64 bit) and IETF (RFC 8439: nonce 96 bit, counter 32 bit) (mirage/mirage-crypto#72 @hannesm) * Add Poly1305 implementation based on floodyberry/poly1305-donna (mirage/mirage-crypto#72 @hannesm) * Unified AEAD module type, implemented by CCM, GCM, and Chacha20/Poly1305 The functions "authenticate_encrypt" and "authenticate_decrypt" are defined, which append (encrypt) and check equality (decrypt, using Eqaf for constant-time comparison) the authentication tag directly. Breaking changes: - GCM "~iv" is now "~nonce" - GCM encrypt returns the encrypted data and authentication tag appended - GCM decrypt returns the plaintext as option (None on authentication failure) (mirage/mirage-crypto#73 @hannesm)
Add Chacha20 cipher, and poly1305 mac
Differences include: