mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Rename MBEDTLS_CIPHER_ENCRYPT_ONLY as MBEDTLS_BLOCK_CIPHER_NO_DECRYPT
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
#include "mbedtls/platform.h"
|
||||
|
||||
#if (!defined(MBEDTLS_AES_DECRYPT_ALT) || !defined(MBEDTLS_AES_SETKEY_DEC_ALT)) && \
|
||||
!defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
!defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
#define MBEDTLS_AES_NEED_REVERSE_TABLES
|
||||
#endif
|
||||
|
||||
@@ -691,7 +691,7 @@ int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||
/*
|
||||
* AES key schedule (decryption)
|
||||
*/
|
||||
#if !defined(MBEDTLS_AES_SETKEY_DEC_ALT) && !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_AES_SETKEY_DEC_ALT) && !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||
unsigned int keybits)
|
||||
{
|
||||
@@ -760,7 +760,7 @@ exit:
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* !MBEDTLS_AES_SETKEY_DEC_ALT && !MBEDTLS_CIPHER_ENCRYPT_ONLY */
|
||||
#endif /* !MBEDTLS_AES_SETKEY_DEC_ALT && !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
|
||||
|
||||
#if defined(MBEDTLS_CIPHER_MODE_XTS)
|
||||
static int mbedtls_aes_xts_decode_keys(const unsigned char *key,
|
||||
@@ -949,7 +949,7 @@ int mbedtls_internal_aes_encrypt(mbedtls_aes_context *ctx,
|
||||
/*
|
||||
* AES-ECB block decryption
|
||||
*/
|
||||
#if !defined(MBEDTLS_AES_DECRYPT_ALT) && !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_AES_DECRYPT_ALT) && !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
int mbedtls_internal_aes_decrypt(mbedtls_aes_context *ctx,
|
||||
const unsigned char input[16],
|
||||
unsigned char output[16])
|
||||
@@ -1006,7 +1006,7 @@ int mbedtls_internal_aes_decrypt(mbedtls_aes_context *ctx,
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* !MBEDTLS_AES_DECRYPT_ALT && !MBEDTLS_CIPHER_ENCRYPT_ONLY */
|
||||
#endif /* !MBEDTLS_AES_DECRYPT_ALT && !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
|
||||
|
||||
/* VIA Padlock and our intrinsics-based implementation of AESNI require
|
||||
* the round keys to be aligned on a 16-byte boundary. We take care of this
|
||||
@@ -1061,7 +1061,7 @@ int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
if (mode == MBEDTLS_AES_ENCRYPT) {
|
||||
return mbedtls_internal_aes_encrypt(ctx, input, output);
|
||||
} else {
|
||||
@@ -1496,7 +1496,7 @@ exit:
|
||||
*
|
||||
* http://csrc.nist.gov/archive/aes/rijndael/rijndael-vals.zip
|
||||
*/
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
static const unsigned char aes_test_ecb_dec[][16] =
|
||||
{
|
||||
{ 0x44, 0x41, 0x6A, 0xC2, 0xD1, 0xF5, 0x3C, 0x58,
|
||||
@@ -1901,7 +1901,7 @@ int mbedtls_aes_self_test(int verbose)
|
||||
mbedtls_printf(" AES-ECB-%3u (%s): ", keybits,
|
||||
(mode == MBEDTLS_AES_DECRYPT) ? "dec" : "enc");
|
||||
}
|
||||
#if defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
if (mode == MBEDTLS_AES_DECRYPT) {
|
||||
if (verbose != 0) {
|
||||
mbedtls_printf("skipped\n");
|
||||
@@ -1912,7 +1912,7 @@ int mbedtls_aes_self_test(int verbose)
|
||||
|
||||
memset(buf, 0, 16);
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
if (mode == MBEDTLS_AES_DECRYPT) {
|
||||
ret = mbedtls_aes_setkey_dec(&ctx, key, keybits);
|
||||
aes_tests = aes_test_ecb_dec[u];
|
||||
|
Reference in New Issue
Block a user