Mailing List Archive

[PATCH 4/4] gost28147: inline gost_val function to speed up code
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

* cipher/gost28147.c (gost_val): mark function as inline
--
This improves the speed of the cipher
Cipher:
GOST28147 | nanosecs/byte mebibytes/sec cycles/byte
Before:
ECB enc | 18.89 ns/B 50.48 MiB/s - c/B
ECB dec | 18.71 ns/B 50.96 MiB/s - c/B
After:
ECB enc | 17.83 ns/B 53.48 MiB/s - c/B
ECB dec | 17.38 ns/B 54.89 MiB/s - c/B

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
cipher/gost28147.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cipher/gost28147.c b/cipher/gost28147.c
index db7e9412c7cd..f30ca16a4d02 100644
--- a/cipher/gost28147.c
+++ b/cipher/gost28147.c
@@ -60,7 +60,7 @@ gost_setkey (void *c, const byte *key, unsigned keylen,
return GPG_ERR_NO_ERROR;
}

-static u32
+static inline u32
gost_val (u32 subkey, u32 cm1, const u32 *sbox)
{
cm1 += subkey;
--
2.24.0


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel