Commit Graph
100 Commits
Author SHA1 Message Date
harshal.patil 07debe6edc feat(esp_hw_support): Memory region protection for ESP32-H4 2026-08-25 10:40:28 +05:30
harshal.patil b85c05d556 test(mbedtls): fix in-place AES-CTR PSRAM test on targets without AES hardware
With MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS enabled, an in-place
psa_cipher_update() reaches the selected cipher implementation without
defensive buffer copies. The ESP AES PSA driver accepts an in-place
update of any length for CTR (PSA classifies CTR as a stream cipher, so
the driver's block_length is 1), but on targets without the AES
peripheral (e.g. ESP32-C61) the operation falls back to the mbedtls
builtin cipher layer, which rejects in-place updates whose length is
not a multiple of the block size (MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA,
surfacing as PSA_ERROR_INVALID_ARGUMENT).

Round the in-place test length down to a block multiple when
CONFIG_MBEDTLS_HARDWARE_AES is not set; partial-block PSRAM coverage is
retained through the separate-buffer alignment tests.
2026-08-20 18:46:09 +05:30
harshal.patil 95f1582f4b test(mbedtls): add partial-block PSRAM coverage for AES and AES-GCM
Extend the CTR test data length to 6433 bytes so the trailing partial
block is exercised with external RAM buffers (which stalls the ESP32-S2
Crypto DMA on an unfixed driver), and add AES-GCM PSRAM tests verified
against internal RAM references.
2026-08-19 11:27:52 +05:30
harshal.patil 6fe4f4f174 fix(mbedtls/aes): fix ESP32-S2 Crypto DMA stall on PSRAM output with partial blocks
The ESP32-S2 Crypto DMA in-channel stalls silently when a receive
descriptor list transitions from external to internal RAM. The AES
driver hits this when a PSRAM-output operation has a trailing partial
block, as the internal stream descriptor is linked after the external
RAM data descriptors.

- esp_aes_process_dma(): process the block-aligned part and the partial
  block as two separate DMA operations, keeping each descriptor list
  uniform
- crypto_dma_ll_reset(): also reset the in-channel (per the TRM receive
  reset sequence), otherwise stale state from a preceding external-RAM
  operation corrupts the next operation's output

The GCM DMA path is unaffected; it never operates on PSRAM buffers.
2026-08-19 11:27:42 +05:30
harshal.patil 01b86f1269 change(esp_hw_support): harden the ESP32-S31 PSRAM region permissions
Both PSRAM layouts were mapped as a single RWX window, so everything in external
RAM - the heap included - was executable.

PSRAM used as data only is now RW, and under XIP-from-PSRAM it is split per
section as ESP32-P4 does: .text RX, .rodata read-only, and the MMU-page
alignment gaps and the reclaimed heap RW, so neither is executable.

Both describe the layout that esp_psram_init() produces, and the entries are
locked, so - again as on ESP32-P4 - they are only narrowed when
CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION says that layout applies. Without
it the application owns the region and PSRAM stays RWX.

The per-section entries cost one PMP entry more than the 16 available, so the CPU
subsystem and peripheral windows are chained as TOR entries, taking one entry
instead of three.

soc.h is corrected against the S31 bus address map: the peripheral window base
was 1 MB too low, and the LP peripheral top, derived from a register base plus a
size rather than from the map, was 16 KB short. SOC_NON_CACHEABLE_OFFSET_FLASH
is added.
2026-08-19 09:39:52 +05:30
harshal.patil 5ab2bb87cd docs(examples): Fix the broken Key Manager peripheral link in the example readme 2026-08-10 17:37:23 +05:30
harshal.patil e1d60fb89f refactor(esp_system): deduplicate ROM fast wake RTC digest reservation
The digest length and the condition that reserves it at the end of RTC RAM were
duplicated in seven places. Hold the reservation in a hidden Kconfig value that
is zero when the feature does not apply, so every consumer subtracts it
unconditionally, and derive ESP_SECURE_BOOT_DIGEST_LEN from it.
2026-07-30 12:20:22 +05:30
harshal.patil 29d67905f0 docs: add v6.2 migration guide entry for bootloader PMP ownership change
The second stage bootloader no longer configures or locks PMP entries on
C5, C6, C61, H2 and P4; document the impact on non-ESP-IDF applications
launched by the ESP-IDF bootloader that relied on the bootloader-provided
PMP configuration.
2026-07-29 11:41:22 +05:30
harshal.patil dc6939e583 test(esp_system): run memory protection panic tests on ESP32-P4 rev < 3.0 2026-07-29 11:41:22 +05:30
harshal.patil 1d6c44a889 change(esp_hw_support): make ESP32-P4 rev < 3.0 PMP layout forward-compatible
Commit ab229a34 added PSRAM memory protection for ESP32-P4 rev < 3.0. It
consumed all 16 PMP entries and shifted the fixed LP-RAM (9-12 -> 11-14) and
peripheral (13 -> 15) entries to make room. Older bootloaders lock the
peripheral entry at its original index 13, so on a v5.3/v5.4 bootloader running
a newer application the LP-RAM entry that landed on the locked index 13 was
silently ignored, weakening LP-RAM protection.

Select the rev < 3.0 layout at runtime by probing whether the bootloader locked
the peripheral at entry 13:
 - locked (v5.3/v5.4) -> default layout (LP-RAM 9-12, peripheral 13), no PSRAM
   protection; these devices never had it (it was introduced in v5.5).
 - free (v5.5+)       -> PSRAM layout (flash/ext-RAM 6-10, LP-RAM 11-14,
   peripheral 15) with full external-RAM protection; the peripheral entry at 15
   matches the bootloader's lock.

This restores forward compatibility across all shipped rev < 3.0 bootloaders
without regressing PSRAM protection on the v5.5+ devices that already have it.
Chip revision >= 3.0 (32 PMP entries) is unaffected.
2026-07-29 11:41:22 +05:30
harshal.patil 80535b24a0 change(esp_hw_support): configure PMP only in the application and freeze its layout
A PMP entry the (non-OTA-updatable) bootloader locks cannot be reconfigured
by the application until CPU reset, so the layout of the entries a shipped
bootloader locks is a bootloader<->application ABI that renumbering would
silently break on deployed devices.
On C5, C6, C61, H2 and P4 the bootloader now configures only the PMA invalid regions
and leaves PMP to the application.

On C5 the application programs the two ROM entries without a cfg reset:
v6.0/v6.1 bootloaders lock the TOR base entry at SOC_IROM_MASK_LOW, so on
such devices the TOR region above it spans the ROM text and must keep the
X bit those bootloaders left in the following unlocked entry, which
OR-only writes can never clear. With newer bootloaders the application
receives clean entries and the ROM data region gets the intended strict R
permission.
2026-07-29 11:41:22 +05:30
harshal.patil a7b29bfda9 change(security): disable Key Manager support on ESP32-C5/P4/S31
The Key Manager hardware peripheral in its current form needs further
design changes before it can be offered as a production feature.
Until a revised peripheral design is available, withdraw ESP-IDF
support for it on all Key Manager capable targets.
2026-07-22 19:58:23 +05:30
harshal.patil e32395652b ci(esp_tee): Fix tee_cli_app build failure due to heap overflow 2026-07-17 10:53:32 +05:30
Harshal Patil cbf8b877e1 Merge branch 'fix/partitions_ota_c2_c61_secure_boot_scheme' into 'master'
test: Incorrect SB key type for C2/C61

See merge request espressif/esp-idf!50232
2026-07-01 15:34:41 +05:30
harshal.patil e2c59acc52 test(examples/partitions_ota): handle RSA-less Secure Boot V2 on C2/C61
ESP32-C2 and ESP32-C61 have no RSA based Secure Boot V2 support, so the
CI configs that pin the RSA signing scheme and key fail the app signing
scheme/key check on these targets.

- flash_enc_wifi_2.data_partition_verification: add C2/C61 sdkconfig
  overlays that switch to the ECDSA P-256 signing scheme and key (no
  force-enable needed as Secure Boot V2 itself is not enabled here).
- on_update_no_sb_rsa: disable the build on targets without
  SOC_SECURE_BOOT_V2_RSA, mirroring simple_ota_example, since this
  config specifically exercises the RSA scheme.
2026-07-01 10:54:11 +05:30
Harshal Patil 3bd70e2c34 Merge branch 'change/secure_boot_signing_key_type_check' into 'master'
Validate secure boot signing key type at configure time

See merge request espressif/esp-idf!49529
2026-06-30 12:31:42 +05:30
harshal.patil 100084bd61 change(bootloader): validate secure boot signing key type at configure time
The signing step (espsecure sign-data) derives the signature block type
from the key file itself, so selecting e.g. the RSA app signing scheme
with an ECDSA signing key produced a successfully built image that only
failed signature verification at boot.

Check the key at configure time and fail with a clear error when:

- the key family (RSA vs ECDSA) does not match the selected app signing
  scheme
- the ECDSA curve does not match the selected ECDSA key size for the
  ECDSA (V1/V2) schemes
- the key cannot be parsed as an unencrypted PEM private key
2026-06-29 16:59:52 +05:30
harshal.patil 9707272cda test(mbedtls): move AES test vectors to a dedicated header 2026-06-29 15:56:09 +05:30
harshal.patil 6d45a3ae06 fix(mbedtls/aes): Fix AES-DMA over encrypted PSRAM on ESP32-S31
esp_crypto_shared_gdma_done() polled the AXI RX raw interrupt status
(in_done) but never cleared it, so after the first transfer the set bit
made every subsequent call return immediately without waiting.
2026-06-29 15:56:09 +05:30
harshal.patil 64e694541b fix(panic): handle absent IROM/DROM alignment gap in spiram-xip memprot tests
The spiram-xip IROM/DROM alignment tests assumed the XIP region always
leaves an alignment gap before the next MMU page: they executed into the
gap and expected an instruction access fault followed by a register dump.
When the section ends exactly on an MMU page boundary there is no gap - the
device prints "<IROM/DROM> alignment gap not added into heap" and returns,
the framework restarts cleanly (esp_restart_noos, no panic), and the test
timed out waiting for a register dump.
2026-06-29 13:00:54 +05:30
harshal.patil d6f41cac35 feat(mbedtls/psa_esp_rsa_ds): Expose persistent key buffer format/parse helpers 2026-06-18 09:42:54 +05:30
harshal.patil 505bab1267 feat(examples/security): Add example to demonstrate the usage of custom key storages with PSA 2026-06-18 09:42:54 +05:30
harshal.patil 3494df8c85 feat(mbedtls): Support custom storage backend for persistent PSA keys 2026-06-18 09:37:15 +05:30
harshal.patil 6b417e9d47 fix(esp_common/esp_fault): make ESP_FAULT_ASSERT survive optimization
ESP_FAULT_ASSERT(C) was silently deleted by the optimizer when C is a cached
flag/status already proven by a preceding `if (!C) return/goto`: the compiler
folds C to a constant and drops all three checks, removing the fault-injection
protection with no warning.
2026-06-17 16:45:29 +05:30
harshal.patil 9172417c13 fix(mbedtls/port): align ESP PSA hardware drivers with software references
Audited every esp_* PSA driver against its corresponding software driver in
mbedtls/library (psa_crypto_cipher.c, psa_crypto_aead.c, psa_crypto_mac.c,
psa_crypto_hash.c, psa_crypto_ecp.c, psa_crypto_rsa.c) and fixed gaps in
workflow ownership, error-path cleanup, sensitive-data wiping, and BAD_STATE
gating per the PSA Crypto API spec.

esp_aes (cipher): fix padding oracle in cipher_finish by replacing leaky
branches with mbedtls_ct_* primitives; abort wipes the driver-level ctx,
not just the inner mbedtls_aes_context; setup routes errors through abort.

esp_aes_gcm (AEAD): zeroize the 16-byte full_tag scratch; restore the
*output_length = finish_output_size assignment that the SW reference keeps
for future ciphers; NULL the inner ctx pointer after free in abort; gate
update/finish on a live ctx with PSA_ERROR_BAD_STATE.

esp_ecdsa: keep abort-at-exit in the one-shot wrappers so the stack-copy
of the hash (needed for little-endian byte order on HW) is wiped per
PSA spec 6.3.3, drop the over-defensive public-key qx/qy wipes that the
SW driver does not perform.

esp_cmac / esp_hmac_transparent / esp_hmac_opaque (MAC): make abort
idempotent, route setup errors through abort, gate update/finish/
verify_finish on PSA_ERROR_BAD_STATE, wipe M_last and intermediate hmac[]
buffers on completion or HW failure. HMAC opaque gains alg + computed
fields to mirror the SW psa_crypto_mac.c state machine. HMAC transparent
explicitly aborts the inner SHA context before reusing it for the outer
hash.

esp_sha: switch the per-op live indicator to (sha_ctx != NULL) so the
public esp_sha_operation_type_t enum keeps its original ordinal values;
free + NULL sha_ctx on every error path; gate update/finish/clone on a
live ctx; wipe per-algorithm core/parallel-engine scratch buffers
(W[], A[], state) on HW-engine failure.

esp_md5: replace bare memset in abort with mbedtls_platform_zeroize.

esp_rsa_ds: complete() no longer frees sig_buffer (abort owns that);
start() routes failures through abort; asymmetric_decrypt funnels all
cleanup through a single exit: label. RSA-DS utilities wipe the
decrypted-plaintext scratch on v15 / OAEP unpad failure.
2026-06-15 16:10:09 +05:30
harshal.patil f68bc1ba9f fix(secure_boot): range-check ECDSA r,s in bootloader before ROM verify 2026-06-12 14:38:47 +05:30
Harshal Patil c753716f5a Merge branch 'fix/partitions_ota_sb_esp32c2_c61' into 'master'
Use ECDSA Secure Boot V2 scheme for partitions_ota on C2/C61

See merge request espressif/esp-idf!49527
2026-06-10 16:08:18 +05:30
harshal.patil d8b7df4aa2 fix(examples/partitions_ota): use ECDSA Secure Boot V2 scheme for partitions_ota on C2/C61
ESP32-C2 and ESP32-C61 have no RSA based Secure Boot V2 support
so the virt_sb_v2_and_fe configs cannot use the default RSA signing key.
Add target-specific sdkconfig overlays that switch to the ECDSA P-256 key;
on ESP32-C61 the ECDSA scheme must additionally be force-enabled
SECURE_BOOT_V2_ECDSA_INSECURE).
2026-06-10 15:30:06 +05:30
Harshal Patil a5591852c5 Merge branch 'fix/remove_nonexistent_crypto_registers_c61' into 'master'
Remove non-existent crypto registers (ESP32-C61)

