From f35f35bcbef168ae306fd03ace78a8ea32ccfdd9 Mon Sep 17 00:00:00 2001 From: Jarno Lamsa Date: Mon, 2 Sep 2019 15:36:49 +0300 Subject: [PATCH] Use rnd_std_rand for generating hash --- tests/suites/test_suite_tinycrypt.function | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/suites/test_suite_tinycrypt.function b/tests/suites/test_suite_tinycrypt.function index 36e4c66cd..2cf656616 100644 --- a/tests/suites/test_suite_tinycrypt.function +++ b/tests/suites/test_suite_tinycrypt.function @@ -54,16 +54,12 @@ void test_ecdsa() uint8_t public[2*NUM_ECC_BYTES] = {0}; uint8_t hash[NUM_ECC_BYTES] = {0}; uint8_t sig[2*NUM_ECC_BYTES] = {0}; - unsigned int hash_words[NUM_ECC_WORDS] = {0}; const struct uECC_Curve_t * curve = uECC_secp256r1(); uECC_set_rng( &uecc_rng_wrapper ); - uECC_generate_random_int( hash_words, curve->n, - BITS_TO_WORDS( curve->num_n_bits ) ); - - uECC_vli_nativeToBytes( hash, NUM_ECC_BYTES, hash_words ); + TEST_ASSERT( rnd_std_rand( NULL, hash, NUM_ECC_BYTES ) == 0 ); TEST_ASSERT( uECC_make_key( public, private, curve ) != 0 );