diff options
author | mczraf <[email protected]> | 2018-11-19 15:39:45 -0800 |
---|---|---|
committer | mczraf <[email protected]> | 2018-11-19 16:22:00 -0800 |
commit | 323cd15b40d5b249564c0ad39e357e81c90aee0c (patch) | |
tree | 1941d805a83f30125d18171b50d653141c27f3c0 | |
parent | 6a22712bebbf2fc60d9fc6192dddefd5ad1933e3 (diff) |
Fix innocuous memset size bug in ECC test method
In one of the ECC auxiliary test methods, a buffer 'd' was being
erased with memset using a wrong buffer size (NUM_ECC_WORDS instead
of 4*NUM_ECC_WORDS). This bug was not affecting the correctness of
ECC nor any other crypto primtive. In fact, it was not affecting even
the ECC test itself since the content of such buffer was being
overwritten rigth after the erasure procedure.
This fix removes a warning triggered when compiling the code.
-rw-r--r-- | tests/test_ecc_utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_ecc_utils.c b/tests/test_ecc_utils.c index 5c81eba..3500331 100644 --- a/tests/test_ecc_utils.c +++ b/tests/test_ecc_utils.c @@ -241,7 +241,7 @@ int keygen_vectors(char **d_vec, char **qx_vec, char **qy_vec, int tests, * Feed prvkey vector as padded random seed into ecc_make_key. * Internal mod-reduction will be zero-op and generate correct prv/pub */ - memset(d, 0, NUM_ECC_WORDS); + memset(d, 0, sizeof(d)); string2scalar(d, NUM_ECC_WORDS, d_vec[i]); uint8_t pub_bytes[2*NUM_ECC_BYTES]; |