mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-05 19:35:48 +03:00
BLOCK_CIPHER_NO_DECRYPT: call encrypt direction unconditionally
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
@@ -1064,14 +1064,13 @@ int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
||||
if (mode == MBEDTLS_AES_ENCRYPT) {
|
||||
return mbedtls_internal_aes_encrypt(ctx, input, output);
|
||||
} else {
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
if (mode == MBEDTLS_AES_DECRYPT) {
|
||||
return mbedtls_internal_aes_decrypt(ctx, input, output);
|
||||
#else
|
||||
return MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
return mbedtls_internal_aes_encrypt(ctx, input, output);
|
||||
}
|
||||
#endif /* !MBEDTLS_AES_USE_HARDWARE_ONLY */
|
||||
}
|
||||
|
Reference in New Issue
Block a user