2 Commits

Author SHA1 Message Date
Frank Denis
7f9e3e419c Use @reduce 2020-11-07 20:30:13 +01:00
Frank Denis
bd07154242 Add mem.timingSafeEql() for constant-time array comparison
This is a trivial implementation that just does a or[xor] loop.

However, this pattern is used by virtually all crypto libraries and
in practice, even without assembly barriers, LLVM never turns it into
code with conditional jumps, even if one of the parameters is constant.

This has been verified to still be the case with LLVM 11.0.0.
2020-11-07 20:18:43 +01:00