mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 18:10:57 +02:00
fix(mbedtls): prevent vectorization fault in clang O2 optimization
Closes https://github.com/espressif/esp-idf/pull/17582
This commit is contained in:
committed by
Ashish Sharma
parent
22cae61ee1
commit
4358d21a06
@@ -62,6 +62,9 @@ static int esp_ds_rsaes_pkcs1_v15_unpadding(unsigned char *input,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Verify padding bytes are non-zero in constant time */
|
/* 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++) {
|
for (size_t i = 2; i < ilen; i++) {
|
||||||
unsigned char in_padding = (i < pad_count + 2);
|
unsigned char in_padding = (i < pad_count + 2);
|
||||||
unsigned char is_zero = (input[i] == 0x00);
|
unsigned char is_zero = (input[i] == 0x00);
|
||||||
|
@@ -0,0 +1,2 @@
|
|||||||
|
CONFIG_COMPILER_RT_LIB_CLANGRT=y
|
||||||
|
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
Reference in New Issue
Block a user