[riot-notifications] [RIOT-OS/RIOT] chacha20poly1305: Initial implementation of AEAD cipher. (#10220)

MrKevinWeiss notifications at github.com
Mon Feb 4 08:46:50 CET 2019


MrKevinWeiss commented on this pull request.



> +        ((uint32_t)p[2] << 16) |
+        ((uint32_t)p[3] << 24));
+}
+
+/* Single round */
+void _r(uint32_t *a, uint32_t *b, uint32_t *d, unsigned c)
+{
+    *a += *b;
+    uint32_t tmp = *a ^ *d;
+    *d = (tmp << c) | (tmp >> (32 - c));
+}
+
+void _add_initial(chacha20poly1305_ctx_t *ctx, const uint8_t *key,
+                  const uint8_t *nonce, uint32_t blk)
+{
+    for (unsigned i = 0; i < 4; i++) {

sure thing!

> +        ((uint32_t)p[2] << 16) |
+        ((uint32_t)p[3] << 24));
+}
+
+/* Single round */
+void _r(uint32_t *a, uint32_t *b, uint32_t *d, unsigned c)
+{
+    *a += *b;
+    uint32_t tmp = *a ^ *d;
+    *d = (tmp << c) | (tmp >> (32 - c));
+}
+
+void _add_initial(chacha20poly1305_ctx_t *ctx, const uint8_t *key,
+                  const uint8_t *nonce, uint32_t blk)
+{
+    for (unsigned i = 0; i < 4; i++) {

Sure thing!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10220#discussion_r253368405
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190203/e87314dd/attachment.html>


More information about the notifications mailing list