summaryrefslogtreecommitdiffstats
path: root/crypto/cipher-builtin.c
diff options
context:
space:
mode:
authorPeter Maydell2020-05-07 15:30:12 +0200
committerPeter Maydell2020-05-07 15:30:12 +0200
commit3c7adbc67d9a5c3e992a4dd13b8704464daaad5b (patch)
tree61ad38c2db6ad30906836739a48a9aa9904acb4c /crypto/cipher-builtin.c
parentMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200507' into... (diff)
parentcrypto: extend hash benchmark to cover more algorithms (diff)
downloadqemu-3c7adbc67d9a5c3e992a4dd13b8704464daaad5b.tar.gz
qemu-3c7adbc67d9a5c3e992a4dd13b8704464daaad5b.tar.xz
qemu-3c7adbc67d9a5c3e992a4dd13b8704464daaad5b.zip
Merge remote-tracking branch 'remotes/berrange/tags/qcrypto-next-pull-request' into staging
Misc crypto subsystem fixes * Improve error message for large files when creating LUKS volumes * Expand crypto hash benchmark coverage * Misc code refactoring with no functional change # gpg: Signature made Thu 07 May 2020 12:57:02 BST # gpg: using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full] # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full] # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange/tags/qcrypto-next-pull-request: crypto: extend hash benchmark to cover more algorithms block: luks: better error message when creating too large files crypto: Redundant type conversion for AES_KEY pointer crypto/secret: fix inconsequential errors. crypto: fix getter of a QCryptoSecret's property Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'crypto/cipher-builtin.c')
-rw-r--r--crypto/cipher-builtin.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
index bf8413e71a..35cf7820d9 100644
--- a/crypto/cipher-builtin.c
+++ b/crypto/cipher-builtin.c
@@ -74,7 +74,7 @@ static void qcrypto_cipher_free_aes(QCryptoCipher *cipher)
}
-static void qcrypto_cipher_aes_ecb_encrypt(AES_KEY *key,
+static void qcrypto_cipher_aes_ecb_encrypt(const AES_KEY *key,
const void *in,
void *out,
size_t len)
@@ -100,7 +100,7 @@ static void qcrypto_cipher_aes_ecb_encrypt(AES_KEY *key,
}
-static void qcrypto_cipher_aes_ecb_decrypt(AES_KEY *key,
+static void qcrypto_cipher_aes_ecb_decrypt(const AES_KEY *key,
const void *in,
void *out,
size_t len)
@@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const void *ctx,
{
const QCryptoCipherBuiltinAESContext *aesctx = ctx;
- qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
- src, dst, length);
+ qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
}
@@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const void *ctx,
{
const QCryptoCipherBuiltinAESContext *aesctx = ctx;
- qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
- src, dst, length);
+ qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
}