aes.c: add config option to support cipher_encrypt_only

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
Yanray Wang 2023-05-15 11:23:50 +08:00
parent 427424768a
commit 78ee0c9e4f
2 changed files with 65 additions and 34 deletions

View file

@ -167,6 +167,7 @@ MBEDTLS_CHECK_RETURN_TYPICAL
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
unsigned int keybits);
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
/**
* \brief This function sets the decryption key.
*
@ -185,6 +186,7 @@ int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
MBEDTLS_CHECK_RETURN_TYPICAL
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
unsigned int keybits);
#endif /* !MBEDTLS_CIPHER_ENCRYPT_ONLY */
#if defined(MBEDTLS_CIPHER_MODE_XTS)
/**
@ -604,6 +606,7 @@ int mbedtls_internal_aes_encrypt(mbedtls_aes_context *ctx,
const unsigned char input[16],
unsigned char output[16]);
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
/**
* \brief Internal AES block decryption function. This is only
* exposed to allow overriding it using see
@ -619,6 +622,7 @@ MBEDTLS_CHECK_RETURN_TYPICAL
int mbedtls_internal_aes_decrypt(mbedtls_aes_context *ctx,
const unsigned char input[16],
unsigned char output[16]);
#endif /* !MBEDTLS_CIPHER_ENCRYPT_ONLY */
#if defined(MBEDTLS_SELF_TEST)
/**