blob: 62dfe8257afd3d3c6926cb0d3e6482784cef2bc9 [file] [log] [blame]
Longpeng(Mike)14a5a2a2017-07-14 14:04:04 -04001/*
2 * QEMU Crypto hmac driver supports
3 *
4 * Copyright (c) 2017 HUAWEI TECHNOLOGIES CO., LTD.
5 *
6 * Authors:
7 * Longpeng(Mike) <longpeng2@huawei.com>
8 *
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.
12 *
13 */
14
15#ifndef QCRYPTO_HMACPRIV_H
16#define QCRYPTO_HMACPRIV_H
17
18typedef struct QCryptoHmacDriver QCryptoHmacDriver;
19
20struct 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);
27
28 void (*hmac_free)(QCryptoHmac *hmac);
29};
30
Philippe Mathieu-Daudéf703f1e2023-03-20 14:21:29 +010031void *qcrypto_hmac_ctx_new(QCryptoHashAlgorithm alg,
32 const uint8_t *key, size_t nkey,
33 Error **errp);
Longpeng(Mike)14a5a2a2017-07-14 14:04:04 -040034extern QCryptoHmacDriver qcrypto_hmac_lib_driver;
35
Longpeng(Mike)42e7e152017-07-14 14:04:08 -040036#ifdef CONFIG_AF_ALG
37
38#include "afalgpriv.h"
39
Philippe Mathieu-Daudéf703f1e2023-03-20 14:21:29 +010040QCryptoAFAlg *qcrypto_afalg_hmac_ctx_new(QCryptoHashAlgorithm alg,
41 const uint8_t *key, size_t nkey,
42 Error **errp);
Longpeng(Mike)42e7e152017-07-14 14:04:08 -040043extern QCryptoHmacDriver qcrypto_hmac_afalg_driver;
44
45#endif
46
Longpeng(Mike)14a5a2a2017-07-14 14:04:04 -040047#endif