diff --git a/components/mbedtls/port/aes/esp_aes_gcm.c b/components/mbedtls/port/aes/esp_aes_gcm.c index b8cb59f229..dcbfac4ce9 100644 --- a/components/mbedtls/port/aes/esp_aes_gcm.c +++ b/components/mbedtls/port/aes/esp_aes_gcm.c @@ -108,12 +108,9 @@ static void increment32_j0(esp_gcm_context *ctx, uint8_t *j) /* Function to xor two data blocks */ static void xor_data(uint8_t *d, const uint8_t *s) { - uint32_t *dst = (uint32_t *) d; - uint32_t *src = (uint32_t *) s; - *dst++ ^= *src++; - *dst++ ^= *src++; - *dst++ ^= *src++; - *dst++ ^= *src++; + for (int i = 0; i < AES_BLOCK_BYTES; i++) { + d[i] ^= s[i]; + } }