diff options
| author | Frank Denis <github@pureftpd.org> | 2020-08-22 01:11:24 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-08-22 02:47:50 -0400 |
| commit | e919744c7ad2b224bef00ffc35ccacbe31a0aae7 (patch) | |
| tree | 52c9ef41697ecc2d7dcbf46e022127e43f3e47b1 /lib/std/hash.zig | |
| parent | 9ab428185688896ab5b6d4bc924366d22bfe4ccd (diff) | |
| download | zig-e919744c7ad2b224bef00ffc35ccacbe31a0aae7.tar.gz zig-e919744c7ad2b224bef00ffc35ccacbe31a0aae7.zip | |
Promote hash/siphash to crypto/siphash
SipHash *is* a cryptographic function, with a 128-bit security level.
However, it is not a regular hash function: a secret key is required,
and knowledge of that key allows collisions to be quickly computed offline.
SipHash is therefore more suitable to be used as a MAC.
The same API as other MACs was implemented in addition to functions directly
returning an integer.
The benchmarks have been updated accordingly.
No changes to the SipHash implementation itself.
Diffstat (limited to 'lib/std/hash.zig')
| -rw-r--r-- | lib/std/hash.zig | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/std/hash.zig b/lib/std/hash.zig index 1cc078959c..7bac378316 100644 --- a/lib/std/hash.zig +++ b/lib/std/hash.zig @@ -20,7 +20,7 @@ pub const Fnv1a_32 = fnv.Fnv1a_32; pub const Fnv1a_64 = fnv.Fnv1a_64; pub const Fnv1a_128 = fnv.Fnv1a_128; -const siphash = @import("hash/siphash.zig"); +const siphash = @import("crypto/siphash.zig"); pub const SipHash64 = siphash.SipHash64; pub const SipHash128 = siphash.SipHash128; @@ -42,7 +42,6 @@ test "hash" { _ = @import("hash/auto_hash.zig"); _ = @import("hash/crc.zig"); _ = @import("hash/fnv.zig"); - _ = @import("hash/siphash.zig"); _ = @import("hash/murmur.zig"); _ = @import("hash/cityhash.zig"); _ = @import("hash/wyhash.zig"); |
