diff options
| author | Frank Denis <github@pureftpd.org> | 2020-08-23 01:36:37 +0200 |
|---|---|---|
| committer | Frank Denis <github@pureftpd.org> | 2020-11-07 20:18:43 +0100 |
| commit | bd07154242664e9d25ba60333e1a497562aa7c27 (patch) | |
| tree | e636fb1dce620013b041a0226509ae0057d4939f /lib/std/std.zig | |
| parent | 03ae77b8b02eef4da09a6b0de12d6fb0192b81d4 (diff) | |
| download | zig-bd07154242664e9d25ba60333e1a497562aa7c27.tar.gz zig-bd07154242664e9d25ba60333e1a497562aa7c27.zip | |
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.
Diffstat (limited to 'lib/std/std.zig')
0 files changed, 0 insertions, 0 deletions
