0003-Silence-warning-of-unused-variable.patch 1.9 KB
From 17cab9daa22fdff9c3bc884024f330445f558550 Mon Sep 17 00:00:00 2001
From: Wentao Shang <wentaoshang@gmail.com>
Date: Wed, 1 Jun 2016 15:00:43 -0700
Subject: [PATCH 3/3] Silence warning of unused variable

---
 asm_avr.inc        | 2 +-
 curve-specific.inc | 2 +-
 uECC.c             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/asm_avr.inc b/asm_avr.inc
index c988040..cd194da 100644
--- a/asm_avr.inc
+++ b/asm_avr.inc
@@ -986,7 +986,7 @@ uECC_VLI_API void uECC_vli_mult(uECC_word_t *result,
         "st z+, %[r0] \n\t"  /* Store last result byte. */
         "eor r1, r1 \n\t" /* fix r1 to be 0 again */
     
-        : "+z" (result), "+x" (left), "+y" (right),
+        : "+z" (r), "+x" (left), "+y" (right),
           [r0] "+r" (r0), [r1] "+r" (r1), [r2] "+r" (r2),
           [zero] "+r" (zero), [num] "+r" (num_words),
           [k] "=&r" (k), [i] "=&r" (i)
diff --git a/curve-specific.inc b/curve-specific.inc
index 0453b21..e17e75c 100644
--- a/curve-specific.inc
+++ b/curve-specific.inc
@@ -563,7 +563,7 @@ static void mod_sqrt_secp224r1(uECC_word_t *a, uECC_Curve curve) {
         }
     }
     uECC_vli_modInv(f1, e0, curve_secp224r1.p, num_words_secp224r1); /* f1 <-- 1 / e0 */
-    uECC_vli_modMult_fast(a, d0, f1, &curve_secp224r1);              /* a  <-- d0 / e0 */
+    uECC_vli_modMult_fast(a, d0, f1, curve);              /* a  <-- d0 / e0 */
 }
 #endif /* uECC_SUPPORT_COMPRESSED_POINT */
 
diff --git a/uECC.c b/uECC.c
index 3691fc4..2fc6524 100644
--- a/uECC.c
+++ b/uECC.c
@@ -379,7 +379,7 @@ uECC_VLI_API uECC_word_t uECC_vli_sub(uECC_word_t *result,
 
 #if !asm_mult || (uECC_SQUARE_FUNC && !asm_square) || \
     (uECC_SUPPORTS_secp256k1 && (uECC_OPTIMIZATION_LEVEL > 0) && \
-        ((uECC_WORD_SIZE == 1) || (uECC_WORD_SIZE == 8)))
+     (uECC_WORD_SIZE == 8))
 static void muladd(uECC_word_t a,
                    uECC_word_t b,
                    uECC_word_t *r0,
-- 
2.7.4