aboutsummaryrefslogtreecommitdiff
path: root/lib/std/hash/benchmark.zig
diff options
context:
space:
mode:
authorFrank Denis <github@pureftpd.org>2020-08-22 01:11:24 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-08-22 02:47:50 -0400
commite919744c7ad2b224bef00ffc35ccacbe31a0aae7 (patch)
tree52c9ef41697ecc2d7dcbf46e022127e43f3e47b1 /lib/std/hash/benchmark.zig
parent9ab428185688896ab5b6d4bc924366d22bfe4ccd (diff)
downloadzig-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/benchmark.zig')
-rw-r--r--lib/std/hash/benchmark.zig12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/std/hash/benchmark.zig b/lib/std/hash/benchmark.zig
index c23743160b..f0cafa9971 100644
--- a/lib/std/hash/benchmark.zig
+++ b/lib/std/hash/benchmark.zig
@@ -25,8 +25,6 @@ const Hash = struct {
init_u64: ?u64 = null,
};
-const siphash_key = "0123456789abcdef";
-
const hashes = [_]Hash{
Hash{
.ty = hash.Wyhash,
@@ -34,16 +32,6 @@ const hashes = [_]Hash{
.init_u64 = 0,
},
Hash{
- .ty = hash.SipHash64(1, 3),
- .name = "siphash(1,3)",
- .init_u8s = siphash_key,
- },
- Hash{
- .ty = hash.SipHash64(2, 4),
- .name = "siphash(2,4)",
- .init_u8s = siphash_key,
- },
- Hash{
.ty = hash.Fnv1a_64,
.name = "fnv1a",
},