See merge request espressif/esp-idf!49241
2026-06-09 18:16:01 +05:30
harshal.patil 81ffe04323 fix(soc): Remove non-existent crypto registers (ESP32-C61) 2026-06-09 13:33:25 +05:30
harshal.patil f9642ccad4 test(esp_hal_security): warm up ECC const-time loop before measuring 2026-06-09 10:59:12 +05:30
harshal.patil dec9ce8263 fix(esp_tee): Reset crypto peripherals before the panic-induced reset 2026-06-09 10:59:12 +05:30
harshal.patil c5e03fd55c fix(esp_rom): Patch ets_ecdsa_verify() to include signature bounds check 2026-06-09 10:59:12 +05:30
harshal.patil 554cce6937 fix(mbedtls): validate ECDSA signature range and harden ECC memory power-down 2026-06-09 10:59:11 +05:30
harshal.patil 3cbd175d2b test(mbedtls/crt_bundle): Make weak-hash test self-contained
The "custom certificate bundle - weak hash" test relied on DigiCert
Global Root CA being present as a trust anchor in cacrt_all.pem (the
only SHA-1-self-signed root in the chain it loaded). The recent
cacrt_all.pem refresh moved that root to cacrt_deprecated.pem, so the
chain could no longer anchor and the test started failing.
2026-06-02 10:06:43 +05:30
harshal.patil a24bd0bf10 test(mbedtls): Add out-of-bounds test for the ECDSA hardware driver 2026-05-26 11:01:57 +05:30
harshal.patil b4517542ae change(esp_psram): Consider all PSRAM regions in PMP protection 2026-05-19 21:32:29 +05:30
harshal.patil 83ebd475c3 test(mbedtls/persistent_storage_format): Add ESP ITS NVS format-stability test app 2026-05-15 09:12:20 +05:30
harshal.patil 4821f331fe refactor(mbedtls/test): Move the mbedtls test app to support multiple test apps 2026-05-15 09:09:15 +05:30
harshal.patil d7c9c3bc10 feat(mbedtls/psa_esp_rsa_ds): Support persistent ESP-RSA DS driver 2026-05-15 09:09:15 +05:30
harshal.patil 9aba184c43 feat(esp_security): add ECDH1 deployment mode to Key Manager driver 2026-04-30 09:29:40 +05:30
harshal.patil c9366ac4b5 fix(esp_security): Fix the flipped key info slot when deploying a Key Manager-based key 2026-04-30 09:17:38 +05:30
harshal.patil 8ce8d8919b fix(esp_security): Enable ECC clock while using the Key Manager's ECDH key deployment mode 2026-04-30 09:17:31 +05:30
Harshal Patil a860d18878 Merge branch 'change/add_tee_key_len_validation_psa_ecdsa_driver' into 'master'
Add tee key id length validation in the ESP-ECDSA PSA driver

