fix(mbedtls): prevent vectorization fault in clang O2 optimization

Closes https://github.com/espressif/esp-idf/pull/17582
This commit is contained in:
Akiyama Kohane
2025-09-14 00:57:53 +08:00
committed by Ashish Sharma
parent 22cae61ee1
commit 4358d21a06
2 changed files with 5 additions and 0 deletions

View File

@@ -62,6 +62,9 @@ static int esp_ds_rsaes_pkcs1_v15_unpadding(unsigned char *input,
}
/* Verify padding bytes are non-zero in constant time */
#if defined(__clang__) && defined(__xtensa__)
#pragma clang loop vectorize(disable)
#endif
for (size_t i = 2; i < ilen; i++) {
unsigned char in_padding = (i < pad_count + 2);
unsigned char is_zero = (input[i] == 0x00);

View File

@@ -0,0 +1,2 @@
CONFIG_COMPILER_RT_LIB_CLANGRT=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y