[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 6/8] crypto: annotate xts_tweak_encdec as inlinea
From: |
Daniel P . Berrangé |
Subject: |
[Qemu-devel] [PATCH v3 6/8] crypto: annotate xts_tweak_encdec as inlineable |
Date: |
Fri, 19 Oct 2018 12:08:54 +0100 |
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 <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
---
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
- [Qemu-devel] [PATCH v3 0/8] crypto: improve performance of XTS cipher mode, Daniel P . Berrangé, 2018/10/19
- [Qemu-devel] [PATCH v3 1/8] crypto: expand algorithm coverage for cipher benchmark, Daniel P . Berrangé, 2018/10/19
- [Qemu-devel] [PATCH v3 3/8] crypto: introduce a xts_uint128 data type, Daniel P . Berrangé, 2018/10/19
- [Qemu-devel] [PATCH v3 5/8] crypto: convert xts_mult_x to use xts_uint128 type, Daniel P . Berrangé, 2018/10/19
- [Qemu-devel] [PATCH v3 6/8] crypto: annotate xts_tweak_encdec as inlineable,
Daniel P . Berrangé <=
- [Qemu-devel] [PATCH v3 4/8] crypto: convert xts_tweak_encdec to use xts_uint128 type, Daniel P . Berrangé, 2018/10/19
- [Qemu-devel] [PATCH v3 7/8] crypto: refactor XTS cipher mode test suite, Daniel P . Berrangé, 2018/10/19
- [Qemu-devel] [PATCH v3 2/8] crypto: remove code duplication in tweak encrypt/decrypt, Daniel P . Berrangé, 2018/10/19
- [Qemu-devel] [PATCH v3 8/8] crypto: add testing for unaligned buffers with XTS cipher mode, Daniel P . Berrangé, 2018/10/19