mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix: improves some RSA key performances.
This fixes watchdog reset on ESP32 in certain WiFi tests.
This commit is contained in:
@@ -7,5 +7,5 @@ idf_component_register(SRCS ${SRCS}
|
|||||||
INCLUDE_DIRS "."
|
INCLUDE_DIRS "."
|
||||||
PRIV_REQUIRES unity
|
PRIV_REQUIRES unity
|
||||||
PRIV_INCLUDE_DIRS ${priv_includes}
|
PRIV_INCLUDE_DIRS ${priv_includes}
|
||||||
REQUIRES mbedtls espcoredump
|
REQUIRES espcoredump
|
||||||
WHOLE_ARCHIVE)
|
WHOLE_ARCHIVE)
|
||||||
|
|||||||
@@ -85,8 +85,13 @@ TEST_CASE("espcoredump SHA256 checksum API", "[espcoredump]")
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Verify size and version
|
// Verify size and version
|
||||||
|
#if CONFIG_ESP_COREDUMP_CHECKSUM_SHA256
|
||||||
TEST_ASSERT_EQUAL(SHA256_RESULT_LEN, esp_core_dump_checksum_size());
|
TEST_ASSERT_EQUAL(SHA256_RESULT_LEN, esp_core_dump_checksum_size());
|
||||||
|
#endif // CONFIG_ESP_COREDUMP_CHECKSUM_SHA256
|
||||||
|
|
||||||
|
#if CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF
|
||||||
TEST_ASSERT_EQUAL(COREDUMP_VERSION_ELF_SHA256, esp_core_dump_elf_version());
|
TEST_ASSERT_EQUAL(COREDUMP_VERSION_ELF_SHA256, esp_core_dump_elf_version());
|
||||||
|
#endif // CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF
|
||||||
|
|
||||||
// Test both single update and multiple updates with the same input
|
// Test both single update and multiple updates with the same input
|
||||||
checksum_ctx_t sha_ctx1, sha_ctx2;
|
checksum_ctx_t sha_ctx1, sha_ctx2;
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
CONFIG_ESP_COREDUMP_ENABLE_TO_UART=y
|
CONFIG_ESP_COREDUMP_ENABLE_TO_UART=y
|
||||||
CONFIG_ESP_COREDUMP_ENABLE_TO_UART=y
|
|
||||||
|
|||||||
@@ -760,7 +760,7 @@ struct crypto_ec_point *crypto_ec_key_get_public_key(struct crypto_ec_key *key)
|
|||||||
psa_status_t status;
|
psa_status_t status;
|
||||||
|
|
||||||
// Export public key in uncompressed format: 0x04 || X || Y
|
// Export public key in uncompressed format: 0x04 || X || Y
|
||||||
uint8_t pub_key_buf[PSA_EXPORT_PUBLIC_KEY_MAX_SIZE];
|
uint8_t pub_key_buf[PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(ESP_SUP_MAX_ECC_KEY_SIZE)];
|
||||||
size_t pub_key_len = 0;
|
size_t pub_key_len = 0;
|
||||||
|
|
||||||
status = psa_export_public_key(wrapper->key_id, pub_key_buf, sizeof(pub_key_buf), &pub_key_len);
|
status = psa_export_public_key(wrapper->key_id, pub_key_buf, sizeof(pub_key_buf), &pub_key_len);
|
||||||
@@ -922,6 +922,7 @@ int crypto_ec_key_group(struct crypto_ec_key *key)
|
|||||||
psa_status_t status = psa_get_key_attributes(wrapper->key_id, &key_attributes);
|
psa_status_t status = psa_get_key_attributes(wrapper->key_id, &key_attributes);
|
||||||
if (status != PSA_SUCCESS) {
|
if (status != PSA_SUCCESS) {
|
||||||
wpa_printf(MSG_ERROR, "crypto_ec_key_group: psa_get_key_attributes failed: %d", status);
|
wpa_printf(MSG_ERROR, "crypto_ec_key_group: psa_get_key_attributes failed: %d", status);
|
||||||
|
psa_reset_key_attributes(&key_attributes);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user