Skip to content

Commit c85a93d

Browse files
committed
fix(espefuse): Disable programming and usage of XTS-AES-256 efuse key for ESP32-C5
1 parent a510446 commit c85a93d

File tree

5 files changed

+7
-21
lines changed

5 files changed

+7
-21
lines changed

docs/en/espefuse/burn-key-cmd.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Optional arguments:
6363

6464
- USER.
6565
- RESERVED.
66-
:esp32c5 or esp32p4 or esp32s2 or esp32s3: - XTS_AES_256_KEY_1. The first 256 bits of 512bit flash encryption key.
67-
:esp32c5 or esp32p4 or esp32s2 or esp32s3: - XTS_AES_256_KEY_2. The second 256 bits of 512bit flash encryption key.
66+
:esp32p4 or esp32s2 or esp32s3: - XTS_AES_256_KEY_1. The first 256 bits of 512bit flash encryption key.
67+
:esp32p4 or esp32s2 or esp32s3: - XTS_AES_256_KEY_2. The second 256 bits of 512bit flash encryption key.
6868
:esp32c5 or esp32c61 or esp32h2 or esp32h21 or esp32h4 or esp32p4: - ECDSA_KEY. It can be ECDSA private keys based on NIST192p or NIST256p curve. The private key is extracted from the given file and written into a eFuse block with write and read protection enabled. This private key shall be used by ECDSA accelerator for the signing purpose.
6969
:esp32c5: - ECDSA_KEY_P192. ECDSA private keys based on NIST192p curve.
7070
:esp32c5: - ECDSA_KEY_P256. ECDSA private keys based on NIST256p curve.
@@ -79,10 +79,7 @@ Optional arguments:
7979
- SECURE_BOOT_DIGEST0. 1 secure boot key.
8080
- SECURE_BOOT_DIGEST1. 2 secure boot key.
8181
- SECURE_BOOT_DIGEST2. 3 secure boot key.
82-
:esp32c5 or esp32p4 or esp32s2 or esp32s3: - XTS_AES_256_KEY. This is a virtual key purpose for flash encryption key. This allows you to write a whole 512-bit key into two blocks with ``XTS_AES_256_KEY_1`` and ``XTS_AES_256_KEY_2`` purposes without splitting the key file.
83-
:esp32c5: - XTS_AES_256_PSRAM_KEY. This is a virtual key purpose for psram encryption key. This allows you to write a whole 512-bit key into two blocks with ``XTS_AES_256_PSRAM_KEY_1`` and ``XTS_AES_256_PSRAM_KEY_2`` purposes without splitting the key file.
84-
:esp32c5: - XTS_AES_256_PSRAM_KEY_1. The first 256 bits of 512bit psram encryption key.
85-
:esp32c5: - XTS_AES_256_PSRAM_KEY_2. The second 256 bits of 512bit psram encryption key.
82+
:esp32p4 or esp32s2 or esp32s3: - XTS_AES_256_KEY. This is a virtual key purpose for flash encryption key. This allows you to write a whole 512-bit key into two blocks with ``XTS_AES_256_KEY_1`` and ``XTS_AES_256_KEY_2`` purposes without splitting the key file.
8683
:esp32c5 or esp32h4 or esp32p4: - KM_INIT_KEY. This is a key that is used for the generation of AES/ECDSA keys by the key manager.
8784

8885
.. only:: esp32c5 or esp32c61 or esp32h2 or esp32h21 or esp32h4 or esp32p4

espefuse/efuse/esp32c5/fields.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,6 @@ class EfuseKeyPurposeField(EfuseField):
437437
("ECDSA_KEY_P256", 1, None, "Reverse", "need_rd_protect"), # ECDSA key P256
438438
("ECDSA_KEY", 1, None, "Reverse", "need_rd_protect"), # ECDSA key P256
439439
("RESERVED", 1, None, None, "no_need_rd_protect"), # Reserved
440-
("XTS_AES_256_KEY_1", 2, None, "Reverse", "need_rd_protect"), # XTS_AES_256_KEY_1 (flash/PSRAM encryption)
441-
("XTS_AES_256_KEY_2", 3, None, "Reverse", "need_rd_protect"), # XTS_AES_256_KEY_2 (flash/PSRAM encryption)
442-
("XTS_AES_256_KEY", -1, "VIRTUAL", None, "no_need_rd_protect"), # Virtual purpose splits to XTS_AES_256_KEY_1 and XTS_AES_256_KEY_2
443440
("XTS_AES_128_KEY", 4, None, "Reverse", "need_rd_protect"), # XTS_AES_128_KEY (flash/PSRAM encryption)
444441
("HMAC_DOWN_ALL", 5, None, None, "need_rd_protect"), # HMAC Downstream mode
445442
("HMAC_DOWN_JTAG", 6, None, None, "need_rd_protect"), # JTAG soft enable key (uses HMAC Downstream mode)
@@ -449,9 +446,6 @@ class EfuseKeyPurposeField(EfuseField):
449446
("SECURE_BOOT_DIGEST1", 10, "DIGEST", None, "no_need_rd_protect"), # SECURE_BOOT_DIGEST1 (Secure Boot key digest)
450447
("SECURE_BOOT_DIGEST2", 11, "DIGEST", None, "no_need_rd_protect"), # SECURE_BOOT_DIGEST2 (Secure Boot key digest)
451448
("KM_INIT_KEY", 12, None, None, "need_rd_protect"), # init key that is used for the generation of AES/ECDSA key
452-
("XTS_AES_256_PSRAM_KEY_1", 13, None, "Reverse", "need_rd_protect"), # XTS_AES_256_PSRAM_KEY_1 (PSRAM encryption)
453-
("XTS_AES_256_PSRAM_KEY_2", 14, None, "Reverse", "need_rd_protect"), # XTS_AES_256_PSRAM_KEY_1 (PSRAM encryption)
454-
("XTS_AES_256_PSRAM_KEY", -2, "VIRTUAL", None, "no_need_rd_protect"), # Virtual purpose splits to XTS_AES_256_PSRAM_KEY_1 and XTS_AES_256_PSRAM_KEY_1
455449
("XTS_AES_128_PSRAM_KEY", 15, None, "Reverse", "need_rd_protect"), # XTS_AES_128_PSRAM_KEY (PSRAM encryption)
456450
("ECDSA_KEY_P192", 16, None, "Reverse", "need_rd_protect"), # ECDSA key P192
457451
("ECDSA_KEY_P384_L", 17, None, "Reverse", "need_rd_protect"), # ECDSA key P384 low

