/freebsd-src/cddl/contrib/opensolaris/tools/ctf/cvt/ |
H A D | hash.c | 30 * Routines for manipulating hash tables 39 #include "hash.h" 43 struct hash { struct 95 hash_t *hash; in hash_new() local 97 hash = xmalloc(sizeof (hash_t)); in hash_new() 98 hash->h_buckets = xcalloc(sizeof (list_t *) * nbuckets); in hash_new() 99 hash->h_nbuckets = nbuckets; in hash_new() 100 hash->h_hashfn = hashfn ? hashfn : hash_def_hash; in hash_new() 101 hash->h_cmp = cmp ? cmp : hash_def_cmp; in hash_new() 103 return (hash); in hash_new() [all …]
|
/freebsd-src/sys/libkern/ |
H A D | murmur3_32.c | 27 #include <sys/hash.h> 35 * Simple implementation of the Murmur3-32 hash function. 46 uint32_t hash, k; in murmur3_32_hash() local 52 hash = seed; in murmur3_32_hash() 63 hash ^= k; in murmur3_32_hash() 64 hash = rol32(hash, 13); in murmur3_32_hash() 65 hash *= 5; in murmur3_32_hash() 66 hash += 0xe6546b64; in murmur3_32_hash() 83 hash ^= k; in murmur3_32_hash() 89 hash ^= (uint32_t)len; in murmur3_32_hash() [all …]
|
/freebsd-src/contrib/llvm-project/llvm/include/llvm/ADT/ |
H A D | StableHashing.h | 22 /// An opaque object representing a stable hash code. It can be serialized, 30 // Stable hashes are based on the 64-bit FNV-1 hash: 36 inline void stable_hash_append(stable_hash &Hash, const char Value) { in stable_hash_append() argument 37 Hash = Hash ^ (Value & 0xFF); in stable_hash_append() 38 Hash = Hash * FNV_PRIME_64; in stable_hash_append() 41 inline void stable_hash_append(stable_hash &Hash, stable_hash Value) { in stable_hash_append() argument 43 stable_hash_append(Hash, static_cast<char>(Value)); in stable_hash_append() 52 stable_hash Hash = hashing::detail::FNV_OFFSET_64; in stable_hash_combine() local 53 hashing::detail::stable_hash_append(Hash, A); in stable_hash_combine() 54 hashing::detail::stable_hash_append(Hash, B); in stable_hash_combine() [all …]
|
H A D | CachedHashString.h | 11 /// owning and not-owning string types that store their hash in addition to 28 /// A container which contains a StringRef plus a precomputed hash. 32 uint32_t Hash; variable 39 CachedHashStringRef(StringRef S, uint32_t Hash) in CachedHashStringRef() argument 40 : P(S.data()), Size(S.size()), Hash(Hash) { in CachedHashStringRef() 47 uint32_t hash() const { return Hash; } in hash() function 58 assert(!isEqual(S, getEmptyKey()) && "Cannot hash the empty key!"); 59 assert(!isEqual(S, getTombstoneKey()) && "Cannot hash the tombstone key!"); 60 return S.hash(); 64 return LHS.hash() == RHS.hash() && [all …]
|
/freebsd-src/crypto/openssl/providers/implementations/rands/ |
H A D | drbg_hash.c | 59 * SP800-90Ar1 10.3.1 Derivation function using a Hash Function (Hash_df). 73 PROV_DRBG_HASH *hash = (PROV_DRBG_HASH *)drbg->data; in hash_df() local 74 EVP_MD_CTX *ctx = hash->ctx; in hash_df() 75 unsigned char *vtmp = hash->vtmp; in hash_df() 100 * (Step 4.1) out = out || Hash(tmp || in || [in2] || [in3]) in hash_df() 103 if (!(EVP_DigestInit_ex(ctx, ossl_prov_digest_md(&hash->digest), NULL) in hash_df() 110 if (outlen < hash->blocklen) { in hash_df() 114 OPENSSL_cleanse(vtmp, hash->blocklen); in hash_df() 120 outlen -= hash->blocklen; in hash_df() 125 out += hash->blocklen; in hash_df() [all …]
|
/freebsd-src/contrib/unbound/util/storage/ |
H A D | slabhash.h | 39 * Hash table that consists of smaller hash tables. 52 * Hash table formed from several smaller ones. 64 /** lookup array of hash tables */ 69 * Create new slabbed hash table. 70 * @param numtables: number of hash tables to use, other parameters used to 80 * @return: new hash table or NULL on malloc failure. 88 * Delete hash table. Entries are all deleted. 94 * Clear hash table. Entries are all deleted. 103 * @param table: hash table. 104 * @param hash: hash value. User calculates the hash. [all …]
|
H A D | lruhash.h | 2 * util/storage/lruhash.h - hashtable, hash function, LRU keeping. 41 * The hash table keeps a maximum memory size. Old entries are removed 47 * o the idea is to move every thread through the hash lock quickly, 49 * o User performs hash function. 53 * o lookup hash bin. 54 * o lock hash bin. 55 * o find entry (if failed, unlock hash, unl bin, exit). 59 * o unlock hash bin. 72 * o lookup hash bin. 73 * o lock hash bin. [all …]
|
/freebsd-src/contrib/ntp/libntp/lib/isc/include/isc/ |
H A D | hash.h | 18 /* $Id: hash.h,v 1.12 2009/01/17 23:47:43 tbox Exp $ */ 27 /*! \file isc/hash.h 29 * \brief The hash API 30 * provides an unpredictable hash value for variable length data. 31 * A hash object contains a random vector (which is hidden from clients 32 * of this API) to make the actual hash value unpredictable. 34 * The algorithm used in the API guarantees the probability of hash 36 * in the random vector are unpredictable, the probability of hash 39 * Although the API is generic about the hash keys, it mainly expects 42 * hash values for large inputs. [all …]
|
/freebsd-src/share/man/man9/ |
H A D | hash.9 | 26 .\" $OpenBSD: hash.9,v 1.5 2003/04/17 05:08:39 jmc Exp $ 32 .Nm hash , 47 .Fn hash32_buf "const void *buf" "size_t len" "uint32_t hash" 49 .Fn hash32_str "const void *buf" "uint32_t hash" 51 .Fn hash32_strn "const void *buf" "size_t len" "uint32_t hash" 53 .Fn hash32_stre "const void *buf" "int end" "const char **ep" "uint32_t hash" 55 .Fn hash32_strne "const void *buf" "size_t len" "int end" "const char **ep" "uint32_t hash" 57 .Fn jenkins_hash "const void *buf" "size_t len" "uint32_t hash" 59 .Fn jenkins_hash32 "const uint32_t *buf" "size_t count" "uint32_t hash" 61 .Fn murmur3_32_hash "const void *buf" "size_t len" "uint32_t hash" [all …]
|
H A D | hashinit.9 | 31 .Nd manage kernel hash tables 54 functions allocate space for hash tables of size given by the argument 59 function allocates hash tables that are sized to largest power of two 64 function allocates hash tables that are sized to the largest prime 80 Allocated hash tables are contiguous arrays of 91 function frees the space occupied by the hash table pointed to by argument 100 that allocated the hash table. 124 The largest prime hash value chosen by 130 function returns a pointer to an allocated hash table and sets the 134 hash table. [all …]
|
/freebsd-src/sys/sys/ |
H A D | hash.h | 27 * $OpenBSD: hash.h,v 1.4 2004/05/25 18:37:23 jmc Exp $ 41 * Return a 32-bit hash of the given buffer. The init 42 * value should be 0, or the previous hash value to extend 43 * the previous hash. 46 hash32_buf(const void *buf, size_t len, uint32_t hash) in hash32_buf() argument 51 hash = HASHSTEP(hash, *p++); in hash32_buf() 53 return hash; in hash32_buf() 57 * Return a 32-bit hash of the given string. 60 hash32_str(const void *buf, uint32_t hash) in hash32_str() argument 65 hash = HASHSTEP(hash, *p++); in hash32_str() [all …]
|
/freebsd-src/sys/contrib/openzfs/module/os/linux/spl/ |
H A D | spl-tsd.c | 25 * Thread specific data has implemented using a hash table, this avoids 30 * The majority of the entries in the hash table are for specific tsd 34 * distributed over the hash bins providing neither the pid nor key is zero. 37 * By default the hash table is sized to 512 bins which is expected to 40 * The hash table contains two additional type of entries. They first 41 * type is entry is called a 'key' entry and it is added to the hash during 50 * hash the first time a process set a key. The 'pid' entry is also used 64 #include <linux/hash.h> 92 * tsd_hash_search - searches hash table for tsd_hash_entry 93 * @table: hash table [all …]
|
/freebsd-src/contrib/libucl/klib/ |
H A D | khash.h | 56 However, my implementation is probably not for large hash tables, because 57 the second hash function is closely tied to the first hash function, 78 * Added Wang's integer hash function (not used by default). This hash 123 Generic hash table library. 252 else { /* hash table size to be changed (shrink or expand); rehash */ \ 286 __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \ 295 if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \ 310 if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \ 315 } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \ 368 /* --- BEGIN OF HASH FUNCTIONS --- */ [all …]
|
/freebsd-src/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/ |
H A D | Hash.cpp | 1 //===- Hash.cpp - PDB Hash Functions --------------------------------------===// 9 #include "llvm/DebugInfo/PDB/Native/Hash.h" 19 // Used for name hash table and TPI/IPI hashes. 33 // Maximum of 3 bytes left. Hash a 2 byte word if possible, then hash the in hashStringV1() 42 // hash possible odd byte in hashStringV1() 55 // Used for name hash table. 57 uint32_t Hash = 0xb170a1bf; in hashStringV2() local 65 Hash += Item; in hashStringV2() 66 Hash += (Hash << 10); in hashStringV2() 67 Hash ^= (Hash >> 6); in hashStringV2() [all …]
|
/freebsd-src/sys/netinet/ |
H A D | in_rss.c | 52 /* for software rss hash support */ 58 * Hash an IPv4 2-tuple. 75 * Hash an IPv4 4-tuple. 102 * The protocol code may wish to do a software hash of the given 103 * tuple. This depends upon the currently configured RSS hash types. 115 uint32_t hash; in rss_proto_software_hash_v4() local 118 * Next, choose the hash type depending upon the protocol in rss_proto_software_hash_v4() 123 hash = rss_hash_ip4_4tuple(s, sp, d, dp); in rss_proto_software_hash_v4() 124 *hashval = hash; in rss_proto_software_hash_v4() 129 hash = rss_hash_ip4_4tuple(s, sp, d, dp); in rss_proto_software_hash_v4() [all …]
|
/freebsd-src/lib/libc/stdlib/ |
H A D | hsearch_r.c | 36 * Look up an unused entry in the hash table for a given hash. For this 41 hsearch_lookup_free(struct __hsearch *hsearch, size_t hash) in hsearch_lookup_free() argument 45 for (index = hash, i = 0;; index += ++i) { in hsearch_lookup_free() 53 * Computes an FNV-1a hash of the key. Depending on the pointer size, this 59 size_t hash; in hsearch_hash() local 61 hash = offset_basis; in hsearch_hash() 63 hash ^= (uint8_t)*str++; in hsearch_hash() 65 hash *= UINT32_C(16777619); in hsearch_hash() 67 hash *= UINT64_C(1099511628211); in hsearch_hash() 69 return (hash); in hsearch_hash() [all …]
|
/freebsd-src/contrib/unbound/validator/ |
H A D | val_secalgo.h | 48 /** Return size of nsec3 hash algorithm, 0 if not supported */ 52 * Hash a single hash call of an NSEC3 hash algorithm. 54 * @param algo: nsec3 hash algorithm. 64 * Calculate the sha256 hash for the data buffer into the result. 72 * Start a hash of type sha384. Allocates structure, then inits it, 74 * @return hash structure. NULL on malloc failure or no support. 79 * Start a hash of type sha512. Allocates structure, then inits it, 81 * @return hash structure. NULL on malloc failure or no support. 86 * Update a hash with more information to add to it. 87 * @param hash: the hash that is updated. [all …]
|
H A D | val_nsec3.h | 47 * | Hash Alg. | Flags | Iterations | 51 * | Hash Length | Next Hashed Owner Name / 60 * | Hash Alg. | Flags | Iterations | 98 /** The SHA1 hash algorithm for NSEC3 */ 123 * @param calc: current hash calculations. 127 * UNCHECKED if no more hash calculations are allowed at this point. 161 * @param calc: current hash calculations. 165 * UNCHECKED if no more hash calculations are allowed at this point. 186 * @param calc: current hash calculations. 190 * UNCHECKED if no more hash calculation 269 uint8_t* hash; global() member [all...] |
/freebsd-src/contrib/xz/src/liblzma/lz/ |
H A D | lz_encoder_mf.c | 82 /// Hash value to indicate unused element in the hash. Since we start the 93 /// \brief Normalizes hash values 95 /// The hash arrays store positions of match candidates. The positions are 100 /// the hash. 102 /// To prevent integer overflows of the offsets stored in the hash arrays, 119 // we can simply mark the hash element as empty. in normalize() 120 if (mf->hash[i] <= subvalue) in normalize() 121 mf->hash[i] = EMPTY_HASH_VALUE; in normalize() 123 mf->hash[i] -= subvalue; in normalize() 169 /// the missed bytes are added to the hash using the match finder's skip [all …]
|
/freebsd-src/contrib/bearssl/inc/ |
H A D | bearssl_rsa.h | 124 * - When verifying PKCS#1 v1.5 signatures, both variants of the hash 241 * - The encoded OID for the hash function. The provided array must begin 244 * also be `NULL`, in which case the raw hash value should be used 246 * to TLS-1.1, with a 36-byte hash value). 248 * - The hash output length, in bytes. 252 * - An output buffer for the hash value. The caller must still compare 253 * it with the hash of the data over which the signature is computed. 257 * - Hash length MUST be no more than 64 bytes. 273 * \param hash_oid encoded hash algorithm OID (or `NULL`). 274 * \param hash_len expected hash value length (in bytes). [all …]
|
/freebsd-src/sys/dev/qat/qat_api/common/crypto/sym/include/ |
H A D | lac_sym_qat_hash.h | 8 * @defgroup LacSymQatHash Hash QAT 12 * interfaces for populating qat structures for a hash operation 42 * hash precomputes 45 * This structure contains infomation on the hash precomputes 62 * hash state prefix buffer info 65 * This structure contains infomation on the hash state prefix aad buffer 70 /**< Physical pointer to the hash state prefix buffer */ 72 /**< Virtual pointer to the hash state prefix buffer */ 74 /**< hash state storage size in quad words */ 82 * Init the hash specific part of the content descriptor. [all …]
|
/freebsd-src/contrib/llvm-project/llvm/lib/IR/ |
H A D | StructuralHash.cpp | 27 uint64_t Hash; member in __anona6e535490111::StructuralHashImpl 29 void hash(uint64_t V) { Hash = hashing::detail::hash_16_bytes(Hash, V); } in hash() function in __anona6e535490111::StructuralHashImpl 36 hash(hash_combine(V)); in hashArbitaryType() 40 hash(ValueType->getTypeID()); in hashType() 42 hash(ValueType->getIntegerBitWidth()); in hashType() 46 StructuralHashImpl() : Hash(4) {} in StructuralHashImpl() 58 hash(Arg->getArgNo()); in updateOperand() 61 // has explicit support for hashing strings and will not simply hash in updateOperand() 68 hash(Inst.getOpcode()); in updateInstruction() 78 hash(ComparisonInstruction->getPredicate()); in updateInstruction() [all …]
|
/freebsd-src/sys/netinet6/ |
H A D | in6_rss.c | 52 /* for software rss hash support */ 59 * Hash an IPv6 2-tuple. 76 * Hash an IPv6 4-tuple. 103 * The protocol code may wish to do a software hash of the given 104 * tuple. This depends upon the currently configured RSS hash types. 116 uint32_t hash; in rss_proto_software_hash_v6() local 119 * Next, choose the hash type depending upon the protocol in rss_proto_software_hash_v6() 124 hash = rss_hash_ip6_4tuple(s, sp, d, dp); in rss_proto_software_hash_v6() 125 *hashval = hash; in rss_proto_software_hash_v6() 130 hash = rss_hash_ip6_4tuple(s, sp, d, dp); in rss_proto_software_hash_v6() [all …]
|
/freebsd-src/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/ |
H A D | TypeHashing.h | 28 /// A locally hashed type represents a straightforward hash code of a serialized 35 hash_code Hash; member 38 /// Given a type, compute its local hash. 63 SHA1 = 0, // standard 20-byte SHA1 hash 64 SHA1_8, // last 8-bytes of standard SHA1 hash 68 /// A globally hashed type represents a hash value that is sufficient to 71 /// TypeIndex that refers to B with a previously-computed global hash for B. As 72 /// this is a recursive algorithm (e.g. the global hash of B also depends on the 73 /// global hashes of the types that B refers to), a global hash can uniquely 75 /// different graph structure. Although the hash itself is slower to compute, [all …]
|
/freebsd-src/crypto/openssl/doc/man3/ |
H A D | OPENSSL_LH_COMPFUNC.pod | 17 - dynamic hash table 27 LHASH_OF(TYPE) *lh_TYPE_new(OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC compare); 71 This library implements type-checked dynamic hash tables. The hash 77 arbitrary data entries, and specifies the 'hash' and 'compare' 78 callbacks to be used in organising the table's entries. The I<hash> 80 an unsigned long hash value for its key field. The hash value is 81 normally truncated to a power of 2, so make sure that your hash 83 takes two arguments (pointers to two hash tabl [all...] |