mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
esp32h2: update driver/hal/soc components to support esp32h2
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "hal/ds_hal.h"
|
||||
#include "hal/ds_ll.h"
|
||||
#include "hal/hmac_hal.h"
|
||||
#include "esp32c3/rom/digital_signature.h"
|
||||
#include "esp32h2/rom/digital_signature.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_ds.h"
|
||||
|
||||
@@ -123,7 +123,7 @@ esp_err_t esp_ds_start_sign(const void *message,
|
||||
uint32_t conf_error = hmac_hal_configure(HMAC_OUTPUT_DS, key_id);
|
||||
if (conf_error) {
|
||||
ds_disable_release();
|
||||
return ESP32C3_ERR_HW_CRYPTO_DS_HMAC_FAIL;
|
||||
return ESP32H2_ERR_HW_CRYPTO_DS_HMAC_FAIL;
|
||||
}
|
||||
|
||||
ds_hal_start();
|
||||
@@ -133,7 +133,7 @@ esp_err_t esp_ds_start_sign(const void *message,
|
||||
while (ds_ll_busy() != 0) {
|
||||
if ((esp_timer_get_time() - start_time) > SOC_DS_KEY_CHECK_MAX_WAIT_US) {
|
||||
ds_disable_release();
|
||||
return ESP32C3_ERR_HW_CRYPTO_DS_INVALID_KEY;
|
||||
return ESP32H2_ERR_HW_CRYPTO_DS_INVALID_KEY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,11 +178,11 @@ esp_err_t esp_ds_finish_sign(void *signature, esp_ds_context_t *esp_ds_ctx)
|
||||
esp_err_t return_value = ESP_OK;
|
||||
|
||||
if (sig_check_result == DS_SIGNATURE_MD_FAIL || sig_check_result == DS_SIGNATURE_PADDING_AND_MD_FAIL) {
|
||||
return_value = ESP32C3_ERR_HW_CRYPTO_DS_INVALID_DIGEST;
|
||||
return_value = ESP32H2_ERR_HW_CRYPTO_DS_INVALID_DIGEST;
|
||||
}
|
||||
|
||||
if (sig_check_result == DS_SIGNATURE_PADDING_FAIL) {
|
||||
return_value = ESP32C3_ERR_HW_CRYPTO_DS_INVALID_PADDING;
|
||||
return_value = ESP32H2_ERR_HW_CRYPTO_DS_INVALID_PADDING;
|
||||
}
|
||||
|
||||
free(esp_ds_ctx);
|
||||
|
Reference in New Issue
Block a user