espefuse/efuse/esp32h4/fields.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,6 @@ class EfuseKeyPurposeField(EfuseField):
387387
KEY_PURPOSES = [
388388
("USER", 0, None, None, "no_need_rd_protect"), # User purposes (software-only use)
389389
("ECDSA_KEY", 1, None, "Reverse", "need_rd_protect"), # ECDSA key
390-
("XTS_AES_256_KEY_1", 2, None, "Reverse", "need_rd_protect"), # XTS_AES_256_KEY_1 (flash/PSRAM encryption)
391-
("XTS_AES_256_KEY_2", 3, None, "Reverse", "need_rd_protect"), # XTS_AES_256_KEY_2 (flash/PSRAM encryption)
392390
("XTS_AES_128_KEY", 4, None, "Reverse", "need_rd_protect"), # XTS_AES_128_KEY (flash/PSRAM encryption)
393391
("HMAC_DOWN_ALL", 5, None, None, "need_rd_protect"), # HMAC Downstream mode
394392
("HMAC_DOWN_JTAG", 6, None, None, "need_rd_protect"), # JTAG soft enable key (uses HMAC Downstream mode)
@@ -398,7 +396,6 @@ class EfuseKeyPurposeField(EfuseField):
398396
("SECURE_BOOT_DIGEST1", 10, "DIGEST", None, "no_need_rd_protect"), # SECURE_BOOT_DIGEST1 (Secure Boot key digest)
399397
("SECURE_BOOT_DIGEST2", 11, "DIGEST", None, "no_need_rd_protect"), # SECURE_BOOT_DIGEST2 (Secure Boot key digest)
400398
("KM_INIT_KEY", 12, None, None, "need_rd_protect"), # init key that is used for the generation of AES/ECDSA key
401-
("XTS_AES_256_KEY", -1, "VIRTUAL", None, "no_need_rd_protect"), # Virtual purpose splits to XTS_AES_256_KEY_1 and XTS_AES_256_KEY_2
402399
]
403400
# fmt: on
404401

esptool/targets/esp32c5.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ class ESP32C5ROM(ESP32C6ROM):
8383
KEY_PURPOSES: dict[int, str] = {
8484
0: "USER/EMPTY",
8585
1: "ECDSA_KEY",
86-
2: "XTS_AES_256_KEY_1",
87-
3: "XTS_AES_256_KEY_2",
8886
4: "XTS_AES_128_KEY",
8987
5: "HMAC_DOWN_ALL",
9088
6: "HMAC_DOWN_JTAG",
@@ -94,6 +92,10 @@ class ESP32C5ROM(ESP32C6ROM):
9492
10: "SECURE_BOOT_DIGEST1",
9593
11: "SECURE_BOOT_DIGEST2",
9694
12: "KM_INIT_KEY",
95+
15: "XTS_AES_128_PSRAM_KEY",
96+
16: "ECDSA_KEY_P192",
97+
17: "ECDSA_KEY_P384_L",
98+
18: "ECDSA_KEY_P384_H",
9799
}
98100

99101
def get_pkg_version(self):

esptool/targets/esp32c61.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ class ESP32C61ROM(ESP32C6ROM):
6969
KEY_PURPOSES: dict[int, str] = {
7070
0: "USER/EMPTY",
7171
1: "ECDSA_KEY",
72-
2: "XTS_AES_256_KEY_1",
73-
3: "XTS_AES_256_KEY_2",
7472
4: "XTS_AES_128_KEY",
7573
5: "HMAC_DOWN_ALL",
7674
6: "HMAC_DOWN_JTAG",
@@ -80,8 +78,6 @@ class ESP32C61ROM(ESP32C6ROM):
8078
10: "SECURE_BOOT_DIGEST1",
8179
11: "SECURE_BOOT_DIGEST2",
8280
12: "KM_INIT_KEY",
83-
13: "XTS_AES_256_KEY_1_PSRAM",
84-
14: "XTS_AES_256_KEY_2_PSRAM",
8581
15: "XTS_AES_128_KEY_PSRAM",
8682
}
8783

0 commit comments

Comments
 (0)