From 11c8f6aa94d181ecaf2741666a967345277e4d1d Mon Sep 17 00:00:00 2001 From: "harshal.patil" Date: Wed, 10 Dec 2025 12:32:31 +0530 Subject: [PATCH] fix(mbedtls/aes): Reallocate buffers only if in external RAM --- components/mbedtls/port/aes/dma/esp_aes_dma_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/mbedtls/port/aes/dma/esp_aes_dma_core.c b/components/mbedtls/port/aes/dma/esp_aes_dma_core.c index 05f70e2cd1..a066122d95 100644 --- a/components/mbedtls/port/aes/dma/esp_aes_dma_core.c +++ b/components/mbedtls/port/aes/dma/esp_aes_dma_core.c @@ -1020,11 +1020,12 @@ int esp_aes_process_dma(esp_aes_context *ctx, const unsigned char *input, unsign #if (CONFIG_SPIRAM && SOC_PSRAM_DMA_CAPABLE) #ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT if (efuse_hal_flash_encryption_enabled()) { - if (esp_ptr_external_ram(input) || esp_ptr_external_ram(output) || esp_ptr_in_drom(input) || esp_ptr_in_drom(output)) { + if (esp_ptr_external_ram(input) || esp_ptr_in_drom(input)) { if (((intptr_t)(input) & (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) { input_needs_realloc = true; } - + } + if (esp_ptr_external_ram(output) || esp_ptr_in_drom(output)) { if (((intptr_t)(output) & (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) { output_needs_realloc = true; }