]> git.codecow.com Git - Monocypher.git/commit
Removed 64-bit modulo operation in Argon2i
authorLoup Vaillant <loup@loup-vaillant.fr>
Fri, 14 Feb 2020 23:16:45 +0000 (00:16 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 14 Feb 2020 23:26:10 +0000 (00:26 +0100)
commita5af36668740029a6440d7ac61fd236b4b540646
treeac0421dd612517511918babd385a12879b9724c6
parentb2ae66221fe8150f864f2b706cdf6ce6bb6af380
Removed 64-bit modulo operation in Argon2i

Fixes #156

This modulo operation is implemented on software in many 32-bits
processors, such as the Cortex-M3.  This causes the generated binary to
depend a standard library routine that is often not present on such
small machines.  This hurts portability and convenience.

Thankfully, this particular modulo is not needed, and can be replaced by
a simple test and subtraction. This is not constant time, but we don't
care: the index we are computing does not depend on any secret, so a
variable timing won't expose anything.

Performance seems to very slightly increase on x86-64. 32-bit machines
may benefit more.
src/monocypher.c