mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 17:12:31 +00:00
e919744c7a
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.
49 lines
1.6 KiB
Zig
49 lines
1.6 KiB
Zig
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2015-2020 Zig Contributors
|
|
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
|
|
// The MIT license requires this copyright notice to be included in all copies
|
|
// and substantial portions of the software.
|
|
const adler = @import("hash/adler.zig");
|
|
pub const Adler32 = adler.Adler32;
|
|
|
|
const auto_hash = @import("hash/auto_hash.zig");
|
|
pub const autoHash = auto_hash.autoHash;
|
|
pub const autoHashStrat = auto_hash.hash;
|
|
pub const Strategy = auto_hash.HashStrategy;
|
|
|
|
// pub for polynomials + generic crc32 construction
|
|
pub const crc = @import("hash/crc.zig");
|
|
pub const Crc32 = crc.Crc32;
|
|
|
|
const fnv = @import("hash/fnv.zig");
|
|
pub const Fnv1a_32 = fnv.Fnv1a_32;
|
|
pub const Fnv1a_64 = fnv.Fnv1a_64;
|
|
pub const Fnv1a_128 = fnv.Fnv1a_128;
|
|
|
|
const siphash = @import("crypto/siphash.zig");
|
|
pub const SipHash64 = siphash.SipHash64;
|
|
pub const SipHash128 = siphash.SipHash128;
|
|
|
|
pub const murmur = @import("hash/murmur.zig");
|
|
pub const Murmur2_32 = murmur.Murmur2_32;
|
|
|
|
pub const Murmur2_64 = murmur.Murmur2_64;
|
|
pub const Murmur3_32 = murmur.Murmur3_32;
|
|
|
|
pub const cityhash = @import("hash/cityhash.zig");
|
|
pub const CityHash32 = cityhash.CityHash32;
|
|
pub const CityHash64 = cityhash.CityHash64;
|
|
|
|
const wyhash = @import("hash/wyhash.zig");
|
|
pub const Wyhash = wyhash.Wyhash;
|
|
|
|
test "hash" {
|
|
_ = @import("hash/adler.zig");
|
|
_ = @import("hash/auto_hash.zig");
|
|
_ = @import("hash/crc.zig");
|
|
_ = @import("hash/fnv.zig");
|
|
_ = @import("hash/murmur.zig");
|
|
_ = @import("hash/cityhash.zig");
|
|
_ = @import("hash/wyhash.zig");
|
|
}
|