Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-migration-20210726a...
[qemu/armbru.git] / crypto / hmacpriv.h
blob4387ca2587f956289c6b45843872621a9a4c3587
1 /*
2 * QEMU Crypto hmac driver supports
4 * Copyright (c) 2017 HUAWEI TECHNOLOGIES CO., LTD.
6 * Authors:
7 * Longpeng(Mike) <longpeng2@huawei.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or
10 * (at your option) any later version. See the COPYING file in the
11 * top-level directory.
15 #ifndef QCRYPTO_HMACPRIV_H
16 #define QCRYPTO_HMACPRIV_H
18 typedef struct QCryptoHmacDriver QCryptoHmacDriver;
20 struct QCryptoHmacDriver {
21 int (*hmac_bytesv)(QCryptoHmac *hmac,
22 const struct iovec *iov,
23 size_t niov,
24 uint8_t **result,
25 size_t *resultlen,
26 Error **errp);
28 void (*hmac_free)(QCryptoHmac *hmac);
31 extern void *qcrypto_hmac_ctx_new(QCryptoHashAlgorithm alg,
32 const uint8_t *key, size_t nkey,
33 Error **errp);
34 extern QCryptoHmacDriver qcrypto_hmac_lib_driver;
36 #ifdef CONFIG_AF_ALG
38 #include "afalgpriv.h"
40 extern QCryptoAFAlg *
41 qcrypto_afalg_hmac_ctx_new(QCryptoHashAlgorithm alg,
42 const uint8_t *key, size_t nkey,
43 Error **errp);
44 extern QCryptoHmacDriver qcrypto_hmac_afalg_driver;
46 #endif
48 #endif