1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-23 15:01:00 +03:00

Revert not-useful changes to AES-CBC decrypt

Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
This commit is contained in:
Dave Rodgman
2023-06-04 12:55:15 -04:00
committed by Dave Rodgman
parent f1e396c427
commit 9d1635e742

View File

@ -1069,15 +1069,14 @@ int mbedtls_aes_crypt_cbc(mbedtls_aes_context *ctx,
#endif
if (mode == MBEDTLS_AES_DECRYPT) {
unsigned char temp2[16];
while (length > 0) {
memcpy(temp, input, 16);
ret = mbedtls_aes_crypt_ecb(ctx, mode, input, temp2);
ret = mbedtls_aes_crypt_ecb(ctx, mode, input, output);
if (ret != 0) {
goto exit;
}
mbedtls_xor(output, temp2, iv, 16);
mbedtls_xor(output, output, iv, 16);
memcpy(iv, temp, 16);