Add rng for the tinycrypt tests
Use rnd_std_rand for the rng.
diff --git a/tests/suites/test_suite_tinycrypt.function b/tests/suites/test_suite_tinycrypt.function
index 698058f..0691d10 100644
--- a/tests/suites/test_suite_tinycrypt.function
+++ b/tests/suites/test_suite_tinycrypt.function
@@ -4,6 +4,16 @@
#include "tinycrypt/ecc_dh.h"
#include "tinycrypt/ecc_dsa.h"
+static int uecc_rng_wrapper( uint8_t *dest, unsigned int size )
+{
+ int ret;
+ ret = rnd_std_rand( NULL, dest, size );
+ if( ret == 0 )
+ return( (int) size );
+
+ return( 0 );
+}
+
/* END_HEADER */
/* BEGIN_DEPENDENCIES
@@ -23,7 +33,10 @@
const struct uECC_Curve_t * curve = uECC_secp256r1();
+ uECC_set_rng( &uecc_rng_wrapper );
+
TEST_ASSERT( uECC_make_key( public1, private1, curve ) != 0 );
+
TEST_ASSERT( uECC_make_key( public2, private2, curve ) != 0 );
TEST_ASSERT( uECC_shared_secret( public2, private1, secret1, curve ) != 0 );
@@ -45,6 +58,8 @@
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 ) );