mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 22:25:11 +00:00
Use rnd_std_rand for generating hash
This commit is contained in:
parent
a7e0f632fc
commit
f35f35bcbe
|
@ -54,16 +54,12 @@ void test_ecdsa()
|
||||||
uint8_t public[2*NUM_ECC_BYTES] = {0};
|
uint8_t public[2*NUM_ECC_BYTES] = {0};
|
||||||
uint8_t hash[NUM_ECC_BYTES] = {0};
|
uint8_t hash[NUM_ECC_BYTES] = {0};
|
||||||
uint8_t sig[2*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();
|
const struct uECC_Curve_t * curve = uECC_secp256r1();
|
||||||
|
|
||||||
uECC_set_rng( &uecc_rng_wrapper );
|
uECC_set_rng( &uecc_rng_wrapper );
|
||||||
|
|
||||||
uECC_generate_random_int( hash_words, curve->n,
|
TEST_ASSERT( rnd_std_rand( NULL, hash, NUM_ECC_BYTES ) == 0 );
|
||||||
BITS_TO_WORDS( curve->num_n_bits ) );
|
|
||||||
|
|
||||||
uECC_vli_nativeToBytes( hash, NUM_ECC_BYTES, hash_words );
|
|
||||||
|
|
||||||
TEST_ASSERT( uECC_make_key( public, private, curve ) != 0 );
|
TEST_ASSERT( uECC_make_key( public, private, curve ) != 0 );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue