zig/lib/std/crypto
Frank Denis 7cfeae1ce7
std.crypto.onetimeauth.ghash: faster GHASH on modern CPUs (#13566)
* std.crypto.onetimeauth.ghash: faster GHASH on modern CPUs

Carryless multiplication was slow on older Intel CPUs, justifying
the need for using Karatsuba multiplication.

This is not the case any more; using 4 multiplications to multiply
two 128-bit numbers is actually faster than 3 multiplications +
shifts and additions.

This is also true on aarch64.

Keep using Karatsuba only when targeting x86 (granted, this is a bit
of a brutal shortcut, we should really list all the CPU models that
had a slow clmul instruction).

Also remove useless agg_2 treshold and restore the ability to
precompute only H and H^2 in ReleaseSmall.

Finally, avoid using u256. Using 128-bit registers is actually faster.

* Use a switch, add some comments
2022-11-17 13:07:07 +01:00
..
25519 ed25519: recommend using the seed to recover a key pair 2022-11-01 07:26:32 +01:00
aes crypto.core.aes: process 6 block in parallel instead of 8 on aarch64 (#13473) 2022-11-07 12:28:37 +01:00
pcurves std.crypto.ecc: add support for the secp256k1 curve (#11880) 2022-06-29 15:11:33 +02:00
aegis.zig
aes.zig
aes_gcm.zig crypto.AesGcm: provision ghash for the final block 2022-11-11 18:04:22 +01:00
aes_ocb.zig stage2+stage1: remove type parameter from bit builtins 2022-08-22 11:19:20 +03:00
argon2.zig std.crypto: fix invalid pass by value 2022-06-20 15:11:22 +03:00
bcrypt.zig crypto.bcrypt: fix massive speed regression when using stage2 (#13518) 2022-11-14 16:37:19 +01:00
benchmark.zig Revamp the ed25519 API (#13309) 2022-10-27 19:07:42 +02:00
blake2.zig
blake3.zig std: avoid vector usage with the C backend 2022-11-01 20:38:37 -04:00
chacha20.zig
ecdsa.zig std.sign.ecdsa: add support for incremental signatures (#13332) 2022-10-28 16:25:37 +02:00
errors.zig
ghash.zig std.crypto.onetimeauth.ghash: faster GHASH on modern CPUs (#13566) 2022-11-17 13:07:07 +01:00
gimli.zig std: avoid vector usage with the C backend 2022-11-01 20:38:37 -04:00
hash_composition.zig std.crypto.hash: allow creating hash functions from compositions (#11965) 2022-07-01 11:37:41 +02:00
hkdf.zig
hmac.zig
isap.zig
md5.zig
modes.zig
pbkdf2.zig
phc_encoding.zig std.fmt: require specifier for unwrapping ?T and E!T 2022-07-26 11:25:49 -07:00
poly1305.zig
salsa20.zig crypto.salsa20: make the number of rounds a comptime parameter (#13442) 2022-11-06 23:52:41 +01:00
scrypt.zig std.mem: add first method to SplitIterator and SplitBackwardsIterator 2022-07-25 22:04:30 +03:00
sha1.zig
sha2.zig std.crypto: Use featureSetHas to gate intrinsics 2022-10-28 17:17:08 -07:00
sha3.zig std: update tests to stage2 semantics 2022-06-03 20:21:20 +03:00
siphash.zig Fixes comptime 'error: cannot assign to constant' error in siphash. 2022-05-16 22:31:09 -04:00
test.zig
tlcsprng.zig
utils.zig
xoodoo.zig crypto: add the Xoodoo permutation, prepare for Gimli deprecation (#11866) 2022-07-01 13:18:08 +02:00