See merge request espressif/esp-idf!48054
2026-04-29 23:57:22 +05:30
harshal.patil 63992372fb change(mbedtls): Add tee key id length validation in the ESP-ECDSA PSA driver 2026-04-28 22:17:25 +05:30
harshal.patil c13403aea6 fix(cpu_region_protect): Fix incorrect definition of ALIGN_UP macro 2026-04-28 18:12:46 +05:30
harshal.patil ca480e0199 fix(esp_hw_support): reset stale PMP gap entries on P4 v3 before app memprot setup 2026-04-28 18:12:11 +05:30
Harshal Patil 8f254a2056 Merge branch 'fix/supported_key_mgr_key_types_check' into 'master'
fix(esp_security): guard key manager APIs against unsupported chip revs

Closes IDF-15621

See merge request espressif/esp-idf!47946
2026-04-27 18:40:06 +05:30
harshal.patil 8bfc4f7255 fix(esp_security): guard key manager APIs against unsupported chip revs
On ESP32-P4 rev < 3.0, Key Manager is software-disabled, but the public
esp_key_mgr.h APIs had no runtime check.
Calls using HMAC/DS/PSRAM key types fell through to
HAL_ASSERT("Unsupported ...") paths in key_mgr_ll.h. Gate
each public API with key_mgr_ll_is_supported() and return
ESP_ERR_NOT_SUPPORTED cleanly instead.
2026-04-27 15:18:34 +05:30
harshal.patil 7eb44576be test(mbedtls): Add a test for opaque HMAC driver verification 2026-04-22 10:11:27 +05:30
harshal.patil f195d183be fix(mbedtls): Flash compatibility across multiple key sources (ECDSA, HMAC) 2026-04-22 10:11:12 +05:30
Harshal Patil 876b9581bd Merge branch 'fix/enable_key_mgr_clk_for_efuse_key_ops' into 'master'
Enable Key Manager clock even for efuses-based key operations

