Skip to content

Commit 839c18c

Browse files
feat(docs): Update minimizing binary size
The ESP32-H2 software countermeasure may not be necessary for ESP32-H2 v1.2 and above, this commit updates the relevant documentation
1 parent 9269b78 commit 839c18c

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

components/hal/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,7 @@ menu "Hardware Abstraction Layer (HAL) and Low Level (LL)"
111111
Enable this option to apply the countermeasure for ECDSA signature operation
112112
This countermeasure masks the real ECDSA sign operation
113113
under dummy sign operations to add randomness in the generated power signature.
114+
This countermeasure is only necessary for ESP32-H2 < v1.2.
115+
114116

115117
endmenu

components/mbedtls/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,13 +592,14 @@ menu "mbedTLS"
592592
select HAL_ECDSA_GEN_SIG_CM
593593
default y
594594
help
595-
The ECDSA peripheral before ECO5 does not offer constant time ECDSA sign operation.
595+
The ECDSA peripheral before ESP32-H2 v1.2 does not offer constant time ECDSA sign operation.
596596
This time can be observed through power profiling of the device,
597597
making the ECDSA private key vulnerable to side-channel timing attacks.
598598
This countermeasure masks the real ECDSA sign operation
599599
under dummy sign operations to add randomness in the generated power signature.
600600
It is highly recommended to also enable Secure Boot for the device in addition to this countermeasure
601601
so that only trusted software can execute on the device.
602+
This countermeasure can be safely disabled for ESP32-H2 v1.2 and above.
602603

603604
config MBEDTLS_HARDWARE_ECDSA_SIGN_CONSTANT_TIME_CM
604605
bool "Make ECDSA signature operation pseudo constant time for software"
@@ -611,6 +612,7 @@ menu "mbedTLS"
611612
of an arbitrary message.
612613
The signature time would appear to be constant to the external entity after enabling
613614
this option.
615+
This countermeasure can be safely disabled for ESP32-H2 v1.2 and above.
614616

615617
endmenu
616618

docs/en/api-guides/performance/size.rst

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -202,23 +202,26 @@ Under **Component Config** > **mbedTLS**, there are multiple mbedTLS features en
202202

203203
These include:
204204

205-
- :ref:`CONFIG_MBEDTLS_HAVE_TIME`
206-
- :ref:`CONFIG_MBEDTLS_ECDSA_DETERMINISTIC`
207-
- :ref:`CONFIG_MBEDTLS_SHA512_C`
208-
- :ref:`CONFIG_MBEDTLS_SHA3_C`
209-
- :ref:`CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS`
210-
- :ref:`CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS`
211-
- :ref:`CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION`
212-
- :ref:`CONFIG_MBEDTLS_SSL_ALPN`
213-
- :ref:`CONFIG_MBEDTLS_SSL_RENEGOTIATION`
214-
- :ref:`CONFIG_MBEDTLS_CCM_C`
215-
- :ref:`CONFIG_MBEDTLS_GCM_C`
216-
- :ref:`CONFIG_MBEDTLS_ECP_C` (Alternatively: Leave this option enabled but disable some of the elliptic curves listed in the sub-menu.)
217-
- :ref:`CONFIG_MBEDTLS_ECP_NIST_OPTIM`
218-
- :ref:`CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM`
219-
- Change :ref:`CONFIG_MBEDTLS_TLS_MODE` if both server & client functionalities are not needed.
220-
- Consider disabling some cipher suites listed in the ``TLS Key Exchange Methods`` sub-menu (i.e., :ref:`CONFIG_MBEDTLS_KEY_EXCHANGE_RSA`).
221-
- Consider disabling :ref:`CONFIG_MBEDTLS_ERROR_STRINGS` if the application is already pulling in mbedTLS error strings through using :cpp:func:`mbedtls_strerror`.
205+
.. list::
206+
207+
- :ref:`CONFIG_MBEDTLS_HAVE_TIME`
208+
- :ref:`CONFIG_MBEDTLS_ECDSA_DETERMINISTIC`
209+
- :ref:`CONFIG_MBEDTLS_SHA512_C`
210+
- :ref:`CONFIG_MBEDTLS_SHA3_C`
211+
- :ref:`CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS`
212+
- :ref:`CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS`
213+
- :ref:`CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION`
214+
- :ref:`CONFIG_MBEDTLS_SSL_ALPN`
215+
- :ref:`CONFIG_MBEDTLS_SSL_RENEGOTIATION`
216+
- :ref:`CONFIG_MBEDTLS_CCM_C`
217+
- :ref:`CONFIG_MBEDTLS_GCM_C`
218+
- :ref:`CONFIG_MBEDTLS_ECP_C` (Alternatively: Leave this option enabled but disable some of the elliptic curves listed in the sub-menu.)
219+
- :ref:`CONFIG_MBEDTLS_ECP_NIST_OPTIM`
220+
- :ref:`CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM`
221+
- Change :ref:`CONFIG_MBEDTLS_TLS_MODE` if both server & client functionalities are not needed.
222+
- Consider disabling some cipher suites listed in the ``TLS Key Exchange Methods`` sub-menu (i.e., :ref:`CONFIG_MBEDTLS_KEY_EXCHANGE_RSA`).
223+
- Consider disabling :ref:`CONFIG_MBEDTLS_ERROR_STRINGS` if the application is already pulling in mbedTLS error strings through using :cpp:func:`mbedtls_strerror`.
224+
:esp32h2: - For {IDF_TARGET_NAME} v1.2 and above, consider disabling :ref:`CONFIG_MBEDTLS_HARDWARE_ECDSA_SIGN_MASKING_CM` and :ref:`CONFIG_MBEDTLS_HARDWARE_ECDSA_SIGN_CONSTANT_TIME_CM` as the software countermeasures for the ECDSA sign operation are not required.
222225

223226
The help text for each option has some more information for reference.
224227

0 commit comments

Comments
 (0)