From 19f92790c2f9fc7f4e019d7b20663453606f210f Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 24 Jul 2017 11:40:12 -0400 Subject: Split compile-time control of RSA ModExp. At least for now, the speed tradeoff between software ModExp and our Verilog ModExp core differs significantly between signature and key generation. We don't really know why, but since key generation does not need to be constant time, we split out control over whether to use the software or FPGA implementation, so that we can use the FPGA for signature while using software for key generation. Revisit this if and when we figure out what the bottleneck is, as well as any time that the FPGA core itself changes significantly. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 866cb2b..ae6888d 100644 --- a/Makefile +++ b/Makefile @@ -175,28 +175,28 @@ endif ifeq "${RPC_MODE}" "none" OBJ += ${CORE_OBJ} - CFLAGS += -DHAL_RSA_USE_MODEXP=${RSA_USE_MODEXP_CORE} + CFLAGS += -DHAL_RSA_SIGN_USE_MODEXP=${RSA_USE_MODEXP_CORE} CFLAGS += -DHAL_ONLY_USE_SOFTWARE_HASH_CORES=${HASH_ONLY_USE_SOFT_CORES} CFLAGS += -DHAL_ECDSA_VERILOG_ECDSA256_MULTIPLIER=${ECDSA_USE_ECDSA256_CORE} CFLAGS += -DHAL_ECDSA_VERILOG_ECDSA384_MULTIPLIER=${ECDSA_USE_ECDSA384_CORE} else ifeq "${RPC_MODE}" "server" OBJ += ${CORE_OBJ} ${RPC_SERVER_OBJ} CFLAGS += -DRPC_CLIENT=RPC_CLIENT_LOCAL - CFLAGS += -DHAL_RSA_USE_MODEXP=${RSA_USE_MODEXP_CORE} + CFLAGS += -DHAL_RSA_SIGN_USE_MODEXP=${RSA_USE_MODEXP_CORE} CFLAGS += -DHAL_ONLY_USE_SOFTWARE_HASH_CORES=${HASH_ONLY_USE_SOFT_CORES} CFLAGS += -DHAL_ECDSA_VERILOG_ECDSA256_MULTIPLIER=${ECDSA_USE_ECDSA256_CORE} CFLAGS += -DHAL_ECDSA_VERILOG_ECDSA384_MULTIPLIER=${ECDSA_USE_ECDSA384_CORE} else ifeq "${RPC_MODE}" "client-simple" OBJ += ${RPC_CLIENT_OBJ} CFLAGS += -DRPC_CLIENT=RPC_CLIENT_REMOTE - CFLAGS += -DHAL_RSA_USE_MODEXP=0 + CFLAGS += -DHAL_RSA_SIGN_USE_MODEXP=0 CFLAGS += -DHAL_ONLY_USE_SOFTWARE_HASH_CORES=1 CFLAGS += -DHAL_ECDSA_VERILOG_ECDSA256_MULTIPLIER=0 CFLAGS += -DHAL_ECDSA_VERILOG_ECDSA384_MULTIPLIER=0 else ifeq "${RPC_MODE}" "client-mixed" OBJ += ${RPC_CLIENT_OBJ} CFLAGS += -DRPC_CLIENT=RPC_CLIENT_MIXED - CFLAGS += -DHAL_RSA_USE_MODEXP=0 + CFLAGS += -DHAL_RSA_SIGN_USE_MODEXP=0 CFLAGS += -DHAL_ONLY_USE_SOFTWARE_HASH_CORES=1 CFLAGS += -DHAL_ECDSA_VERILOG_ECDSA256_MULTIPLIER=0 CFLAGS += -DHAL_ECDSA_VERILOG_ECDSA384_MULTIPLIER=0 -- cgit v1.2.3