/openbmc/linux/samples/bpf/ |
H A D | hash_func01.h | 3 * 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 …]
|
/openbmc/linux/net/batman-adv/ |
H A D | hash.c | 7 #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 D | hash.h | 44 /** @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 …]
|
/openbmc/qemu/include/crypto/ |
H A D | hash.h | 2 * QEMU Crypto hash algorithms 47 * @alg: the hash algorithm 49 * Determine if @alg hash algorithm is supported by the 59 * @alg: the hash algorithm 61 * Determine the size of the hash digest in bytes 69 * @alg: the hash algorithm 70 * @iov: the array of memory regions to hash 72 * @result: pointer to hold output hash 76 * Computes the hash across all the memory regions 81 * @result_len match the size of the hash output. The digest will [all …]
|
/openbmc/linux/include/linux/ |
H A D | rhashtable.h | 3 * 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 …]
|
H A D | stringhash.h | 7 #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 D | xxhash.h | 2 * 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 …]
|
/openbmc/linux/net/ceph/crush/ |
H A D | hash.c | 3 # 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 …]
|
/openbmc/linux/drivers/net/xen-netback/ |
H A D | hash.c | 50 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 …]
|
/openbmc/qemu/crypto/ |
H A D | hash-gnutls.c | 2 * QEMU Crypto hash algorithms 25 #include "crypto/hash.h" 59 QCryptoHash *hash; in qcrypto_gnutls_hash_new() local 62 hash = g_new(QCryptoHash, 1); in qcrypto_gnutls_hash_new() 63 hash->alg = alg; in qcrypto_gnutls_hash_new() 64 hash->opaque = g_new(gnutls_hash_hd_t, 1); in qcrypto_gnutls_hash_new() 66 ret = gnutls_hash_init(hash->opaque, qcrypto_hash_alg_map[alg]); in qcrypto_gnutls_hash_new() 69 "Unable to initialize hash algorithm: %s", in qcrypto_gnutls_hash_new() 71 g_free(hash->opaque); in qcrypto_gnutls_hash_new() 72 g_free(hash); in qcrypto_gnutls_hash_new() [all …]
|
H A D | hash.c | 2 * QEMU Crypto hash algorithms 25 #include "crypto/hash.h" 81 int qcrypto_hash_updatev(QCryptoHash *hash, in qcrypto_hash_updatev() argument 86 QCryptoHashDriver *drv = hash->driver; in qcrypto_hash_updatev() 88 return drv->hash_update(hash, iov, niov, errp); in qcrypto_hash_updatev() 91 int qcrypto_hash_update(QCryptoHash *hash, in qcrypto_hash_update() argument 98 return qcrypto_hash_updatev(hash, &iov, 1, errp); in qcrypto_hash_update() 103 QCryptoHash *hash = NULL; in qcrypto_hash_new() local 106 error_setg(errp, "Unsupported hash algorithm %s", in qcrypto_hash_new() 112 hash = qcrypto_hash_afalg_driver.hash_new(alg, NULL); in qcrypto_hash_new() [all …]
|
H A D | hash-gcrypt.c | 2 * QEMU Crypto hash algorithms 25 #include "crypto/hash.h" 54 QCryptoHash *hash; in qcrypto_gcrypt_hash_new() local 57 hash = g_new(QCryptoHash, 1); in qcrypto_gcrypt_hash_new() 58 hash->alg = alg; in qcrypto_gcrypt_hash_new() 59 hash->opaque = g_new(gcry_md_hd_t, 1); in qcrypto_gcrypt_hash_new() 61 ret = gcry_md_open((gcry_md_hd_t *) hash->opaque, in qcrypto_gcrypt_hash_new() 65 "Unable to initialize hash algorithm: %s", in qcrypto_gcrypt_hash_new() 67 g_free(hash->opaque); in qcrypto_gcrypt_hash_new() 68 g_free(hash); in qcrypto_gcrypt_hash_new() [all …]
|
H A D | hash-glib.c | 2 * QEMU Crypto hash algorithms 24 #include "crypto/hash.h" 51 QCryptoHash *hash; in qcrypto_glib_hash_new() local 53 hash = g_new(QCryptoHash, 1); in qcrypto_glib_hash_new() 54 hash->alg = alg; in qcrypto_glib_hash_new() 55 hash->opaque = g_checksum_new(qcrypto_hash_alg_map[alg]); in qcrypto_glib_hash_new() 57 return hash; in qcrypto_glib_hash_new() 61 void qcrypto_glib_hash_free(QCryptoHash *hash) in qcrypto_glib_hash_free() argument 63 if (hash->opaque) { in qcrypto_glib_hash_free() 64 g_checksum_free(hash->opaque); in qcrypto_glib_hash_free() [all …]
|
H A D | hash-afalg.c | 2 * QEMU Crypto af_alg-backend hash/hmac support 18 #include "crypto/hash.h" 55 error_setg(errp, "Unsupported hash algorithm %d", alg); in qcrypto_afalg_hash_format_name() 120 /* Check if hash algorithm is supported */ in qcrypto_afalg_hash_new() 122 QCryptoHash *hash; in qcrypto_afalg_hash_new() local 125 error_setg(errp, "Unknown hash algorithm %d", alg); in qcrypto_afalg_hash_new() 131 hash = g_new(QCryptoHash, 1); in qcrypto_afalg_hash_new() 132 hash->alg = alg; in qcrypto_afalg_hash_new() 133 hash->opaque = qcrypto_afalg_hash_ctx_new(alg, errp); in qcrypto_afalg_hash_new() 134 if (!hash->opaque) { in qcrypto_afalg_hash_new() [all …]
|
H A D | hash-nettle.c | 2 * QEMU Crypto hash algorithms 24 #include "crypto/hash.h" 124 QCryptoHash *hash; in qcrypto_nettle_hash_new() local 126 hash = g_new(QCryptoHash, 1); in qcrypto_nettle_hash_new() 127 hash->alg = alg; in qcrypto_nettle_hash_new() 128 hash->opaque = g_new(union qcrypto_hash_ctx, 1); in qcrypto_nettle_hash_new() 130 qcrypto_hash_alg_map[alg].init(hash->opaque); in qcrypto_nettle_hash_new() 131 return hash; in qcrypto_nettle_hash_new() 135 void qcrypto_nettle_hash_free(QCryptoHash *hash) in qcrypto_nettle_hash_free() argument 137 union qcrypto_hash_ctx *ctx = hash->opaque; in qcrypto_nettle_hash_free() [all …]
|
/openbmc/linux/Documentation/admin-guide/device-mapper/ |
H A D | verity.rst | 21 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 …]
|
/openbmc/linux/net/netfilter/ipset/ |
H A D | Kconfig | 56 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 …]
|
/openbmc/linux/fs/verity/ |
H A D | hash_algs.c | 3 * fs-verity hash algorithms 10 #include <crypto/hash.h> 12 /* The hash algorithms supported by fs-verity */ 31 * fsverity_get_hash_alg() - validate and prepare a hash algorithm 33 * @num: the hash algorithm number 35 * Get the struct fsverity_hash_alg for the given hash algorithm number, and 36 * ensure it has a hash transform ready to go. The hash transforms are 40 * Return: pointer to the hash alg on success, else an ERR_PTR() 51 fsverity_warn(inode, "Unknown hash algorithm number: %u", num); in fsverity_get_hash_alg() 69 "Missing crypto API support for hash algorithm \"%s\"", in fsverity_get_hash_alg() [all …]
|
/openbmc/linux/drivers/gpu/drm/vboxvideo/ |
H A D | vbox_hgsmi.c | 11 /* 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 …]
|
/openbmc/linux/arch/powerpc/crypto/ |
H A D | aes-gcm-p10-glue.c | 17 #include <crypto/internal/hash.h> 58 u8 Htable[256]; /* Xi, Hash table(offset 32) */ 77 static void set_subkey(unsigned char *hash) in set_subkey() argument 79 *(u64 *)&hash[0] = be64_to_cpup((__be64 *)&hash[0]); in set_subkey() 80 *(u64 *)&hash[8] = be64_to_cpup((__be64 *)&hash[8]); in set_subkey() 85 * - Hash aad and copy to Xi. 87 static void set_aad(struct gcm_ctx *gctx, struct Hash_ctx *hash, in set_aad() argument 96 gcm_ghash_p10(nXi, hash->Htable+32, aad, i); in set_aad() 105 gcm_ghash_p10(gctx->aad_hash, hash->Htable+32, nXi, 16); in set_aad() 110 memcpy(hash->Htable, gctx->aad_hash, 16); in set_aad() [all …]
|
/openbmc/qemu/include/qemu/ |
H A D | qht.h | 33 * An entry is a pointer-hash pair. 56 * @n_elems: number of entries the hash table should be optimized for. 71 * qht_insert - Insert a pointer into the hash table 74 * @hash: hash corresponding to @p 78 * Inserting the same pointer @p with different @hash values is a bug. 81 * inserted into the hash table. 85 * (i.e. ht->cmp matches and the hash is the same) to @p-@h. If @existing 88 bool qht_insert(struct qht *ht, void *p, uint32_t hash, void **existing); 94 * @hash: hash of the pointer to be looked up 107 void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash, [all …]
|
/openbmc/u-boot/doc/uImage.FIT/ |
H A D | howto.txt | 98 Hash algo: crc32 99 Hash value: 2ae2bb40 100 Hash algo: sha1 101 Hash value: 3c200f34e2c226ddc789240cca0c59fc54a67cf4 143 Hash algo: crc32 144 Hash value: 2ae2bb40 145 Hash algo: sha1 146 Hash value: 3c200f34e2c226ddc789240cca0c59fc54a67cf4 165 Hash algo: crc32 166 Hash value: 2ae2bb40 [all …]
|
/openbmc/linux/lib/ |
H A D | hashtable_test.c | 37 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 …]
|
/openbmc/linux/fs/ext4/ |
H A D | hash.c | 3 * 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 …]
|
/openbmc/u-boot/include/ |
H A D | hash.h | 64 * hash_finish: Write the hash result to the given buffer 81 * hash_command: Process a hash command for a particular algorithm 83 * This common function is used to implement specific hash commands. 85 * @algo_name: Hash algorithm being used (lower case!) 96 * hash_block() - Hash a block according to the requested algorithm 98 * The caller probably knows the hash length for the chosen algorithm, but 102 * @algo_name: Hash algorithm to use 103 * @data: Data to hash 104 * @len: Lengh of data to hash in bytes 105 * @output: Place to put hash value [all …]
|