See merge request espressif/esp-idf!46740
2026-03-25 21:37:53 +05:30
harshal.patil 2b77826e06 fix(mbedtls/rsa_ds): Preserve compatibility by reverting the modified esp_ds_data_ctx_t size 2026-03-25 18:54:04 +05:30
harshal.patil 28736a81fa fix(esp_security): Enable Key Manager clocks even for efuse key operations
The Key Manager holds a key usage register, thus, the Key Manager peripheral
clock must be enabled even for efuses-based key operations to route the
crypto operations to correctly to the efuses (default is Key Manager)
2026-03-25 10:38:44 +05:30
harshal.patil ccc48c3980 fix(esp_security): Fixes incorrect key manager configuration for ESP32-P4 rev < 3 2026-03-24 15:23:23 +05:30
harshal.patil 48e7d44ce1 fix(esp-tls): Remove the legacy use_km_key option 2026-03-20 11:15:23 +05:30
harshal.patil 398d9ea9cd fix(esp_security): Add more validation checks 2026-03-20 11:15:23 +05:30
harshal.patil 0db717b9ec feat(esp_ds): Support using the AES key used by DS peripheral for encrypting params 2026-03-20 11:15:23 +05:30
harshal.patil 5f647c0ba3 docs(key-manager): Add Key-Manager peripheral related documentation 2026-03-18 16:27:39 +05:30
harshal.patil a1b52eb8ba test(examples/security): Extend the flash enc example to flash enc enabled using KM targets 2026-03-18 16:27:39 +05:30
harshal.patil a8ffefe096 test(examples/security): Add an example to demonstrate signing using Key Manager keys 2026-03-18 16:27:39 +05:30
harshal.patilandZhang Shu Xian 269b90323f docs: Adds a migration guide entry for HMAC peripheral's PSA interface
Co-authored-by: Zhang Shu Xian <zhangshuxian@espressif.com>
2026-03-16 16:38:26 +08:00
Harshal Patil 05b75b76bc Merge branch 'change/fix_convention_for_esp_ds_psa_lifetime' into 'master'
Rename the ESP DS-RSA key lifetime name to include the VOLATILE keyword

