feat(bootloader_support): Support Flash Encryption using Key Manager

This commit is contained in:
harshal.patil
2025-09-15 05:49:17 +05:30
parent 46e2cd21d4
commit c1503cd847
19 changed files with 378 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -25,6 +25,8 @@ extern "C" {
#define KEY_MGR_HUK_INFO_SIZE HUK_INFO_LEN
#define KEY_MGR_HUK_RISK_ALERT_LEVEL HUK_RISK_ALERT_LEVEL
#define KEY_MGR_KEY_INFO_SIZE KEY_INFO_LEN
/* AES deploy mode */
#define KEY_MGR_K2_INFO_SIZE 64
#define KEY_MGR_K1_ENCRYPTED_SIZE 32
@@ -59,6 +61,13 @@ typedef struct {
WORD_ALIGNED_ATTR uint8_t k2_G[2][KEY_MGR_ECDH0_INFO_SIZE];
} esp_key_mgr_ecdh0_info_t;
/**
* @brief Wait for the Key Manager to reach the given state
*
* @param state The state to wait for
*/
void key_mgr_wait_for_state(esp_key_mgr_state_t state);
/**
* @brief Deploy key in AES deployment mode
* @input