diff options
Diffstat (limited to 'crypto/block.c')
-rw-r--r-- | crypto/block.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/block.c b/crypto/block.c index d43139dbc7..3fe3de2ef8 100644 --- a/crypto/block.c +++ b/crypto/block.c @@ -277,3 +277,31 @@ int qcrypto_block_cipher_encrypt_helper(QCryptoCipher *cipher, offset, buf, len, qcrypto_cipher_encrypt, errp); } + + +int qcrypto_block_decrypt_helper(QCryptoBlock *block, + int sectorsize, + uint64_t offset, + uint8_t *buf, + size_t len, + Error **errp) +{ + return do_qcrypto_block_cipher_encdec(block->cipher, block->niv, + block->ivgen, + sectorsize, offset, buf, len, + qcrypto_cipher_decrypt, errp); +} + + +int qcrypto_block_encrypt_helper(QCryptoBlock *block, + int sectorsize, + uint64_t offset, + uint8_t *buf, + size_t len, + Error **errp) +{ + return do_qcrypto_block_cipher_encdec(block->cipher, block->niv, + block->ivgen, + sectorsize, offset, buf, len, + qcrypto_cipher_encrypt, errp); +} |