See merge request espressif/esp-idf!46351
2026-03-09 08:32:39 +05:30
harshal.patil b5550281b9 change(mbedtls): Change the ESP-DS-RSA key lifetime name to include the VOLATILE keyword 2026-03-06 15:00:38 +05:30
Harshal Patil efbe83bd21 Merge branch 'feat/introduce_esp_rsa_ds_opaque_key_context' into 'master'
Introduce ESP-RSA DS opaque key context

See merge request espressif/esp-idf!45953
2026-03-04 11:19:43 +05:30
harshal.patil a1bbab43fe feat(mbedtls/esp_rsa_ds): Support Key Manager key using the ESP-RSA-DS PSA interface 2026-03-03 18:42:07 +05:30
harshal.patil 8036017951 feat(mbedtls/esp_mac): Support Key Manager key using the ESP-HMAC PSA interface 2026-03-03 18:40:31 +05:30
harshal.patil 30a120c7cb feat(mbedtls/esp_ecdsa): Support Key Manager key using the ESP-ECDSA PSA interface 2026-03-03 18:40:31 +05:30
harshal.patil 163e0974b3 change(mbedtls/psa_driver_esp_hmac): Use efuse key block instead of efuse block
- Maintains compatibility of the older esp_hmac_ APIs and the PSA driver
2026-03-03 18:36:18 +05:30
harshal.patil aa63487d9f feat(mbedtls/esp_rsa_ds): Introduce ESP-RSA DS opaque key context 2026-03-03 18:36:18 +05:30
harshal.patil 8bd87b67e2 fix(nvs_flash): Use h/w accelerated AES-ECB for XTS-AES operations 2026-02-11 15:24:03 +05:30
Harshal Patil 9cf49269aa Merge branch 'fix/support_truncated_hmac' into 'master'
Allow truncated ESP-PSA HMAC driver operations

