Re: [PATCH v1 2/3] zinc: Introduce minimal cryptography library

From: Jason A. Donenfeld
Date: Fri Aug 03 2018 - 18:10:18 EST


On Fri, Aug 3, 2018 at 11:29 PM Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:
> Gotcha. That was very hidden in the 24k lines. Please make this (and
> any similar goodies) be their own patches.

I know, sorry, and I certainly will have this split out. The above
code snippet was from the much much shorter WireGuard patch (3/3), but
indeed the simd_get/put/relax code is in the monster patch here, so
that'll certainly be split for v2.

>
> Also, please consider spelling it differently:
>
> simd_context_t simd_context = simd_get();
>
> Because we'll feel very silly the first time some architecture has
> more than one possible state. (It wouldn't be entirely insane for x86
> to distinguish between "no SIMD", "XMM only", and "go to town!", for
> example.)

That's a great idea. It'll also make it clearer that users shouldn't
just dump a raw "true" in there; raw bools are more tempting to abuse
like that.