Home
last modified time | relevance | path

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

1234567891011

/qemu/include/crypto/
H A Dhash.h2 * 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 …]
H A Dpbkdf.h24 #include "crypto/hash.h"
88 * @hash: the hash algorithm
91 * in combination with the hash @hash.
95 bool qcrypto_pbkdf2_supports(QCryptoHashAlgo hash);
100 * @hash: the hash algorithm to use
122 int qcrypto_pbkdf2(QCryptoHashAlgo hash,
131 * @hash: the hash algorithm to use
150 uint64_t qcrypto_pbkdf2_count_iters(QCryptoHashAlgo hash,
/qemu/crypto/
H A Dhash-gnutls.c2 * 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 Dhash.c2 * 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 Dhash-gcrypt.c2 * 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 Dhash-glib.c2 * 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 Dhash-afalg.c2 * 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 Dhash-nettle.c2 * 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 …]
H A Dpbkdf-gcrypt.c26 bool qcrypto_pbkdf2_supports(QCryptoHashAlgo hash) in qcrypto_pbkdf2_supports() argument
28 switch (hash) { in qcrypto_pbkdf2_supports()
39 return qcrypto_hash_supports(hash); in qcrypto_pbkdf2_supports()
45 int qcrypto_pbkdf2(QCryptoHashAlgo hash, in qcrypto_pbkdf2() argument
73 if (hash >= G_N_ELEMENTS(hash_map) || in qcrypto_pbkdf2()
74 hash_map[hash] == GCRY_MD_NONE) { in qcrypto_pbkdf2()
76 "PBKDF does not support hash algorithm %s", in qcrypto_pbkdf2()
77 QCryptoHashAlgo_str(hash)); in qcrypto_pbkdf2()
82 hash_map[hash], in qcrypto_pbkdf2()
H A Dpbkdf-gnutls.c26 bool qcrypto_pbkdf2_supports(QCryptoHashAlgo hash) in qcrypto_pbkdf2_supports() argument
28 switch (hash) { in qcrypto_pbkdf2_supports()
36 return qcrypto_hash_supports(hash); in qcrypto_pbkdf2_supports()
42 int qcrypto_pbkdf2(QCryptoHashAlgo hash, in qcrypto_pbkdf2() argument
69 if (hash >= G_N_ELEMENTS(hash_map) || in qcrypto_pbkdf2()
70 hash_map[hash] == GNUTLS_DIG_UNKNOWN) { in qcrypto_pbkdf2()
72 "PBKDF does not support hash algorithm %s", in qcrypto_pbkdf2()
73 QCryptoHashAlgo_str(hash)); in qcrypto_pbkdf2()
77 ret = gnutls_pbkdf2(hash_map[hash], in qcrypto_pbkdf2()
H A Dhashpriv.h2 * QEMU Crypto hash driver supports
19 #include "crypto/hash.h"
25 int (*hash_update)(QCryptoHash *hash,
29 int (*hash_finalize)(QCryptoHash *hash,
33 void (*hash_free)(QCryptoHash *hash);
H A Dmeson.build10 'hash.c',
32 crypto_ss.add(nettle, files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'))
40 crypto_ss.add(gcrypt, files('hash-gcrypt.c', 'hmac-gcrypt.c', 'pbkdf-gcrypt.c'))
42 crypto_ss.add(gnutls, files('hash-gnutls.c', 'hmac-gnutls.c', 'pbkdf-gnutls.c'))
44 crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
51 crypto_ss.add(if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
/qemu/include/qemu/
H A Dqht.h33 * 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 …]
/qemu/docs/devel/
H A Debpf_rss.rst8 by calculating packet hash. Usually every queue is processed then by a specific guest CPU core.
18 of rx virtqueue based on lookup table built according to calculated symmetric hash
20 If steering BPF is set for TUN the BPF code calculates the hash of packet header and
27 queue_index = indirection_table[hash(<packet data>)%<indirection_table size>]
30 Not for all packets, the hash can/should be calculated.
32 Note: currently, eBPF RSS does not support hash reporting.
38 tap,vhost=off & virtio-net-pci,rss=on,hash=off
42 tap,vhost=on & virtio-net-pci,rss=on,hash=off
46 tap,vhost=off & virtio-net-pci,rss=on,hash=on
48 - eBPF is used, hash population feature is not reported to the guest:
[all …]
/qemu/tests/qemu-iotests/
H A D207.out43 …"options": {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": "hash", "typ…
45 Job failed: remote host key fingerprint 'md5:HASH' does not match host_key_check 'md5:wrong'
49 …"options": {"driver": "ssh", "location": {"host-key-check": {"hash": "HASH", "mode": "hash", "type…
60 …"options": {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": "hash", "typ…
62 Job failed: remote host key fingerprint 'sha1:HASH' does not match host_key_check 'sha1:wrong'
66 …"options": {"driver": "ssh", "location": {"host-key-check": {"hash": "HASH", "mode": "hash", "type…
77 …"options": {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": "hash", "typ…
79 Job failed: remote host key fingerprint 'sha256:HASH' does not match host_key_check 'sha256:wrong'
83 …"options": {"driver": "ssh", "location": {"host-key-check": {"hash": "HASH", "mode": "hash", "type…
H A D20735 if key == 'hash' and re.match('[0-9a-f]+', value):
36 return 'HASH'
41 return re.sub(p, r"\1 '\2:HASH'", qmsg)
155 'mode': 'hash',
157 'hash': md5_keys[key],
180 'mode': 'hash',
182 'hash': 'wrong',
195 'mode': 'hash',
197 'hash': md5_keys[matching_key],
217 'mode': 'hash',
[all …]
H A D082.out61 encrypt.hash-alg=<str> - Name of encryption hash algorithm
64 encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
87 encrypt.hash-alg=<str> - Name of encryption hash algorithm
90 encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
113 encrypt.hash-alg=<str> - Name of encryption hash algorithm
116 encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
139 encrypt.hash-alg=<str> - Name of encryption hash algorithm
142 encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
165 encrypt.hash-alg=<str> - Name of encryption hash algorithm
168 encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
[all …]
/qemu/tests/unit/
H A Dtest-crypto-pbkdf.c34 QCryptoHashAlgo hash; member
55 .hash = QCRYPTO_HASH_ALGO_SHA1,
69 .hash = QCRYPTO_HASH_ALGO_SHA1,
83 .hash = QCRYPTO_HASH_ALGO_SHA1,
97 .hash = QCRYPTO_HASH_ALGO_SHA1,
111 .hash = QCRYPTO_HASH_ALGO_SHA1,
126 .hash = QCRYPTO_HASH_ALGO_SHA1,
141 .hash = QCRYPTO_HASH_ALGO_SHA1,
157 .hash = QCRYPTO_HASH_ALGO_SHA1,
169 .hash = QCRYPTO_HASH_ALGO_SHA1,
[all …]
H A Dtest-qht.c29 uint32_t hash; in insert() local
34 hash = i; in insert()
36 inserted = qht_insert(&ht, &arr[i], hash, NULL); in insert()
38 inserted = qht_insert(&ht, &arr[i], hash, &existing); in insert()
49 uint32_t hash; in do_rm() local
51 hash = arr[i]; in do_rm()
53 g_assert_true(qht_remove(&ht, &arr[i], hash)); in do_rm()
55 g_assert_false(qht_remove(&ht, &arr[i], hash)); in do_rm()
78 uint32_t hash; in check() local
82 hash = i; in check()
[all …]
H A Dtest-crypto-hash.c2 * QEMU Crypto hash algorithms
25 #include "crypto/hash.h"
267 g_autoptr(QCryptoHash) hash = NULL; in test_hash_accumulate()
282 hash = qcrypto_hash_new(i, &error_fatal); in test_hash_accumulate()
283 g_assert(hash != NULL); in test_hash_accumulate()
285 /* Add each iovec to the hash context separately */ in test_hash_accumulate()
287 ret = qcrypto_hash_updatev(hash, in test_hash_accumulate()
294 ret = qcrypto_hash_finalize_bytes(hash, &result, &resultlen, in test_hash_accumulate()
312 g_test_add_func("/crypto/hash/iov", test_hash_iov); in main()
313 g_test_add_func("/crypto/hash/alloc", test_hash_alloc); in main()
[all …]
/qemu/util/
H A Dqsp.c21 * The appropriate thread-local data is found via a QHT, i.e. a concurrent hash
23 * all entries in the hash table. Depending on the number of threads and
45 * an intermediate hash table. This would simplify the code only slightly, but
98 /* initial sizing for hash tables */
111 * Call sites are the same for all threads, so we track them in a separate hash
137 * It pays off to _not_ hash callsite->file; hashing a string is slow, and
138 * without it we still get a pretty unique hash.
171 /* without the objects we need to hash the file name to get a decent hash */
270 uint32_t hash; in qsp_callsite_find() local
272 hash = qsp_callsite_hash(orig); in qsp_callsite_find()
[all …]
H A Dqht.c2 * qht.c - QEMU Hash Table, designed to scale for read-mostly workloads.
11 * - Trying to insert an already-existing hash-pointer pair is OK. However,
12 * it is not OK to insert into the same hash table different hash-pointer
24 * - Optional auto-resizing: the hash table resizes up if the load surpasses
29 * contain a few hash values and pointers; the u32 hash values are stored in
33 * - Resizing the hash table with concurrent lookups is easy.
47 * race with us) and then copying all entries into a new hash map. Then, the
59 * - Why not RCU-based hash tables? They would allow us to get rid of the
62 * More info on relativistic hash tables:
63 * + Triplett, McKenney & Walpole, "Resizable, Scalable, Concurrent Hash
[all …]
/qemu/tests/functional/qemu_test/
H A Dasset.py37 self.hash = hashsum
48 return "Asset: url=%s hash=%s cache=%s" % (
49 self.url, self.hash, self.cache_file)
55 if self.hash is None:
57 if len(self.hash) == 64:
59 elif len(self.hash) == 128:
62 raise AssetError(self, "unknown hash type")
64 # Calculate the hash of the file:
72 return self.hash == hl.hexdigest()
181 os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
[all …]
/qemu/ui/
H A Dvnc-palette.c2 * QEMU VNC display driver: palette hash table
33 uint32_t color, unsigned int hash) in palette_find() argument
37 QLIST_FOREACH(entry, &palette->table[hash], next) { in palette_find()
78 unsigned int hash; in palette_put() local
82 hash = palette_hash(color, palette->bpp) % VNC_PALETTE_HASH_SIZE; in palette_put()
83 entry = palette_find(palette, color, hash); in palette_put()
92 QLIST_INSERT_HEAD(&palette->table[hash], entry, next); in palette_put()
101 unsigned int hash; in palette_idx() local
103 hash = palette_hash(color, palette->bpp) % VNC_PALETTE_HASH_SIZE; in palette_idx()
104 entry = palette_find(palette, color, hash); in palette_idx()
/qemu/tests/bench/
H A Dbenchmark-crypto-akcipher.c24 QCryptoHashAlgo hash) in create_rsa_akcipher() argument
30 opt.u.rsa.hash_alg = hash; in create_rsa_akcipher()
43 #define HASH QCRYPTO_HASH_ALGO_SHA1 in test_rsa_speed() macro
46 create_rsa_akcipher(priv_key, keylen, PADDING, HASH); in test_rsa_speed()
57 QCryptoHashAlgo_str(HASH)); in test_rsa_speed()
68 QCryptoHashAlgo_str(HASH), in test_rsa_speed()
74 QCryptoHashAlgo_str(HASH)); in test_rsa_speed()
85 QCryptoHashAlgo_str(HASH), in test_rsa_speed()

1234567891011