xref: /openbmc/qemu/crypto/hmac-glib.c (revision 12a4f2162ad27f0d76fb9187dfc70a94e7bbd319)
1*12a4f216SLongpeng(Mike) /*
2*12a4f216SLongpeng(Mike)  * QEMU Crypto hmac algorithms (based on glib)
3*12a4f216SLongpeng(Mike)  *
4*12a4f216SLongpeng(Mike)  * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
5*12a4f216SLongpeng(Mike)  *
6*12a4f216SLongpeng(Mike)  * Authors:
7*12a4f216SLongpeng(Mike)  *    Longpeng(Mike) <longpeng2@huawei.com>
8*12a4f216SLongpeng(Mike)  *
9*12a4f216SLongpeng(Mike)  * This work is licensed under the terms of the GNU GPL, version 2 or
10*12a4f216SLongpeng(Mike)  * (at your option) any later version.  See the COPYING file in the
11*12a4f216SLongpeng(Mike)  * top-level directory.
12*12a4f216SLongpeng(Mike)  *
13*12a4f216SLongpeng(Mike)  */
14*12a4f216SLongpeng(Mike) 
15*12a4f216SLongpeng(Mike) #include "qemu/osdep.h"
16*12a4f216SLongpeng(Mike) #include "qapi/error.h"
17*12a4f216SLongpeng(Mike) #include "crypto/hmac.h"
18*12a4f216SLongpeng(Mike) 
19*12a4f216SLongpeng(Mike) bool qcrypto_hmac_supports(QCryptoHashAlgorithm alg)
20*12a4f216SLongpeng(Mike) {
21*12a4f216SLongpeng(Mike)     return false;
22*12a4f216SLongpeng(Mike) }
23*12a4f216SLongpeng(Mike) 
24*12a4f216SLongpeng(Mike) QCryptoHmac *qcrypto_hmac_new(QCryptoHashAlgorithm alg,
25*12a4f216SLongpeng(Mike)                               const uint8_t *key, size_t nkey,
26*12a4f216SLongpeng(Mike)                               Error **errp)
27*12a4f216SLongpeng(Mike) {
28*12a4f216SLongpeng(Mike)     return NULL;
29*12a4f216SLongpeng(Mike) }
30*12a4f216SLongpeng(Mike) 
31*12a4f216SLongpeng(Mike) void qcrypto_hmac_free(QCryptoHmac *hmac)
32*12a4f216SLongpeng(Mike) {
33*12a4f216SLongpeng(Mike)     return;
34*12a4f216SLongpeng(Mike) }
35*12a4f216SLongpeng(Mike) 
36*12a4f216SLongpeng(Mike) int qcrypto_hmac_bytesv(QCryptoHmac *hmac,
37*12a4f216SLongpeng(Mike)                         const struct iovec *iov,
38*12a4f216SLongpeng(Mike)                         size_t niov,
39*12a4f216SLongpeng(Mike)                         uint8_t **result,
40*12a4f216SLongpeng(Mike)                         size_t *resultlen,
41*12a4f216SLongpeng(Mike)                         Error **errp)
42*12a4f216SLongpeng(Mike) {
43*12a4f216SLongpeng(Mike)     return -1;
44*12a4f216SLongpeng(Mike) }
45