mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-04-08 19:01:50 +02:00
@@ -3979,11 +3979,19 @@ int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id)
|
||||
err = atmel_ecc_create_key(key->slot, key->pubkey_raw);
|
||||
|
||||
/* populate key->pubkey */
|
||||
if (err == 0 && key->pubkey.x) {
|
||||
if (err == 0
|
||||
#ifdef ALT_ECC_SIZE
|
||||
&& key->pubkey.x
|
||||
#endif
|
||||
) {
|
||||
err = mp_read_unsigned_bin(key->pubkey.x, key->pubkey_raw,
|
||||
ECC_MAX_CRYPTO_HW_SIZE);
|
||||
}
|
||||
if (err == 0 && key->pubkey.y) {
|
||||
if (err == 0
|
||||
#ifdef ALT_ECC_SIZE
|
||||
&& key->pubkey.y
|
||||
#endif
|
||||
) {
|
||||
err = mp_read_unsigned_bin(key->pubkey.y,
|
||||
key->pubkey_raw + ECC_MAX_CRYPTO_HW_SIZE,
|
||||
ECC_MAX_CRYPTO_HW_SIZE);
|
||||
|
||||
@@ -105,7 +105,9 @@ int atmel_get_random_number(uint32_t count, uint8_t* rand_out)
|
||||
XMEMCPY(&rand_out[i], rng_buffer, copy_count);
|
||||
i += copy_count;
|
||||
}
|
||||
#ifdef ATCAPRINTF
|
||||
atcab_printbin_label((const char*)"\r\nRandom Number", rand_out, count);
|
||||
#endif
|
||||
#else
|
||||
/* TODO: Use on-board TRNG */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user