Import QEMU upstream snapshot d2e570c
Upstream: https://gitlab.com/qemu-project/qemu.git Upstream-Commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* QEMU Crypto cipher driver supports
|
||||
*
|
||||
* Copyright (c) 2017 HUAWEI TECHNOLOGIES CO., LTD.
|
||||
*
|
||||
* Authors:
|
||||
* Longpeng(Mike) <[email protected]>
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or
|
||||
* (at your option) any later version. See the COPYING file in the
|
||||
* top-level directory.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef QCRYPTO_CIPHERPRIV_H
|
||||
#define QCRYPTO_CIPHERPRIV_H
|
||||
|
||||
#include "qapi/qapi-types-crypto.h"
|
||||
|
||||
struct QCryptoCipherDriver {
|
||||
int (*cipher_encrypt)(QCryptoCipher *cipher,
|
||||
const void *in,
|
||||
void *out,
|
||||
size_t len,
|
||||
Error **errp);
|
||||
|
||||
int (*cipher_decrypt)(QCryptoCipher *cipher,
|
||||
const void *in,
|
||||
void *out,
|
||||
size_t len,
|
||||
Error **errp);
|
||||
|
||||
int (*cipher_setiv)(QCryptoCipher *cipher,
|
||||
const uint8_t *iv, size_t niv,
|
||||
Error **errp);
|
||||
|
||||
int (*cipher_setaad)(QCryptoCipher *cipher,
|
||||
const uint8_t *aad, size_t len,
|
||||
Error **errp);
|
||||
|
||||
int (*cipher_gettag)(QCryptoCipher *cipher,
|
||||
uint8_t *tag, size_t len,
|
||||
Error **errp);
|
||||
|
||||
void (*cipher_free)(QCryptoCipher *cipher);
|
||||
};
|
||||
|
||||
#ifdef CONFIG_AF_ALG
|
||||
|
||||
#include "afalgpriv.h"
|
||||
|
||||
extern QCryptoCipher *
|
||||
qcrypto_afalg_cipher_ctx_new(QCryptoCipherAlgo alg,
|
||||
QCryptoCipherMode mode,
|
||||
const uint8_t *key,
|
||||
size_t nkey, Error **errp);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user