]> git.codecow.com Git - Monocypher.git/commit
Hoisted negations out of loops
authorLoup Vaillant <loup@loup-vaillant.fr>
Mon, 29 Jul 2019 22:43:35 +0000 (00:43 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Mon, 29 Jul 2019 22:43:35 +0000 (00:43 +0200)
commitc5b95903146e51d1498e954cbc66c8e3ff391699
treedecd7515c377b29778be8d39ca3cfc88404b8fc7
parenta7e2ce5144f6b964a5f4cf3364a9c91c761919f5
Hoisted negations out of loops

Turns out compilers don't do this naturally, and this leads to
observable slow downs in some cases.

Also noted that we are relying on 2's complement representation (we
already were).  We could be more portable by going unsigned, but by this
logic the entire field arithmetic should go unsigned.  It's possible,
but it's not trivial.  I've kinda tried it in the past, and failed.

Every architecture of interest is 2's complement anyway, so I think this
will be good enough.
src/monocypher.c