crypto: annotate xts_tweak_encdec as inlineable
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 9 Oct 2018 09:50:43 +0000 (10:50 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 24 Oct 2018 18:03:37 +0000 (19:03 +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 <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
crypto/xts.c

index 10ec83ff2193974a7a41bede16c10469abced849..4277ad40de5dabf83637e13e6da3d1c73fddb681 100644 (file)
@@ -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);