Lines Matching full:hash

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()
113 if (hash) { in qcrypto_hash_new()
114 hash->driver = &qcrypto_hash_afalg_driver; in qcrypto_hash_new()
115 return hash; in qcrypto_hash_new()
119 hash = qcrypto_hash_lib_driver.hash_new(alg, errp); in qcrypto_hash_new()
120 if (!hash) { in qcrypto_hash_new()
124 hash->driver = &qcrypto_hash_lib_driver; in qcrypto_hash_new()
125 return hash; in qcrypto_hash_new()
128 void qcrypto_hash_free(QCryptoHash *hash) in qcrypto_hash_free() argument
132 if (hash) { in qcrypto_hash_free()
133 drv = hash->driver; in qcrypto_hash_free()
134 drv->hash_free(hash); in qcrypto_hash_free()
138 int qcrypto_hash_finalize_bytes(QCryptoHash *hash, in qcrypto_hash_finalize_bytes() argument
143 QCryptoHashDriver *drv = hash->driver; in qcrypto_hash_finalize_bytes()
145 return drv->hash_finalize(hash, result, result_len, errp); in qcrypto_hash_finalize_bytes()
150 int qcrypto_hash_finalize_digest(QCryptoHash *hash, in qcrypto_hash_finalize_digest() argument
159 ret = qcrypto_hash_finalize_bytes(hash, &result, &resultlen, errp); in qcrypto_hash_finalize_digest()
172 int qcrypto_hash_finalize_base64(QCryptoHash *hash, in qcrypto_hash_finalize_base64() argument
180 ret = qcrypto_hash_finalize_bytes(hash, &result, &resultlen, errp); in qcrypto_hash_finalize_base64()