11/*
2- * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -92,6 +92,20 @@ static esp_err_t s_check_key(esp_efuse_block_t num_key, void* wr_key)
9292#endif
9393#if SOC_EFUSE_ECDSA_KEY
9494 purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY ||
95+ #endif
96+ #if SOC_EFUSE_ECDSA_KEY_P192
97+ purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P192 ||
98+ #endif
99+ #if SOC_EFUSE_ECDSA_KEY_P384
100+ purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P384_L ||
101+ purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P384_H ||
102+ #endif
103+ #if SOC_PSRAM_ENCRYPTION_XTS_AES_128
104+ purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_128_PSRAM_KEY ||
105+ #endif
106+ #if SOC_PSRAM_ENCRYPTION_XTS_AES_256
107+ purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_256_PSRAM_KEY_1 ||
108+ purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_256_PSRAM_KEY_2 ||
95109#endif
96110 purpose == ESP_EFUSE_KEY_PURPOSE_HMAC_DOWN_ALL ||
97111 purpose == ESP_EFUSE_KEY_PURPOSE_HMAC_DOWN_JTAG ||
@@ -111,7 +125,8 @@ static esp_err_t s_check_key(esp_efuse_block_t num_key, void* wr_key)
111125
112126 TEST_ASSERT_EQUAL (purpose , esp_efuse_get_key_purpose (num_key ));
113127 esp_efuse_purpose_t purpose2 = 0 ;
114- TEST_ESP_OK (esp_efuse_read_field_blob (esp_efuse_get_purpose_field (num_key ), & purpose2 , 4 ));
128+ const esp_efuse_desc_t * * key_purpose = esp_efuse_get_purpose_field (num_key );
129+ TEST_ESP_OK (esp_efuse_read_field_blob (key_purpose , & purpose2 , key_purpose [0 ]-> bit_count ));
115130 TEST_ASSERT_EQUAL (purpose , purpose2 );
116131 TEST_ASSERT_TRUE (esp_efuse_get_keypurpose_dis_write (num_key ));
117132 return ESP_OK ;
0 commit comments