2 * QEMU Crypto af_alg support
4 * Copyright (c) 2017 HUAWEI TECHNOLOGIES CO., LTD.
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.
14 #ifndef QCRYPTO_AFALGPRIV_H
15 #define QCRYPTO_AFALGPRIV_H
17 #include <linux/if_alg.h>
19 #define SALG_TYPE_LEN_MAX 14
20 #define SALG_NAME_LEN_MAX 64
26 #define AFALG_TYPE_CIPHER "skcipher"
27 #define AFALG_TYPE_HASH "hash"
29 #define ALG_OPTYPE_LEN 4
30 #define ALG_MSGIV_LEN(len) (sizeof(struct af_alg_iv) + (len))
32 typedef struct QCryptoAFAlg QCryptoAFAlg
;
42 * qcrypto_afalg_comm_alloc:
43 * @type: the type of crypto operation
44 * @name: the name of crypto operation
46 * Allocate a QCryptoAFAlg object and bind itself to
50 * a new QCryptoAFAlg object, or NULL in error.
53 qcrypto_afalg_comm_alloc(const char *type
, const char *name
,
58 * @afalg: the QCryptoAFAlg object
62 void qcrypto_afalg_comm_free(QCryptoAFAlg
*afalg
);