mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
crypto/block: rename qcrypto_block_*crypt_helper
Rename qcrypto_block_*crypt_helper to qcrypto_block_cipher_*crypt_helper, as it's not about QCryptoBlock. This is needed to introduce qcrypto_block_*crypt_helper in the next commit, which will have QCryptoBlock pointer and than will be able to use additional fields of it, which in turn will be used to implement thread-safe QCryptoBlock operations. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
committed by
Daniel P. Berrangé
parent
1dc57b6038
commit
0270417c87
@@ -191,20 +191,20 @@ void qcrypto_block_free(QCryptoBlock *block)
|
||||
|
||||
|
||||
typedef int (*QCryptoCipherEncDecFunc)(QCryptoCipher *cipher,
|
||||
const void *in,
|
||||
void *out,
|
||||
size_t len,
|
||||
Error **errp);
|
||||
const void *in,
|
||||
void *out,
|
||||
size_t len,
|
||||
Error **errp);
|
||||
|
||||
static int do_qcrypto_block_encdec(QCryptoCipher *cipher,
|
||||
size_t niv,
|
||||
QCryptoIVGen *ivgen,
|
||||
int sectorsize,
|
||||
uint64_t offset,
|
||||
uint8_t *buf,
|
||||
size_t len,
|
||||
QCryptoCipherEncDecFunc func,
|
||||
Error **errp)
|
||||
static int do_qcrypto_block_cipher_encdec(QCryptoCipher *cipher,
|
||||
size_t niv,
|
||||
QCryptoIVGen *ivgen,
|
||||
int sectorsize,
|
||||
uint64_t offset,
|
||||
uint8_t *buf,
|
||||
size_t len,
|
||||
QCryptoCipherEncDecFunc func,
|
||||
Error **errp)
|
||||
{
|
||||
uint8_t *iv;
|
||||
int ret = -1;
|
||||
@@ -249,29 +249,31 @@ static int do_qcrypto_block_encdec(QCryptoCipher *cipher,
|
||||
}
|
||||
|
||||
|
||||
int qcrypto_block_decrypt_helper(QCryptoCipher *cipher,
|
||||
size_t niv,
|
||||
QCryptoIVGen *ivgen,
|
||||
int sectorsize,
|
||||
uint64_t offset,
|
||||
uint8_t *buf,
|
||||
size_t len,
|
||||
Error **errp)
|
||||
int qcrypto_block_cipher_decrypt_helper(QCryptoCipher *cipher,
|
||||
size_t niv,
|
||||
QCryptoIVGen *ivgen,
|
||||
int sectorsize,
|
||||
uint64_t offset,
|
||||
uint8_t *buf,
|
||||
size_t len,
|
||||
Error **errp)
|
||||
{
|
||||
return do_qcrypto_block_encdec(cipher, niv, ivgen, sectorsize, offset,
|
||||
buf, len, qcrypto_cipher_decrypt, errp);
|
||||
return do_qcrypto_block_cipher_encdec(cipher, niv, ivgen, sectorsize,
|
||||
offset, buf, len,
|
||||
qcrypto_cipher_decrypt, errp);
|
||||
}
|
||||
|
||||
|
||||
int qcrypto_block_encrypt_helper(QCryptoCipher *cipher,
|
||||
size_t niv,
|
||||
QCryptoIVGen *ivgen,
|
||||
int sectorsize,
|
||||
uint64_t offset,
|
||||
uint8_t *buf,
|
||||
size_t len,
|
||||
Error **errp)
|
||||
int qcrypto_block_cipher_encrypt_helper(QCryptoCipher *cipher,
|
||||
size_t niv,
|
||||
QCryptoIVGen *ivgen,
|
||||
int sectorsize,
|
||||
uint64_t offset,
|
||||
uint8_t *buf,
|
||||
size_t len,
|
||||
Error **errp)
|
||||
{
|
||||
return do_qcrypto_block_encdec(cipher, niv, ivgen, sectorsize, offset,
|
||||
buf, len, qcrypto_cipher_encrypt, errp);
|
||||
return do_qcrypto_block_cipher_encdec(cipher, niv, ivgen, sectorsize,
|
||||
offset, buf, len,
|
||||
qcrypto_cipher_encrypt, errp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user