From ac6de20ea5f85277fddbbd79b5c4d7708d88b904 Mon Sep 17 00:00:00 2001 From: Ken MacKay Date: Wed, 5 Aug 2015 22:15:35 -0700 Subject: [PATCH] Only declare functions if needed. (#50) --- uECC.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uECC.c b/uECC.c index 4c32e54..1987c5c 100644 --- a/uECC.c +++ b/uECC.c @@ -196,6 +196,9 @@ static uECC_word_t vli_sub(uECC_word_t *result, } #endif /* !asm_sub */ +#if !asm_mult || !asm_square || \ + (uECC_SUPPORTS_secp256k1 && (uECC_OPTIMIZATION_LEVEL > 0) && \ + ((uECC_WORD_SIZE == 1) || (uECC_WORD_SIZE == 8))) static void muladd(uECC_word_t a, uECC_word_t b, uECC_word_t *r0, @@ -235,6 +238,7 @@ static void muladd(uECC_word_t a, *r0 = (uECC_word_t)r01; #endif } +#endif /* muladd needed */ #if !asm_mult static void vli_mult(uECC_word_t *result, @@ -271,6 +275,7 @@ static void vli_mult(uECC_word_t *result, #if uECC_SQUARE_FUNC +#if !asm_square static void mul2add(uECC_word_t a, uECC_word_t b, uECC_word_t *r0, @@ -318,7 +323,6 @@ static void mul2add(uECC_word_t a, #endif } -#if !asm_square static void vli_square(uECC_word_t *result, const uECC_word_t *left, wordcount_t num_words) { uECC_word_t r0 = 0; uECC_word_t r1 = 0;