Closes IDF-15299

See merge request espressif/esp-idf!45754
2026-02-11 10:25:04 +05:30
harshal.patil 6964de6f45 test(esp_security): Update the Key Manager test to support ESP32-P4 2026-02-10 17:48:52 +05:30
harshal.patil b4542bf748 fix(mbedtls): Support truncated HMAC 2026-02-10 14:08:46 +05:30
harshal.patil 0cebfe7771 change(mbedtls): Disable MBEDTLS_SHA3_C by default 2026-02-03 14:55:44 +08:00
harshal.patil 2bc49effb4 test(mbedtls): Re-introduce the extensive AES, AES-GCM and the SHA tests
- Also extend the PSRAM encryption test to ESP32-S3
2026-02-02 16:58:01 +05:30
harshal.patil 1c0e4455bb fix(mbedtls/sha): Fix SHA-512 parallel engine driver to the use h/w engine 2026-02-02 16:57:25 +05:30
harshal.patil 0c8fbdcc83 feat(esp_tee/tee_sec_storage): Use PSA interface internally 2026-01-31 13:30:58 +05:30
harshal.patil 48c373aea2 fix(mbedtls/psa_driver_aes_gcm): Support shortened tag length for AES-GCM 2026-01-31 13:30:57 +05:30
harshal.patil b450664e2b fix(mbedtls/include): Fix include libs in the driver's public headers 2026-01-31 13:30:57 +05:30
harshal.patil 4ab9ac1ccd fix(mbedtls): Make the driver define macros public to allow application access
- Also, use the PSA HMAC opaque key interface for HMAC-PBKDF2
2026-01-31 13:30:55 +05:30
harshal.patil 7750c40c45 feat(mbedlts/hmac): Support HMAC(MD5) using the MD5 driver 2026-01-31 00:45:12 +05:30
harshal.patil be73538452 change(mbedtls): Remove legacy headers 2026-01-31 00:45:12 +05:30
harshal.patil ae459b5204 feat(mbedtls): Introduce ESP-HMAC PSA opaque driver 2026-01-31 00:45:11 +05:30
harshal.patil 53072bfa9d fix(mbedtls): Enable h/w accel for CMAC and HMAC operations
- Refactor ESP-MAC drivers
2026-01-31 00:45:11 +05:30
harshal.patil f18b893e7a fix(mbedtls/ecdsa): Improve build time efuse validation checks in the ecdsa driver 2026-01-29 23:07:34 +05:30
Harshal Patil 87fb2eb4e9 Merge branch 'fix/dead_code_and_uninitialised_scalar' into 'master'
fix(examples/tee): Remove dead code and fix unintialised scalar usage

