1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef QCRYPTO_CIPHERPRIV_H
16#define QCRYPTO_CIPHERPRIV_H
17
18#include "qapi/qapi-types-crypto.h"
19
20struct QCryptoCipherDriver {
21 int (*cipher_encrypt)(QCryptoCipher *cipher,
22 const void *in,
23 void *out,
24 size_t len,
25 Error **errp);
26
27 int (*cipher_decrypt)(QCryptoCipher *cipher,
28 const void *in,
29 void *out,
30 size_t len,
31 Error **errp);
32
33 int (*cipher_setiv)(QCryptoCipher *cipher,
34 const uint8_t *iv, size_t niv,
35 Error **errp);
36
37 void (*cipher_free)(QCryptoCipher *cipher);
38};
39
40#ifdef CONFIG_AF_ALG
41
42#include "afalgpriv.h"
43
44extern QCryptoCipher *
45qcrypto_afalg_cipher_ctx_new(QCryptoCipherAlgorithm alg,
46 QCryptoCipherMode mode,
47 const uint8_t *key,
48 size_t nkey, Error **errp);
49
50#endif
51
52#endif
53