From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PULL 6/8] crypto: annotate xts_tweak_encdec as inlineable
Date: Wed, 24 Oct 2018 19:05:45 +0100 [thread overview]
Message-ID: <20181024180547.20429-7-berrange@redhat.com> (raw)
In-Reply-To: <20181024180547.20429-1-berrange@redhat.com>
Encouraging the compiler to inline xts_tweak_encdec increases the
performance for xts-aes-128 when built with gcrypt:
Encrypt: 545 MB/s -> 580 MB/s
Decrypt: 568 MB/s -> 602 MB/s
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
crypto/xts.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/crypto/xts.c b/crypto/xts.c
index 10ec83ff21..4277ad40de 100644
--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -81,11 +81,11 @@ static void xts_mult_x(xts_uint128 *I)
*
* Encrypt/decrypt data with a tweak
*/
-static void xts_tweak_encdec(const void *ctx,
- xts_cipher_func *func,
- const xts_uint128 *src,
- xts_uint128 *dst,
- xts_uint128 *iv)
+static inline void xts_tweak_encdec(const void *ctx,
+ xts_cipher_func *func,
+ const xts_uint128 *src,
+ xts_uint128 *dst,
+ xts_uint128 *iv)
{
/* tweak encrypt block i */
xts_uint128_xor(dst, src, iv);
--
2.17.2
next prev parent reply other threads:[~2018-10-24 18:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 18:05 [Qemu-devel] [PULL 0/8] Qcrypto next patches Daniel P. Berrangé
2018-10-24 18:05 ` [Qemu-devel] [PULL 1/8] crypto: expand algorithm coverage for cipher benchmark Daniel P. Berrangé
2018-10-24 18:05 ` [Qemu-devel] [PULL 2/8] crypto: remove code duplication in tweak encrypt/decrypt Daniel P. Berrangé
2018-10-24 18:05 ` [Qemu-devel] [PULL 3/8] crypto: introduce a xts_uint128 data type Daniel P. Berrangé
2018-10-24 18:05 ` [Qemu-devel] [PULL 4/8] crypto: convert xts_tweak_encdec to use xts_uint128 type Daniel P. Berrangé
2018-10-24 18:05 ` [Qemu-devel] [PULL 5/8] crypto: convert xts_mult_x " Daniel P. Berrangé
2018-10-24 18:05 ` Daniel P. Berrangé [this message]
2018-10-24 18:05 ` [Qemu-devel] [PULL 7/8] crypto: refactor XTS cipher mode test suite Daniel P. Berrangé
2018-10-24 18:05 ` [Qemu-devel] [PULL 8/8] crypto: add testing for unaligned buffers with XTS cipher mode Daniel P. Berrangé
2018-10-25 16:41 ` [Qemu-devel] [PULL 0/8] Qcrypto next patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181024180547.20429-7-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).