Use rnd_std_rand for generating hash

This commit is contained in:
Jarno Lamsa 2019-09-02 15:36:49 +03:00
parent a7e0f632fc
commit f35f35bcbe

View file

@ -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 );