From 1ddc765477544a404cac4d5a8f58e67f4da57b72 Mon Sep 17 00:00:00 2001 From: wiire-a Date: Wed, 3 Jan 2018 21:13:00 +0100 Subject: [PATCH] Revert "build tomcrypt sha256 code as separate object" This reverts commit e552d93a50a25e902dc6b44d29f174fd9a8671bb. Usign GCC version 5.4.0 20160609 the code was 3 times slower (probably due to missing inlining and other optimizations). The binary was also >15kB bigger. --- Makefile | 2 +- src/crypto/hmac_sha256.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fadc3b4..5f43b8a 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ TARGET = pixiewps include $(SRCDIR)/crypto/tfm/sources.mak TFMSRC = $(patsubst ./%,$(SRCDIR)/crypto/tfm/%,$(TFM_SRCS)) TFMOBJS = $(TFMSRC:.c=.o) -TC_SRCS = ./aes_cbc.c ./aes.c ./sha256.c +TC_SRCS = ./aes_cbc.c ./aes.c TCSRC = $(patsubst ./%,$(SRCDIR)/crypto/tc/%,$(TC_SRCS)) TCOBJS = $(TCSRC:.c=.o) diff --git a/src/crypto/hmac_sha256.c b/src/crypto/hmac_sha256.c index a3868cb..defda43 100644 --- a/src/crypto/hmac_sha256.c +++ b/src/crypto/hmac_sha256.c @@ -5,7 +5,7 @@ #ifdef USE_OPENSSL # include #else -# include "tc/tomcrypt.h" +# include "tc/sha256.c" # define SHA256_CTX hash_state # define SHA256_Init(x) do { sha256_init(x); } while(0) # define SHA256_Update(x, y, z) sha256_process(x, y, z)