Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / crypto / hashpriv.h
blob83b9256886e5a59b19adc679c28ba9b1c1c3b9f9
1 /*
2 * QEMU Crypto hash driver supports
4 * Copyright (c) 2024 Seagate Technology LLC and/or its Affiliates
5 * Copyright (c) 2017 HUAWEI TECHNOLOGIES CO., LTD.
7 * Authors:
8 * Longpeng(Mike) <longpeng2@huawei.com>
10 * This work is licensed under the terms of the GNU GPL, version 2 or
11 * (at your option) any later version. See the COPYING file in the
12 * top-level directory.
16 #ifndef QCRYPTO_HASHPRIV_H
17 #define QCRYPTO_HASHPRIV_H
19 #include "crypto/hash.h"
21 typedef struct QCryptoHashDriver QCryptoHashDriver;
23 struct QCryptoHashDriver {
24 QCryptoHash *(*hash_new)(QCryptoHashAlgo alg, Error **errp);
25 int (*hash_update)(QCryptoHash *hash,
26 const struct iovec *iov,
27 size_t niov,
28 Error **errp);
29 int (*hash_finalize)(QCryptoHash *hash,
30 uint8_t **result,
31 size_t *resultlen,
32 Error **errp);
33 void (*hash_free)(QCryptoHash *hash);
36 extern QCryptoHashDriver qcrypto_hash_lib_driver;
38 #ifdef CONFIG_AF_ALG
40 #include "afalgpriv.h"
42 extern QCryptoHashDriver qcrypto_hash_afalg_driver;
44 #endif
46 #endif