<p><b>@bergzand</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10220#discussion_r253318624">sys/crypto/chacha20poly1305.c</a>:</p>
<pre style='color:#555'>> +        ((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++) {
</pre>
<blockquote>
<p>Is it standard to use just unsigned? Would it be better to specify unsigned int or just size_t?</p>
</blockquote>
<p>IMHO just a personal preference, I don't mind changing it to <code>unsigned int</code>.</p>
<blockquote>
<p>Also maybe you could unroll the loop (I don't know if that can help with compiler optimizations in M4s)?</p>
</blockquote>
<p>I'd really like to leave this as an exercise to the reader if you don't mind :)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/10220#discussion_r253318624">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YHxK_xa8hFgGYAZK5YGo-JyQSosQks5vJ0pkgaJpZM4XyoZ2">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YNIw7gwICFsLG1DCegaEWgLkk1D3ks5vJ0pkgaJpZM4XyoZ2.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/RIOT-OS/RIOT","title":"RIOT-OS/RIOT","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/RIOT-OS/RIOT"}},"updates":{"snippets":[{"icon":"PERSON","message":"@bergzand commented on #10220"}],"action":{"name":"View Pull Request","url":"https://github.com/RIOT-OS/RIOT/pull/10220#discussion_r253318624"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/10220#discussion_r253318624",
"url": "https://github.com/RIOT-OS/RIOT/pull/10220#discussion_r253318624",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>