Home
last modified time | relevance | path

Searched full:hash (Results 1 – 25 of 2240) sorted by relevance

12345678910>>...90

/linux/rust/syn/gen/
H A Dhash.rs8 use std::hash::{Hash, Hasher};
11 impl Hash for crate::Abi {
12 fn hash<H>(&self, state: &mut H) in hash() method
16 self.name.hash(state); in hash()
21 impl Hash for crate::AngleBracketedGenericArguments {
22 fn hash<H>(&self, state: &mut H) in hash() method
26 self.colon2_token.hash(state); in hash()
27 self.args.hash(state); in hash()
32 impl Hash for crate::Arm {
33 fn hash<H>(&self, state: &mut H) in hash() method
[all …]
/linux/samples/bpf/
H A Dhash_func01.h3 * Based on Paul Hsieh's (LGPG 2.1) hash function
4 * From: http://www.azillionmonkeys.com/qed/hash.html
11 __u32 hash = initval; in SuperFastHash() local
23 hash += get16bits (data); in SuperFastHash()
24 tmp = (get16bits (data+2) << 11) ^ hash; in SuperFastHash()
25 hash = (hash << 16) ^ tmp; in SuperFastHash()
27 hash += hash >> 11; in SuperFastHash()
32 case 3: hash += get16bits (data); in SuperFastHash()
33 hash ^= hash << 16; in SuperFastHash()
34 hash ^= ((signed char)data[sizeof (__u16)]) << 18; in SuperFastHash()
[all …]
/linux/net/batman-adv/
H A Dhash.c7 #include "hash.h"
14 /* clears the hash */
15 static void batadv_hash_init(struct batadv_hashtable *hash) in batadv_hash_init() argument
19 for (i = 0; i < hash->size; i++) { in batadv_hash_init()
20 INIT_HLIST_HEAD(&hash->table[i]); in batadv_hash_init()
21 spin_lock_init(&hash->list_locks[i]); in batadv_hash_init()
24 atomic_set(&hash->generation, 0); in batadv_hash_init()
28 * batadv_hash_destroy() - Free only the hashtable and the hash itself
29 * @hash: hash object to destroy
31 void batadv_hash_destroy(struct batadv_hashtable *hash) in batadv_hash_destroy() argument
[all …]
H A Dhash.h44 /** @list_locks: spinlock for each hash list entry */
54 /* allocates and clears the hash */
58 void batadv_hash_set_lock_class(struct batadv_hashtable *hash,
61 /* free only the hashtable and the hash itself. */
62 void batadv_hash_destroy(struct batadv_hashtable *hash);
66 * @hash: storage hash table
67 * @compare: callback to determine if 2 hash elements are identical
68 * @choose: callback calculating the hash index
72 * Return: 0 on success, 1 if the element already is in the hash
75 static inline int batadv_hash_add(struct batadv_hashtable *hash, in batadv_hash_add() argument
[all …]
/linux/include/linux/
H A Drhashtable.h3 * Resizable, Scalable, Concurrent Hash Table
32 * which is linked into as hash chain from the hash table - or one
33 * of two or more hash tables when the rhashtable is being resized.
36 * the hash bucket. This allows us to be sure we've found the end
38 * The value stored in the hash bucket has BIT(0) used as a lock bit.
51 * The maximum (not average) chain length grows with the size of the hash
54 * The value of 16 is selected so that even if the hash table grew to
65 * struct bucket_table - Table of hash buckets
66 * @size: Number of hash bucket
120 rht_bucket_index(const struct bucket_table * tbl,unsigned int hash) rht_bucket_index() argument
129 unsigned int hash; rht_key_get_hash() local
159 unsigned int hash = rht_key_get_hash(ht, key, params, tbl->hash_rnd); rht_key_hashfn() local
236 lockdep_rht_bucket_is_held(const struct bucket_table * tbl,u32 hash) lockdep_rht_bucket_is_held() argument
277 rht_dereference_bucket(p,tbl,hash) global() argument
280 rht_dereference_bucket_rcu(p,tbl,hash) global() argument
287 rht_bucket(const struct bucket_table * tbl,unsigned int hash) rht_bucket() argument
294 rht_bucket_var(struct bucket_table * tbl,unsigned int hash) rht_bucket_var() argument
301 rht_bucket_insert(struct rhashtable * ht,struct bucket_table * tbl,unsigned int hash) rht_bucket_insert() argument
402 rht_ptr(struct rhash_lock_head __rcu * const * bkt,struct bucket_table * tbl,unsigned int hash) rht_ptr() argument
444 rht_for_each_from(pos,head,tbl,hash) global() argument
455 rht_for_each(pos,tbl,hash) global() argument
468 rht_for_each_entry_from(tpos,pos,head,tbl,hash,member) global() argument
481 rht_for_each_entry(tpos,pos,tbl,hash,member) global() argument
498 rht_for_each_entry_safe(tpos,pos,next,tbl,hash,member) global() argument
518 rht_for_each_rcu_from(pos,head,tbl,hash) global() argument
534 rht_for_each_rcu(pos,tbl,hash) global() argument
553 rht_for_each_entry_rcu_from(tpos,pos,head,tbl,hash,member) global() argument
571 rht_for_each_entry_rcu(tpos,pos,tbl,hash,member) global() argument
623 unsigned int hash; __rhashtable_lookup() local
764 unsigned int hash; __rhashtable_insert_fast() local
1050 unsigned int hash; __rhashtable_remove_fast_one() local
1203 unsigned int hash; __rhashtable_replace_fast() local
[all...]
H A Dstringhash.h7 #include <linux/hash.h>
10 * Routines for hashing strings of bytes to a 32-bit hash value.
12 * These hash functions are NOT GUARANTEED STABLE between kernel
18 * malicious inputs; much slower hash functions are required for that.
29 * unsigned long hash = init_name_hash;
31 * hash = partial_name_hash(tolower(*p++), hash);
32 * hash = end_name_hash(hash);
35 * abuses it to hash 16-bit values.
38 /* Hash courtesy of the R5 hash in reiserfs modulo sign bits */
41 /* partial hash update function. Assume roughly 4 bits per character */
[all …]
H A Dxxhash.h2 * xxHash - Extremely Fast Hash algorithm
44 * xxHash is an extremely fast Hash algorithm, running at RAM speed limits.
64 * Q.Score is a measure of quality of the hash function.
81 * Simple Hash Functions
85 * xxh32() - calculate the 32-bit hash of the input with a given seed.
87 * @input: The data to hash.
88 * @length: The length of the data to hash.
93 * Return: The 32-bit hash of the data.
98 * xxh64() - calculate the 64-bit hash of the input with a given seed.
100 * @input: The data to hash.
[all …]
/linux/net/ceph/crush/
H A Dhash.c3 # include <linux/crush/hash.h>
5 # include "hash.h"
10 * https://burtleburtle.net/bob/hash/evahash.html
29 __u32 hash = crush_hash_seed ^ a; in crush_hash32_rjenkins1() local
33 crush_hashmix(b, x, hash); in crush_hash32_rjenkins1()
34 crush_hashmix(y, a, hash); in crush_hash32_rjenkins1()
35 return hash; in crush_hash32_rjenkins1()
40 __u32 hash = crush_hash_seed ^ a ^ b; in crush_hash32_rjenkins1_2() local
43 crush_hashmix(a, b, hash); in crush_hash32_rjenkins1_2()
44 crush_hashmix(x, a, hash); in crush_hash32_rjenkins1_2()
[all …]
/linux/drivers/net/xen-netback/
H A Dhash.c50 spin_lock_irqsave(&vif->hash.cache.lock, flags); in xenvif_add_hash()
54 list_for_each_entry_rcu(entry, &vif->hash.cache.list, link, in xenvif_add_hash()
55 lockdep_is_held(&vif->hash.cache.lock)) { in xenvif_add_hash()
65 new->seq = atomic_inc_return(&vif->hash.cache.seq); in xenvif_add_hash()
66 list_add_rcu(&new->link, &vif->hash.cache.list); in xenvif_add_hash()
68 if (++vif->hash.cache.count > xenvif_hash_cache_size) { in xenvif_add_hash()
70 vif->hash.cache.count--; in xenvif_add_hash()
75 spin_unlock_irqrestore(&vif->hash.cache.lock, flags); in xenvif_add_hash()
86 val = xen_netif_toeplitz_hash(vif->hash.key, in xenvif_new_hash()
87 sizeof(vif->hash.key), in xenvif_new_hash()
[all …]
/linux/lib/crypto/tests/
H A Dhash-test-template.h3 * Test cases for hash functions, including a benchmark. This is included by
99 * Test the hash function against a list of test vectors.
114 HASH(test_buf, data_len, actual_hash); in test_hash_test_vectors()
123 * Test that the hash function produces correct results for *every* length up to
124 * 4096 bytes. To do this, generate seeded random data, then calculate a hash
125 * value for each length 0..4096, then hash the hash values. Verify just the
126 * final hash value, which should match only when all hash values were correct.
131 u8 hash[HASH_SIZE]; in test_hash_all_lens_up_to_4096() local
137 HASH(test_buf, len, hash); in test_hash_all_lens_up_to_4096()
138 HASH_UPDATE(&ctx, hash, HASH_SIZE); in test_hash_all_lens_up_to_4096()
[all …]
/linux/security/selinux/include/
H A Dhash.h19 u32 hash = 0; in av_hash() local
27 hash ^= v; \ in av_hash()
28 hash = (hash << r2) | (hash >> (32 - r2)); \ in av_hash()
29 hash = hash * m + n; \ in av_hash()
38 hash ^= hash >> 16; in av_hash()
39 hash *= 0x85ebca6b; in av_hash()
40 hash ^= hash >> 13; in av_hash()
41 hash *= 0xc2b2ae35; in av_hash()
42 hash ^= hash >> 16; in av_hash()
44 return hash & mask; in av_hash()
/linux/Documentation/admin-guide/device-mapper/
H A Dverity.rst21 This is the type of the on-disk hash format.
37 This is the device that supplies the hash tree data. It may be
44 Each block corresponds to one digest on the hash device.
47 The size of a hash block in bytes.
56 to the root block of the hash tree.
59 The cryptographic hash algorithm used for this device. This should
63 The hexadecimal encoding of the cryptographic hash of the root hash block
64 and the salt. This hash should be trusted as there is no other authenticity
105 Use forward error correction (FEC) to recover from corruption if hash
107 may be the same device where data and hash blocks reside, in which case
[all …]
/linux/net/netfilter/ipset/
H A DKconfig56 tristate "hash:ip set support"
59 This option adds the hash:ip set type support, by which one
66 tristate "hash:ip,mark set support"
69 This option adds the hash:ip,mark set type support, by which one
75 tristate "hash:ip,port set support"
78 This option adds the hash:ip,port set type support, by which one
84 tristate "hash:ip,port,ip set support"
87 This option adds the hash:ip,port,ip set type support, by which
94 tristate "hash:ip,port,net set support"
97 This option adds the hash:ip,port,net set type support, by which
[all …]
/linux/rust/syn/
H A Dtt.rs4 use std::hash::{Hash, Hasher};
50 impl<'a> Hash for TokenTreeHelper<'a> {
51 fn hash<H: Hasher>(&self, h: &mut H) { in hash() method
56 0u8.hash(h); in hash()
58 Delimiter::Parenthesis => 0u8.hash(h), in hash()
59 Delimiter::Brace => 1u8.hash(h), in hash()
60 Delimiter::Bracket => 2u8.hash(h), in hash()
61 Delimiter::None => 3u8.hash(h), in hash()
65 TokenTreeHelper(&item).hash(h); in hash()
67 0xFFu8.hash(h); // terminator w/ a variant we don't normally hash in hash()
[all …]
/linux/lib/tests/
H A Dhashtable_test.c37 DEFINE_HASHTABLE(hash, 1); in hashtable_test_hash_empty()
39 KUNIT_EXPECT_TRUE(test, hash_empty(hash)); in hashtable_test_hash_empty()
43 hash_add(hash, &a.node, a.key); in hashtable_test_hash_empty()
46 KUNIT_EXPECT_FALSE(test, hash_empty(hash)); in hashtable_test_hash_empty()
52 DEFINE_HASHTABLE(hash, 4); in hashtable_test_hash_hashed()
56 hash_add(hash, &a.node, a.key); in hashtable_test_hash_hashed()
59 hash_add(hash, &b.node, b.key); in hashtable_test_hash_hashed()
69 DEFINE_HASHTABLE(hash, 3); in hashtable_test_hash_add()
74 hash_add(hash, &a.node, a.key); in hashtable_test_hash_add()
78 hash_add(hash, &b.node, b.key); in hashtable_test_hash_add()
[all …]
/linux/fs/verity/
H A Dhash_algs.c3 * fs-verity hash algorithms
10 /* The hash algorithms supported by fs-verity */
27 * fsverity_get_hash_alg() - get a hash algorithm by number
29 * @num: the hash algorithm number
31 * Get the struct fsverity_hash_alg for the given hash algorithm number.
33 * Return: pointer to the hash alg if it's known, otherwise NULL.
40 fsverity_warn(inode, "Unknown hash algorithm number: %u", num); in fsverity_get_hash_alg()
47 * fsverity_prepare_hash_state() - precompute the initial hash state
48 * @alg: hash algorithm
52 * Return: the kmalloc()'ed initial hash state, or NULL if out of memory.
[all …]
/linux/crypto/
H A Dhmac.c15 #include <crypto/internal/hash.h>
24 struct crypto_shash *hash; member
30 struct crypto_ahash *hash; member
42 struct crypto_shash *hash = tctx->hash; in hmac_setkey() local
45 SHASH_DESC_ON_STACK(shash, hash); in hmac_setkey()
51 shash->tfm = hash; in hmac_setkey()
94 desc->tfm = tctx->hash; in hmac_import()
111 desc->tfm = tctx->hash; in hmac_import_core()
148 struct crypto_shash *hash; in hmac_init_tfm() local
153 hash = crypto_spawn_shash(spawn); in hmac_init_tfm()
[all …]
/linux/drivers/gpu/drm/vboxvideo/
H A Dvbox_hgsmi.c11 /* One-at-a-Time Hash from https://www.burtleburtle.net/bob/hash/doobs.html */
12 static u32 hgsmi_hash_process(u32 hash, const u8 *data, int size) in hgsmi_hash_process() argument
15 hash += *data++; in hgsmi_hash_process()
16 hash += (hash << 10); in hgsmi_hash_process()
17 hash ^= (hash >> 6); in hgsmi_hash_process()
20 return hash; in hgsmi_hash_process()
23 static u32 hgsmi_hash_end(u32 hash) in hgsmi_hash_end() argument
25 hash += (hash << 3); in hgsmi_hash_end()
26 hash ^= (hash >> 11); in hgsmi_hash_end()
27 hash += (hash << 15); in hgsmi_hash_end()
[all …]
/linux/fs/ext4/
H A Dhash.c3 * linux/fs/ext4/hash.c
102 /* The old legacy hash */
105 __u32 hash, hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9; in dx_hack_hash_unsigned() local
109 hash = hash1 + (hash0 ^ (((int) *ucp++) * 7152373)); in dx_hack_hash_unsigned()
111 if (hash & 0x80000000) in dx_hack_hash_unsigned()
112 hash -= 0x7fffffff; in dx_hack_hash_unsigned()
114 hash0 = hash; in dx_hack_hash_unsigned()
121 __u32 hash, hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9; in dx_hack_hash_signed() local
125 hash = hash1 + (hash0 ^ (((int) *scp++) * 7152373)); in dx_hack_hash_signed()
127 if (hash & 0x80000000) in dx_hack_hash_signed()
[all …]
/linux/arch/powerpc/crypto/
H A Daes-gcm-p10-glue.c18 #include <crypto/internal/hash.h>
62 u8 Htable[256]; /* Xi, Hash table(offset 32) */
84 static void set_subkey(unsigned char *hash) in set_subkey() argument
86 *(u64 *)&hash[0] = be64_to_cpup((__be64 *)&hash[0]); in set_subkey()
87 *(u64 *)&hash[8] = be64_to_cpup((__be64 *)&hash[8]); in set_subkey()
92 * - Hash aad and copy to Xi.
94 static void set_aad(struct gcm_ctx *gctx, struct Hash_ctx *hash, in set_aad() argument
103 gcm_ghash_p10(nXi, hash->Htable+32, aad, i); in set_aad()
112 gcm_ghash_p10(gctx->aad_hash, hash->Htable+32, nXi, 16); in set_aad()
117 memcpy(hash->Htable, gctx->aad_hash, 16); in set_aad()
[all …]
/linux/security/integrity/ima/
H A Dima_crypto.c10 * Calculates md5/sha1 file hash, template hash, boot-aggreate hash
21 #include <crypto/hash.h>
81 pr_info("Allocated hash algorithm: %s\n", in ima_init_ima_crypto()
325 struct ima_digest_data *hash, in ima_calc_file_hash_atfm() argument
336 hash->length = crypto_ahash_digestsize(tfm); in ima_calc_file_hash_atfm()
427 ahash_request_set_crypt(req, NULL, hash->digest, 0); in ima_calc_file_hash_atfm()
435 static int ima_calc_file_ahash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_ahash() argument
440 tfm = ima_alloc_atfm(hash->algo); in ima_calc_file_ahash()
444 rc = ima_calc_file_hash_atfm(file, hash, tfm); in ima_calc_file_ahash()
452 struct ima_digest_data *hash, in ima_calc_file_hash_tfm() argument
[all …]
/linux/drivers/net/ethernet/freescale/fman/
H A Dfman_mac.h75 /* HASH defines */
196 static inline void free_hash_table(struct eth_hash_t *hash) in free_hash_table() argument
201 if (hash) { in free_hash_table()
202 if (hash->lsts) { in free_hash_table()
203 for (i = 0; i < hash->size; i++) { in free_hash_table()
205 dequeue_addr_from_hash_entry(&hash->lsts[i]); in free_hash_table()
209 dequeue_addr_from_hash_entry(&hash-> in free_hash_table()
214 kfree(hash->lsts); in free_hash_table()
217 kfree(hash); in free_hash_table()
224 struct eth_hash_t *hash; in alloc_hash_table() local
[all …]
/linux/fs/ubifs/
H A Dauth.c13 #include <crypto/hash.h>
21 * __ubifs_node_calc_hash - calculate the hash of a UBIFS node
23 * @node: the node to calculate a hash for
24 * @hash: the returned hash
29 u8 *hash) in __ubifs_node_calc_hash() argument
34 hash); in __ubifs_node_calc_hash()
38 * ubifs_hash_calc_hmac - calculate a HMAC from a hash
40 * @hash: the node to calculate a HMAC for
45 static int ubifs_hash_calc_hmac(const struct ubifs_info *c, const u8 *hash, in ubifs_hash_calc_hmac() argument
48 return crypto_shash_tfm_digest(c->hmac_tfm, hash, c->hash_len, hmac); in ubifs_hash_calc_hmac()
[all …]
/linux/certs/
H A Dblacklist.c2 /* System hash blacklist.
25 * the size of the currently longest supported hash algorithm is 512 bits,
45 * hex digits. The hash is kept in the description.
78 /* The hash is greater than MAX_HASH_LEN. */ in blacklist_vet_description()
147 static char *get_raw_hash(const u8 *hash, size_t hash_len, in get_raw_hash() argument
173 bin2hex(p, hash, hash_len); in get_raw_hash()
180 * mark_raw_hash_blacklisted - Add a hash to the system blacklist
181 * @hash: The hash as a hex string with a type prefix (eg. "tbs:23aa429783")
183 static int mark_raw_hash_blacklisted(const char *hash) in mark_raw_hash_blacklisted() argument
189 hash, in mark_raw_hash_blacklisted()
[all …]
/linux/drivers/net/wireless/broadcom/brcm80211/brcmfmac/
H A Dflowring.c62 struct brcmf_flowring_hash *hash; in brcmf_flowring_lookup() local
85 hash = flow->hash; in brcmf_flowring_lookup()
87 if ((sta || (memcmp(hash[hash_idx].mac, mac, ETH_ALEN) == 0)) && in brcmf_flowring_lookup()
88 (hash[hash_idx].fifo == fifo) && in brcmf_flowring_lookup()
89 (hash[hash_idx].ifidx == ifidx)) { in brcmf_flowring_lookup()
97 return hash[hash_idx].flowid; in brcmf_flowring_lookup()
107 struct brcmf_flowring_hash *hash; in brcmf_flowring_create() local
130 hash = flow->hash; in brcmf_flowring_create()
132 if ((hash[hash_idx].ifidx == BRCMF_FLOWRING_INVALID_IFIDX) && in brcmf_flowring_create()
133 (is_zero_ether_addr(hash[hash_idx].mac))) { in brcmf_flowring_create()
[all …]

12345678910>>...90