Change the default value of status variables to an error
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
diff --git a/tinycrypt/ecc_dsa.c b/tinycrypt/ecc_dsa.c
index 660c5e9..41e1d71 100644
--- a/tinycrypt/ecc_dsa.c
+++ b/tinycrypt/ecc_dsa.c
@@ -89,7 +89,7 @@
uECC_word_t s[NUM_ECC_WORDS];
uECC_word_t p[NUM_ECC_WORDS * 2];
wordcount_t num_n_words = BITS_TO_WORDS(NUM_ECC_BITS);
- int r;
+ int r = UECC_FAILURE;
/* Make sure 0 < k < curve_n */
@@ -136,7 +136,7 @@
}
uECC_vli_nativeToBytes(signature + NUM_ECC_BYTES, NUM_ECC_BYTES, s);
- return UECC_SUCCESS;
+ return r;
}
int uECC_sign(const uint8_t *private_key, const uint8_t *message_hash,