You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/espefuse/burn-key-cmd.rst
+57-7Lines changed: 57 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,9 +63,14 @@ Optional arguments:
63
63
64
64
- USER.
65
65
- RESERVED.
66
-
:esp32c5 or esp32c61 or esp32p4 or esp32s2 or esp32s3: - XTS_AES_256_KEY_1. The first 256 bits of 512bit flash encryption key.
67
-
:esp32c5 or esp32c61 or esp32p4 or esp32s2 or esp32s3: - XTS_AES_256_KEY_2. The second 256 bits of 512bit flash encryption key.
68
-
::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.
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.
68
+
: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.
69
+
:esp32c5: - ECDSA_KEY_P192. ECDSA private keys based on NIST192p curve.
70
+
:esp32c5: - ECDSA_KEY_P256. ECDSA private keys based on NIST256p curve.
71
+
:esp32c5: - ECDSA_KEY_P384. ECDSA private keys based on NIST384p curve. This allows you to write a whole 48-byte key into two blocks with ``ECDSA_KEY_P384_H`` and ``ECDSA_KEY_P384_L`` purposes.
72
+
:esp32c5: - ECDSA_KEY_P384_H. Upper 32 bytes of the 48-byte ECDSA_P384 key (last 16 bytes of key + 16 padding bytes).
73
+
:esp32c5: - ECDSA_KEY_P384_L. Lower 32 bytes of the 48-byte ECDSA_P384 key.
69
74
- XTS_AES_128_KEY. 256 bit flash encryption key.
70
75
- HMAC_DOWN_ALL.
71
76
- HMAC_DOWN_JTAG.
@@ -74,17 +79,21 @@ Optional arguments:
74
79
- SECURE_BOOT_DIGEST0. 1 secure boot key.
75
80
- SECURE_BOOT_DIGEST1. 2 secure boot key.
76
81
- SECURE_BOOT_DIGEST2. 3 secure boot key.
77
-
:esp32c5 or esp32c61 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.
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.
78
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.
79
84
:esp32c5: - XTS_AES_256_PSRAM_KEY_1. The first 256 bits of 512bit psram encryption key.
80
85
:esp32c5: - XTS_AES_256_PSRAM_KEY_2. The second 256 bits of 512bit psram encryption key.
81
86
: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.
82
87
83
-
.. only:: esp32h2
88
+
.. only:: esp32c5 or esp32c61 or esp32h2 or esp32h21 or esp32h4 or esp32p4
84
89
85
-
{IDF_TARGET_NAME} has the ECDSA accelerator for signature purposes and supports private keys based on the NIST192p or NIST256p curve. These two commands below can be used to generate such keys (``PEM`` file). The ``burn_key`` command with the ``ECDSA_KEY`` purpose takes the ``PEM`` file and writes the private key into a eFuse block. The key is written to the block in reverse byte order.
90
+
{IDF_TARGET_NAME} has the ECDSA accelerator for signature purposes and supports private keys based on the NIST192p or NIST256p curve (some chips support NIST384p). These two commands below can be used to generate such keys (``PEM`` file). The ``burn-key`` command with the ``ECDSA_KEY`` purpose takes the ``PEM`` file and writes the private key into a eFuse block. The key is written to the block in reverse byte order.
86
91
87
-
For NIST192p, the private key is 192 bits long, so 8 padding bytes ("0x00") are added.
92
+
.. list::
93
+
94
+
- For NIST192p, the private key is 192 bits long, so 8 padding bytes ("0x00") are added.
95
+
- For NIST256p, the private key is 256 bits long.
96
+
- For NIST384p, the private key is 384 bits long, so 16 padding bytes ("0x00") are added.
Reversing byte order for ECDSA_KEY_P384_H hardware peripheral...
370
+
'KEY_PURPOSE_0': 'USER' -> 'ECDSA_KEY_P384_H'.
371
+
Disabling write to 'KEY_PURPOSE_0'...
372
+
Disabling write to key block...
373
+
374
+
- BLOCK_KEY1 -> [65 ca a4 5b 5f 67 5c fe 34 89 f3 4a 57 d1 5a 41 d6 1c 7d ea 7a 3f cd 34 79 f2 94 c2 ad cb 94 7d]
375
+
Reversing byte order for ECDSA_KEY_P384_L hardware peripheral...
376
+
'KEY_PURPOSE_1': 'USER' -> 'ECDSA_KEY_P384_L'.
377
+
Disabling write to 'KEY_PURPOSE_1'...
378
+
Disabling write to key block...
379
+
380
+
Keys will remain readable (due to --no-read-protect).
381
+
382
+
Check all blocks for burn...
383
+
idx, BLOCK_NAME, Conclusion
384
+
[00] BLOCK0 is empty, will burn the new value
385
+
[04] BLOCK_KEY0 is empty, will burn the new value
386
+
[05] BLOCK_KEY1 is empty, will burn the new value
387
+
.
388
+
This is an irreversible operation!
389
+
Type 'BURN' (all capitals) to continue.
390
+
BURN
391
+
BURN BLOCK5 - OK (write block == read block)
392
+
BURN BLOCK4 - OK (write block == read block)
393
+
BURN BLOCK0 - OK (write block == read block)
394
+
Reading updated eFuses...
395
+
Successful.
396
+
397
+
.. note::
398
+
399
+
The flags ``--no-read-protect`` and ``--show-sensitive-info`` in this command are used for demonstration purposes only, to show the key byte order. The ECDSA_KEY keys is always written in reverse byte order. The 48 bytes of the key are extracted from the provided PEM file, and 16 padding bytes are added to form a total of 64 bytes for two eFuse blocks. Due to the required reverse byte order, the last 16 bytes of the key plus 16 padding bytes are written to BLOCK_KEY0 with the key purpose ``ECDSA_KEY_P384_H``, and the remaining 32 bytes are written to the next available eFuse block (here, BLOCK_KEY1) with the key purpose ``ECDSA_KEY_P384_L``.
0 commit comments