1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef QCRYPTO_AKCIPHERPRIV_H
23#define QCRYPTO_AKCIPHERPRIV_H
24
25#include "qapi/qapi-types-crypto.h"
26
27typedef struct QCryptoAkCipherDriver QCryptoAkCipherDriver;
28
29struct QCryptoAkCipher {
30 QCryptoAkCipherAlgorithm alg;
31 QCryptoAkCipherKeyType type;
32 int max_plaintext_len;
33 int max_ciphertext_len;
34 int max_signature_len;
35 int max_dgst_len;
36 QCryptoAkCipherDriver *driver;
37};
38
39struct QCryptoAkCipherDriver {
40 int (*encrypt)(QCryptoAkCipher *akcipher,
41 const void *in, size_t in_len,
42 void *out, size_t out_len, Error **errp);
43 int (*decrypt)(QCryptoAkCipher *akcipher,
44 const void *out, size_t out_len,
45 void *in, size_t in_len, Error **errp);
46 int (*sign)(QCryptoAkCipher *akcipher,
47 const void *in, size_t in_len,
48 void *out, size_t out_len, Error **errp);
49 int (*verify)(QCryptoAkCipher *akcipher,
50 const void *in, size_t in_len,
51 const void *in2, size_t in2_len, Error **errp);
52 void (*free)(QCryptoAkCipher *akcipher);
53};
54
55#endif
56