Closes IDF-15182 and IDF-15183

See merge request espressif/esp-idf!45325
2026-01-21 12:32:44 +05:30
harshal.patil 16e01b7b75 fix(examples/tee): Remove dead code and fix unintialised scalar usage 2026-01-21 10:12:33 +05:30
harshal.patil acb71bc858 feat(esp_tee): Support deterministic ECDSA signatures for ESP-TEE based keys 2026-01-19 09:14:37 +05:30
harshal.patil e9ea55bea2 feat(mbedtls/ecdsa): Introduce PSA ECDSA driver 2026-01-19 09:14:37 +05:30
harshal.patil 488ee5dfbc fix(mbedtls/aes): Cache invalidate the output buffer before the AES-DMA operation
Instead of performing the cache-to-memory (C2M) operation on the output buffer,
even a cache invalidate (M2C) is sufficient to ensure that no write-back occurs
during the DMA write operation
2026-01-07 23:40:59 +05:30
Harshal Patil eec7e5bb64 Merge branch 'fix/partial-hardware-aes-gcm-and-software-non-aes-ciphers' into 'master'
Fix partial hardware AES-GCM, software-fallback for non-AES ciphers

Closes IDF-12474, IDF-15050, and IDF-15051

See merge request espressif/esp-idf!44616
2026-01-05 18:34:34 +05:30
harshal.patil e91d50ed1e fix(mbedtls): Support partial hardware AES-GCM and s/w fallback for non-AES ciphers
- Support software-fallback for unsupported hardware AES lengths
2026-01-03 12:17:50 +05:30
harshal.patil 35b305f916 fix(mbedlts/aes): Ensure cache coherency when DMA writes to cacheable PSRAM buffers 2025-12-26 12:26:36 +05:30
harshal.patil 60637470c2 test(ota): Add tests for verifying app build's SBv2 ECDSA signature verify APIs 2025-12-23 23:24:46 +05:30
harshal.patil bf16835aa1 test(mbedtls): Run mbedtls HW tests only if HW enabled 2025-12-16 10:05:25 +05:30
harshal.patil 2f3fdba22f fix(mbedtls/aes): Reallocate buffers only if in external RAM 2025-12-12 14:44:24 +05:30
harshal.patil 37251c2ce2 test(mbedtls): add more tests for alignment, buffer size related
- Also, enabled Flash Encryption enabled tests for ESP32-C5
- Removed ESP32-P4 specific configs, as those configs are set as default now
2025-12-12 14:44:22 +05:30
harshal.patil 4263319f27 fix(secure_boot): Application's Secure Boot verify API support ECDSA-P384 2025-12-12 12:33:49 +05:30
harshal.patil 19cddd6739 fix(key_mgr): Correct XTS-AES key length register configuration
The key_mgr_ll_set_xts_aes_key_len() function was incorrectly using
REG_SET_FIELD() with the key_len enum value directly. Since
KEYMNG_FLASH_KEY_LEN is a 1-bit register field (0=128-bit, 1=256-bit),
writing ESP_KEY_MGR_XTS_AES_LEN_128 (value 3) resulted in the LSB (1)
being stored, incorrectly configuring 256-bit mode.

Fixed by using a switch statement to properly map:
- ESP_KEY_MGR_XTS_AES_LEN_128 → REG_CLR_BIT (0)
- ESP_KEY_MGR_XTS_AES_LEN_256 → REG_SET_BIT (1)

Thus, matching the correct ESP32-C5 implementation.
2025-12-04 13:56:00 +05:30