mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Start refactoring hashing.
This commit moves some of the hash datastructures and code from util.cc into Hash.cc - where it seems more appropriate. It also starts to make more Keyed hash functions available - still using siphash as the default 64 bit keyed hash, but also making 128 and 256 bit highway hashes available. There already are a few other functions that are defined but not yet implemented - these will be "static" keyed hashes - which use an installation specific key. These will be used to, e.g., get rid of md5 hashing for the generation of file UIDs.
This commit is contained in:
parent
d34532f847
commit
360c06a3f8
7 changed files with 123 additions and 67 deletions
|
@ -3,6 +3,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "Hash.h"
|
||||
#include "highwayhash/sip_hash.h"
|
||||
|
||||
#include <broker/expected.hh>
|
||||
|
||||
|
@ -24,7 +25,8 @@ public:
|
|||
typedef hash_t digest;
|
||||
typedef std::vector<digest> digest_vector;
|
||||
struct seed_t {
|
||||
alignas(16) highwayhash::HH_U64 h[2];
|
||||
// actually HH_U64, which has the same type
|
||||
alignas(16) unsigned long long h[2];
|
||||
|
||||
friend seed_t operator+(seed_t lhs, const uint64_t rhs) {
|
||||
lhs.h[0] += rhs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue