Home
last modified time | relevance | path

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

12345678910>>...125

/kernel/linux/linux-4.19/samples/bpf/
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 …]
/kernel/linux/linux-5.10/samples/bpf/
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 …]
/kernel/linux/linux-5.10/net/batman-adv/
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 …]
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 …]
/kernel/linux/linux-4.19/net/batman-adv/
Dhash.c19 #include "hash.h"
26 /* clears the hash */
27 static void batadv_hash_init(struct batadv_hashtable *hash) in batadv_hash_init() argument
31 for (i = 0; i < hash->size; i++) { in batadv_hash_init()
32 INIT_HLIST_HEAD(&hash->table[i]); in batadv_hash_init()
33 spin_lock_init(&hash->list_locks[i]); in batadv_hash_init()
38 * batadv_hash_destroy() - Free only the hashtable and the hash itself
39 * @hash: hash object to destroy
41 void batadv_hash_destroy(struct batadv_hashtable *hash) in batadv_hash_destroy() argument
43 kfree(hash->list_locks); in batadv_hash_destroy()
[all …]
Dhash.h56 /** @list_locks: spinlock for each hash list entry */
63 /* allocates and clears the hash */
67 void batadv_hash_set_lock_class(struct batadv_hashtable *hash,
70 /* free only the hashtable and the hash itself. */
71 void batadv_hash_destroy(struct batadv_hashtable *hash);
75 * @hash: storage hash table
76 * @compare: callback to determine if 2 hash elements are identical
77 * @choose: callback calculating the hash index
81 * Return: 0 on success, 1 if the element already is in the hash
84 static inline int batadv_hash_add(struct batadv_hashtable *hash, in batadv_hash_add() argument
[all …]
/kernel/linux/linux-4.19/include/linux/
Drhashtable.h3 * Resizable, Scalable, Concurrent Hash Table
36 * The maximum (not average) chain length grows with the size of the hash
39 * The value of 16 is selected so that even if the hash table grew to
50 * struct bucket_table - Table of hash buckets
51 * @size: Number of hash buckets
54 * @hash_rnd: Random seed to fold into hash
61 * @buckets: size * hash buckets
93 unsigned int hash) in rht_bucket_index() argument
95 return hash & (tbl->size - 1); in rht_bucket_index()
102 unsigned int hash; in rht_key_get_hash() local
[all …]
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 …]
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 …]
/kernel/linux/linux-5.10/include/linux/
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 buckets
69 * @hash_rnd: Random seed to fold into hash
[all …]
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 …]
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 …]
/kernel/linux/linux-4.19/net/ceph/crush/
Dhash.c3 # include <linux/crush/hash.h>
5 # include "hash.h"
10 * http://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 …]
/kernel/linux/linux-5.10/net/ceph/crush/
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 …]
/kernel/linux/linux-5.10/drivers/net/xen-netback/
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 …]
/kernel/linux/linux-4.19/drivers/net/xen-netback/
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()
64 new->seq = atomic_inc_return(&vif->hash.cache.seq); in xenvif_add_hash()
65 list_add_rcu(&new->link, &vif->hash.cache.list); in xenvif_add_hash()
67 if (++vif->hash.cache.count > xenvif_hash_cache_size) { in xenvif_add_hash()
69 vif->hash.cache.count--; in xenvif_add_hash()
74 spin_unlock_irqrestore(&vif->hash.cache.lock, flags); in xenvif_add_hash()
85 val = xen_netif_toeplitz_hash(vif->hash.key, in xenvif_new_hash()
86 sizeof(vif->hash.key), in xenvif_new_hash()
103 spin_lock_irqsave(&vif->hash.cache.lock, flags); in xenvif_flush_hash()
[all …]
/kernel/linux/linux-4.19/Documentation/device-mapper/
Dverity.txt17 This is the type of the on-disk hash format.
33 This is the device that supplies the hash tree data. It may be
40 Each block corresponds to one digest on the hash device.
43 The size of a hash block in bytes.
52 to the root block of the hash tree.
55 The cryptographic hash algorithm used for this device. This should
59 The hexadecimal encoding of the cryptographic hash of the root hash block
60 and the salt. This hash should be trusted as there is no other authenticity
88 Use forward error correction (FEC) to recover from corruption if hash
90 may be the same device where data and hash blocks reside, in which case
[all …]
/kernel/linux/linux-5.10/Documentation/admin-guide/device-mapper/
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
96 Use forward error correction (FEC) to recover from corruption if hash
98 may be the same device where data and hash blocks reside, in which case
[all …]
/kernel/linux/linux-5.10/fs/verity/
Dhash_algs.c3 * fs/verity/hash_algs.c: fs-verity hash algorithms
10 #include <crypto/hash.h>
13 /* The hash algorithms supported by fs-verity */
30 * fsverity_get_hash_alg() - validate and prepare a hash algorithm
32 * @num: the hash algorithm number
34 * Get the struct fsverity_hash_alg for the given hash algorithm number, and
35 * ensure it has a hash transform ready to go. The hash transforms are
39 * Return: pointer to the hash alg on success, else an ERR_PTR()
50 fsverity_warn(inode, "Unknown hash algorithm number: %u", num); in fsverity_get_hash_alg()
72 "Missing crypto API support for hash algorithm \"%s\"", in fsverity_get_hash_alg()
[all …]
/kernel/linux/linux-4.19/net/netfilter/ipset/
DKconfig55 tristate "hash:ip set support"
58 This option adds the hash:ip set type support, by which one
65 tristate "hash:ip,mark set support"
68 This option adds the hash:ip,mark set type support, by which one
74 tristate "hash:ip,port set support"
77 This option adds the hash:ip,port set type support, by which one
83 tristate "hash:ip,port,ip set support"
86 This option adds the hash:ip,port,ip set type support, by which
93 tristate "hash:ip,port,net set support"
96 This option adds the hash:ip,port,net set type support, by which
[all …]
/kernel/linux/linux-5.10/net/netfilter/ipset/
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 …]
/kernel/linux/linux-4.19/security/integrity/ima/
Dima_crypto.c13 * Calculates md5/sha1 file hash, template hash, boot-aggreate hash
26 #include <crypto/hash.h>
76 pr_info("Allocated hash algorithm: %s\n", in ima_init_crypto()
208 struct ima_digest_data *hash, in ima_calc_file_hash_atfm() argument
219 hash->length = crypto_ahash_digestsize(tfm); in ima_calc_file_hash_atfm()
310 ahash_request_set_crypt(req, NULL, hash->digest, 0); in ima_calc_file_hash_atfm()
318 static int ima_calc_file_ahash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_ahash() argument
323 tfm = ima_alloc_atfm(hash->algo); in ima_calc_file_ahash()
327 rc = ima_calc_file_hash_atfm(file, hash, tfm); in ima_calc_file_ahash()
335 struct ima_digest_data *hash, in ima_calc_file_hash_tfm() argument
[all …]
/kernel/linux/linux-5.10/drivers/gpu/drm/vboxvideo/
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 …]
/kernel/linux/linux-4.19/drivers/crypto/ux500/hash/
Dhash_alg.h22 /* Power on Reset values HASH registers */
151 * struct hash_register - Contains all registers in ux500 hash hardware.
152 * @cr: HASH control register (0x000).
153 * @din: HASH data input register (0x004).
154 * @str: HASH start register (0x008).
155 * @hx: HASH digest register 0..7 (0x00c-0x01C).
161 * @csfull: HASH context full register (0x0F8).
162 * @csdatain: HASH context swap data input register (0x0FC).
163 * @csrx: HASH context swap register 0..51 (0x100-0x1CC).
165 * @periphid0: HASH peripheral identification register 0 (0xFE0).
[all …]
/kernel/linux/linux-5.10/drivers/crypto/ux500/hash/
Dhash_alg.h22 /* Power on Reset values HASH registers */
151 * struct hash_register - Contains all registers in ux500 hash hardware.
152 * @cr: HASH control register (0x000).
153 * @din: HASH data input register (0x004).
154 * @str: HASH start register (0x008).
155 * @hx: HASH digest register 0..7 (0x00c-0x01C).
161 * @csfull: HASH context full register (0x0F8).
162 * @csdatain: HASH context swap data input register (0x0FC).
163 * @csrx: HASH context swap register 0..51 (0x100-0x1CC).
165 * @periphid0: HASH peripheral identification register 0 (0xFE0).
[all …]

12345678910>>...125