diff --git a/components/hal/esp32p4/include/hal/aes_ll.h b/components/hal/esp32p4/include/hal/aes_ll.h index 127dd4c70b..befdbe4c6d 100644 --- a/components/hal/esp32p4/include/hal/aes_ll.h +++ b/components/hal/esp32p4/include/hal/aes_ll.h @@ -48,7 +48,8 @@ static inline void aes_ll_reset_register(void) HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_aes = 1; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_aes = 0; - // Clear reset on digital signature, otherwise AES is held in reset + // Clear reset on digital signature and parent crypto, otherwise AES is held in reset + HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ds = 0; } @@ -308,11 +309,11 @@ static inline void aes_ll_gcm_set_j0(const uint8_t *j0) } /** - * @brief Sets the number of effective bits of incomplete blocks in plaintext/cipertext. + * @brief Sets the number of effective bits of incomplete blocks in plaintext/ciphertext. * * @note Only affects AES-GCM * - * @param num_valid_bits the number of effective bits of incomplete blocks in plaintext/cipertext. + * @param num_valid_bits the number of effective bits of incomplete blocks in plaintext/ciphertext. */ static inline void aes_ll_gcm_set_num_valid_bit(size_t num_valid_bits) { diff --git a/components/hal/esp32p4/include/hal/ds_ll.h b/components/hal/esp32p4/include/hal/ds_ll.h index 3873a9311e..0d362d259e 100644 --- a/components/hal/esp32p4/include/hal/ds_ll.h +++ b/components/hal/esp32p4/include/hal/ds_ll.h @@ -46,6 +46,9 @@ static inline void ds_ll_reset_register(void) { HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ds = 1; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ds = 0; + + // Clear reset on parent crypto, otherwise DS is held in reset + HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0; } /// use a macro to wrap the function, force the caller to use it in a critical section diff --git a/components/hal/esp32p4/include/hal/ecc_ll.h b/components/hal/esp32p4/include/hal/ecc_ll.h index 7320b4123c..879a438acd 100644 --- a/components/hal/esp32p4/include/hal/ecc_ll.h +++ b/components/hal/esp32p4/include/hal/ecc_ll.h @@ -47,7 +47,8 @@ static inline void ecc_ll_reset_register(void) HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ecc = 1; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ecc = 0; - // Clear reset on ECDSA, otherwise ECC is held in reset + // Clear reset on ECDSA and parent crypto, otherwise ECC is held in reset + HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ecdsa = 0; } diff --git a/components/hal/esp32p4/include/hal/ecdsa_ll.h b/components/hal/esp32p4/include/hal/ecdsa_ll.h index c11bcd761e..898ce1fd27 100644 --- a/components/hal/esp32p4/include/hal/ecdsa_ll.h +++ b/components/hal/esp32p4/include/hal/ecdsa_ll.h @@ -92,6 +92,9 @@ static inline void ecdsa_ll_reset_register(void) { HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ecdsa = 1; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ecdsa = 0; + + // Clear reset on parent crypto, otherwise ECDSA is held in reset + HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0; } /** diff --git a/components/hal/esp32p4/include/hal/hmac_ll.h b/components/hal/esp32p4/include/hal/hmac_ll.h index b2bc080045..b812350cfa 100644 --- a/components/hal/esp32p4/include/hal/hmac_ll.h +++ b/components/hal/esp32p4/include/hal/hmac_ll.h @@ -53,6 +53,9 @@ static inline void hmac_ll_reset_register(void) { HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_hmac = 1; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_hmac = 0; + + // Clear reset on parent crypto, otherwise HMAC is held in reset + HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0; } /// use a macro to wrap the function, force the caller to use it in a critical section diff --git a/components/hal/esp32p4/include/hal/key_mgr_ll.h b/components/hal/esp32p4/include/hal/key_mgr_ll.h index 04acb90c1e..1d6d05eba5 100644 --- a/components/hal/esp32p4/include/hal/key_mgr_ll.h +++ b/components/hal/esp32p4/include/hal/key_mgr_ll.h @@ -59,6 +59,9 @@ static inline void key_mgr_ll_reset_register(void) { HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_km = 1; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_km = 0; + + // Clear reset on parent crypto, otherwise Key Manager is held in reset + HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0; } /// use a macro to wrap the function, force the caller to use it in a critical section @@ -183,7 +186,7 @@ static inline void key_mgr_ll_lock_use_sw_init_key_reg(void) /** * @brief Set the lock for the use_sw_init_key_reg * After this lock has been set, - * The Key manager configuration about whether to use a paricular key from efuse or key manager cannot be changed. + * The Key manager configuration about whether to use a particular key from efuse or key manager cannot be changed. */ static inline void key_mgr_ll_lock_use_efuse_key_reg(esp_key_mgr_key_type_t key_type) { @@ -198,14 +201,14 @@ static inline void key_mgr_ll_lock_use_efuse_key_reg(esp_key_mgr_key_type_t key_ } } -/* @brief Configure the key purpose to be used by the Key Manager for key generator opearation */ +/* @brief Configure the key purpose to be used by the Key Manager for key generator operation */ static inline void key_mgr_ll_set_key_purpose(const esp_key_mgr_key_purpose_t key_purpose) { REG_SET_FIELD(KEYMNG_CONF_REG, KEYMNG_KEY_PURPOSE, key_purpose); } /** - * @brief Configure the mode which is used by the Key Manager for the generator key deployement process + * @brief Configure the mode which is used by the Key Manager for the generator key deployment process */ static inline void key_mgr_ll_set_key_generator_mode(const esp_key_mgr_key_generator_mode_t mode) { diff --git a/components/hal/esp32p4/include/hal/mpi_ll.h b/components/hal/esp32p4/include/hal/mpi_ll.h index ebe4b55858..3a4564c4c5 100644 --- a/components/hal/esp32p4/include/hal/mpi_ll.h +++ b/components/hal/esp32p4/include/hal/mpi_ll.h @@ -40,7 +40,8 @@ static inline void mpi_ll_reset_register(void) HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_rsa = 1; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_rsa = 0; - // Clear reset on digital signature and ECDSA, otherwise RSA is held in reset + // Clear reset on digital signature, ECDSA and parent crypto, otherwise RSA is held in reset + HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ds = 0; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ecdsa = 0; } diff --git a/components/hal/esp32p4/include/hal/sha_ll.h b/components/hal/esp32p4/include/hal/sha_ll.h index fba3b75221..97aa09ad37 100644 --- a/components/hal/esp32p4/include/hal/sha_ll.h +++ b/components/hal/esp32p4/include/hal/sha_ll.h @@ -36,7 +36,8 @@ static inline void sha_ll_reset_register(void) HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_sha = 1; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_sha = 0; - // Clear reset on digital signature, hmac and ecdsa, otherwise SHA is held in reset + // Clear reset on digital signature, hmac, ecdsa and parent crypto, otherwise SHA is held in reset + HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ds = 0; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_hmac = 0; HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_ecdsa = 0;