zig/lib/std/crypto
Frank Denis 51a3d0603c std.rand: set DefaultCsprng to Gimli, and require a larger seed
`DefaultCsprng` is documented as a cryptographically secure RNG.

While `ISAAC` is a CSPRNG, the variant we have, `ISAAC64` is not.
A 64 bit seed is a bit small to satisfy that claim.

We also saw it being used with the current date as a seed, that
also defeats the point of a CSPRNG.

Set `DefaultCsprng` to `Gimli` instead of `ISAAC64`, rename
the parameter from `init_s` to `secret_seed` + add a comment to
clarify what kind of seed is expected here.

Instead of directly touching the internals of the Gimli implementation
(which can change/be architecture-specific), add an `init()` function
to the state.

Our Gimli-based CSPRNG was also not backtracking resistant. Gimli
is a permutation; it can be reverted. So, if the state was ever leaked,
future secrets, but also all the previously generated ones could be
recovered. Clear the rate after a squeeze in order to prevent this.

Finally, a dumb test was added just to exercise `DefaultCsprng` since
we don't use it anywhere.
2020-10-15 20:57:16 -04:00
..
25519 std/crypto/25519: do cofactored ed25519 verification 2020-10-15 18:49:10 -04:00
aes aes/aesni is not based on a Go implementation, only aes/soft is 2020-10-08 14:55:11 +02:00
aegis.zig aegis: add test vectors, and link to the latest version of the spec 2020-09-29 17:10:04 +02:00
aes.zig std/crypto/aes: add AES hardware acceleration on aarch64 2020-10-08 14:55:08 +02:00
aes_gcm.zig std/crypto: Add support for AES-GCM 2020-10-06 00:00:33 +02:00
benchmark.zig std/crypto: Add support for AES-GCM 2020-10-06 00:00:33 +02:00
blake2.zig std: clean up bitrotten imports in crypto 2020-09-08 12:54:28 -04:00
blake3.zig Hash functions now accept an option set 2020-08-21 00:51:14 +02:00
chacha20.zig Simpler ChaCha20 vector code 2020-10-10 22:45:41 +02:00
ghash.zig ghash: add pmull support on aarch64 2020-10-08 18:09:23 -04:00
gimli.zig std.rand: set DefaultCsprng to Gimli, and require a larger seed 2020-10-15 20:57:16 -04:00
hkdf.zig Remove unused var, sort std.crypto.* 2020-09-30 01:39:55 +02:00
hmac.zig std/crypto/hmac: remove HmacBlake2s256 definition 2020-10-15 20:50:34 -04:00
md5.zig std: clean up bitrotten imports in crypto 2020-09-08 12:54:28 -04:00
modes.zig Revamp crypto/aes 2020-09-24 13:16:00 -04:00
pbkdf2.zig Add an error set 2020-09-16 01:58:48 +03:00
poly1305.zig ghash & poly1305: fix handling of partial blocks and add pad() 2020-10-05 23:50:38 +02:00
sha1.zig std: clean up bitrotten imports in crypto 2020-09-08 12:54:28 -04:00
sha2.zig std: clean up bitrotten imports in crypto 2020-09-08 12:54:28 -04:00
sha3.zig std: clean up bitrotten imports in crypto 2020-09-08 12:54:28 -04:00
siphash.zig std.crypto siphash: fix assertion on the size of output buffer 2020-09-16 02:24:36 -07:00
test.zig std: clean up bitrotten imports in crypto 2020-09-08 12:54:28 -04:00