mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
mbedtls: esp32s2: check and reallocate output buffer if its from non-DMA range
Earlier check was for only input buffer but it is quite likely to have output buffer also from non-DMA memory range and hence requirement to reallocate and then copy data from AES engine.
This commit is contained in:
parent
18c1838587
commit
0d208aabab
@ -448,6 +448,10 @@ static int esp_aes_process_dma(esp_aes_context *ctx, const unsigned char *input,
|
||||
input_needs_realloc = true;
|
||||
}
|
||||
|
||||
if (!esp_ptr_dma_ext_capable(output) && !esp_ptr_dma_capable(output)) {
|
||||
output_needs_realloc = true;
|
||||
}
|
||||
|
||||
/* If either input or output is unaccessible to the DMA then they need to be reallocated */
|
||||
if (input_needs_realloc || output_needs_realloc) {
|
||||
return esp_aes_process_dma_ext_ram(ctx, input, output, len, stream_out, input_needs_realloc, output_needs_realloc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user