[PATCH 4/4] gost28147: inline gost_val function to speed up code

dbaryshkov at gmail.com dbaryshkov at gmail.com
Tue Nov 12 14:50:05 CET 2019


From: Dmitry Eremin-Solenikov <dbaryshkov at 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 at 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




More information about the Gcrypt-devel mailing list