Lines Matching full:hash

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()
135 free(hash); in qcrypto_afalg_hash_new()
139 return hash; in qcrypto_afalg_hash_new()
143 void qcrypto_afalg_hash_free(QCryptoHash *hash) in qcrypto_afalg_hash_free() argument
145 QCryptoAFAlgo *ctx = hash->opaque; in qcrypto_afalg_hash_free()
151 g_free(hash); in qcrypto_afalg_hash_free()
159 * be provided to calculate the final hash.
201 "Result buffer size %zu is not match hash %d", in qcrypto_afalg_recv_from_kernel()
206 /* hash && get result */ in qcrypto_afalg_recv_from_kernel()
220 int qcrypto_afalg_hash_update(QCryptoHash *hash, in qcrypto_afalg_hash_update() argument
225 return qcrypto_afalg_send_to_kernel((QCryptoAFAlgo *) hash->opaque, in qcrypto_afalg_hash_update()
230 int qcrypto_afalg_hash_finalize(QCryptoHash *hash, in qcrypto_afalg_hash_finalize() argument
235 return qcrypto_afalg_recv_from_kernel((QCryptoAFAlgo *) hash->opaque, in qcrypto_afalg_hash_finalize()
236 hash->alg, result, result_len, errp); in qcrypto_afalg_hash_finalize()