mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +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];
|
||||
|
@ -199,7 +199,7 @@ rounds_10:
|
||||
/* Two rounds of AESCE decryption */
|
||||
#define AESCE_DECRYPT_ROUND_X2 AESCE_DECRYPT_ROUND; AESCE_DECRYPT_ROUND
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
static uint8x16_t aesce_decrypt_block(uint8x16_t block,
|
||||
unsigned char *keys,
|
||||
int rounds)
|
||||
@ -244,7 +244,7 @@ int mbedtls_aesce_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
uint8x16_t block = vld1q_u8(&input[0]);
|
||||
unsigned char *keys = (unsigned char *) (ctx->buf + ctx->rk_offset);
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
if (mode == MBEDTLS_AES_ENCRYPT) {
|
||||
block = aesce_encrypt_block(block, keys, ctx->nr);
|
||||
} else {
|
||||
@ -253,7 +253,7 @@ int mbedtls_aesce_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
#else
|
||||
(void) mode;
|
||||
block = aesce_encrypt_block(block, keys, ctx->nr);
|
||||
#endif /* !MBEDTLS_CIPHER_ENCRYPT_ONLY */
|
||||
#endif /* !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
|
||||
vst1q_u8(&output[0], block);
|
||||
|
||||
return 0;
|
||||
@ -262,7 +262,7 @@ int mbedtls_aesce_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
/*
|
||||
* Compute decryption round keys from encryption round keys
|
||||
*/
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
void mbedtls_aesce_inverse_key(unsigned char *invkey,
|
||||
const unsigned char *fwdkey,
|
||||
int nr)
|
||||
|
@ -99,7 +99,7 @@ void mbedtls_aesce_gcm_mult(unsigned char c[16],
|
||||
const unsigned char b[16]);
|
||||
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
/**
|
||||
* \brief Internal round key inversion. This function computes
|
||||
* decryption round keys from the encryption round keys.
|
||||
@ -111,7 +111,7 @@ void mbedtls_aesce_gcm_mult(unsigned char c[16],
|
||||
void mbedtls_aesce_inverse_key(unsigned char *invkey,
|
||||
const unsigned char *fwdkey,
|
||||
int nr);
|
||||
#endif /* !MBEDTLS_CIPHER_ENCRYPT_ONLY */
|
||||
#endif /* !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
|
||||
|
||||
/**
|
||||
* \brief Internal key expansion for encryption
|
||||
|
@ -93,7 +93,7 @@ int mbedtls_aesni_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
++rk;
|
||||
--nr;
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
if (mode == MBEDTLS_AES_ENCRYPT) {
|
||||
while (nr != 0) {
|
||||
state = _mm_aesenc_si128(state, *rk);
|
||||
@ -118,7 +118,7 @@ int mbedtls_aesni_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
--nr;
|
||||
}
|
||||
state = _mm_aesenclast_si128(state, *rk);
|
||||
#endif /* !MBEDTLS_CIPHER_ENCRYPT_ONLY */
|
||||
#endif /* !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
|
||||
|
||||
memcpy(output, &state, 16);
|
||||
return 0;
|
||||
@ -228,7 +228,7 @@ void mbedtls_aesni_gcm_mult(unsigned char c[16],
|
||||
/*
|
||||
* Compute decryption round keys from encryption round keys
|
||||
*/
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
void mbedtls_aesni_inverse_key(unsigned char *invkey,
|
||||
const unsigned char *fwdkey, int nr)
|
||||
{
|
||||
@ -468,7 +468,7 @@ int mbedtls_aesni_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
"jnz 1b \n\t"
|
||||
"movdqu (%1), %%xmm1 \n\t" // load round key
|
||||
AESENCLAST(xmm1_xmm0) // last round
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
"jmp 3f \n\t"
|
||||
|
||||
"2: \n\t" // decryption loop
|
||||
@ -606,7 +606,7 @@ void mbedtls_aesni_gcm_mult(unsigned char c[16],
|
||||
/*
|
||||
* Compute decryption round keys from encryption round keys
|
||||
*/
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
void mbedtls_aesni_inverse_key(unsigned char *invkey,
|
||||
const unsigned char *fwdkey, int nr)
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ void mbedtls_aesni_gcm_mult(unsigned char c[16],
|
||||
const unsigned char a[16],
|
||||
const unsigned char b[16]);
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
/**
|
||||
* \brief Internal round key inversion. This function computes
|
||||
* decryption round keys from the encryption round keys.
|
||||
@ -144,7 +144,7 @@ void mbedtls_aesni_gcm_mult(unsigned char c[16],
|
||||
void mbedtls_aesni_inverse_key(unsigned char *invkey,
|
||||
const unsigned char *fwdkey,
|
||||
int nr);
|
||||
#endif /* !MBEDTLS_CIPHER_ENCRYPT_ONLY */
|
||||
#endif /* !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
|
||||
|
||||
/**
|
||||
* \brief Internal key expansion for encryption
|
||||
|
@ -425,7 +425,7 @@ int mbedtls_aria_setkey_enc(mbedtls_aria_context *ctx,
|
||||
/*
|
||||
* Set decryption key
|
||||
*/
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
int mbedtls_aria_setkey_dec(mbedtls_aria_context *ctx,
|
||||
const unsigned char *key, unsigned int keybits)
|
||||
{
|
||||
@ -455,7 +455,7 @@ int mbedtls_aria_setkey_dec(mbedtls_aria_context *ctx,
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* !MBEDTLS_CIPHER_ENCRYPT_ONLY */
|
||||
#endif /* !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
|
||||
|
||||
/*
|
||||
* Encrypt a block
|
||||
@ -886,12 +886,12 @@ int mbedtls_aria_self_test(int verbose)
|
||||
/* test ECB decryption */
|
||||
if (verbose) {
|
||||
mbedtls_printf(" ARIA-ECB-%d (dec): ", 128 + 64 * i);
|
||||
#if defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
mbedtls_printf("skipped\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
mbedtls_aria_setkey_dec(&ctx, aria_test1_ecb_key, 128 + 64 * i);
|
||||
mbedtls_aria_crypt_ecb(&ctx, aria_test1_ecb_ct[i], blk);
|
||||
ARIA_SELF_TEST_ASSERT(
|
||||
|
@ -411,7 +411,7 @@ int mbedtls_camellia_setkey_enc(mbedtls_camellia_context *ctx,
|
||||
/*
|
||||
* Camellia key schedule (decryption)
|
||||
*/
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
int mbedtls_camellia_setkey_dec(mbedtls_camellia_context *ctx,
|
||||
const unsigned char *key,
|
||||
unsigned int keybits)
|
||||
@ -457,7 +457,7 @@ exit:
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* !MBEDTLS_CIPHER_ENCRYPT_ONLY */
|
||||
#endif /* !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
|
||||
|
||||
/*
|
||||
* Camellia-ECB block encryption/decryption
|
||||
@ -902,7 +902,7 @@ int mbedtls_camellia_self_test(int verbose)
|
||||
(v == MBEDTLS_CAMELLIA_DECRYPT) ? "dec" : "enc");
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
if (v == MBEDTLS_CAMELLIA_DECRYPT) {
|
||||
if (verbose != 0) {
|
||||
mbedtls_printf("skipped\n");
|
||||
@ -914,7 +914,7 @@ int mbedtls_camellia_self_test(int verbose)
|
||||
for (i = 0; i < CAMELLIA_TESTS_ECB; i++) {
|
||||
memcpy(key, camellia_test_ecb_key[u][i], 16 + 8 * u);
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
if (v == MBEDTLS_CAMELLIA_DECRYPT) {
|
||||
mbedtls_camellia_setkey_dec(&ctx, key, 128 + u * 64);
|
||||
memcpy(src, camellia_test_ecb_cipher[u][i], 16);
|
||||
|
@ -386,7 +386,7 @@ int mbedtls_cipher_setkey(mbedtls_cipher_context_t *ctx,
|
||||
ctx->key_bitlen = key_bitlen;
|
||||
ctx->operation = operation;
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
/*
|
||||
* For OFB, CFB and CTR mode always use the encryption key schedule
|
||||
*/
|
||||
|
@ -238,7 +238,7 @@ static int aes_crypt_xts_wrap(void *ctx, mbedtls_operation_t operation,
|
||||
}
|
||||
#endif /* MBEDTLS_CIPHER_MODE_XTS */
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
static int aes_setkey_dec_wrap(void *ctx, const unsigned char *key,
|
||||
unsigned int key_bitlen)
|
||||
{
|
||||
@ -293,7 +293,7 @@ static const mbedtls_cipher_base_t aes_info = {
|
||||
NULL,
|
||||
#endif
|
||||
aes_setkey_enc_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
aes_setkey_dec_wrap,
|
||||
#endif
|
||||
aes_ctx_alloc,
|
||||
@ -603,7 +603,7 @@ static const mbedtls_cipher_base_t gcm_aes_info = {
|
||||
NULL,
|
||||
#endif
|
||||
gcm_aes_setkey_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
gcm_aes_setkey_wrap,
|
||||
#endif
|
||||
gcm_ctx_alloc,
|
||||
@ -676,7 +676,7 @@ static const mbedtls_cipher_base_t ccm_aes_info = {
|
||||
NULL,
|
||||
#endif
|
||||
ccm_aes_setkey_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
ccm_aes_setkey_wrap,
|
||||
#endif
|
||||
ccm_ctx_alloc,
|
||||
@ -795,7 +795,7 @@ static int camellia_crypt_ctr_wrap(void *ctx, size_t length, size_t *nc_off,
|
||||
}
|
||||
#endif /* MBEDTLS_CIPHER_MODE_CTR */
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
static int camellia_setkey_dec_wrap(void *ctx, const unsigned char *key,
|
||||
unsigned int key_bitlen)
|
||||
{
|
||||
@ -851,7 +851,7 @@ static const mbedtls_cipher_base_t camellia_info = {
|
||||
NULL,
|
||||
#endif
|
||||
camellia_setkey_enc_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
camellia_setkey_dec_wrap,
|
||||
#endif
|
||||
camellia_ctx_alloc,
|
||||
@ -1026,7 +1026,7 @@ static const mbedtls_cipher_base_t gcm_camellia_info = {
|
||||
NULL,
|
||||
#endif
|
||||
gcm_camellia_setkey_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
gcm_camellia_setkey_wrap,
|
||||
#endif
|
||||
gcm_ctx_alloc,
|
||||
@ -1097,7 +1097,7 @@ static const mbedtls_cipher_base_t ccm_camellia_info = {
|
||||
NULL,
|
||||
#endif
|
||||
ccm_camellia_setkey_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
ccm_camellia_setkey_wrap,
|
||||
#endif
|
||||
ccm_ctx_alloc,
|
||||
@ -1213,7 +1213,7 @@ static int aria_crypt_ctr_wrap(void *ctx, size_t length, size_t *nc_off,
|
||||
}
|
||||
#endif /* MBEDTLS_CIPHER_MODE_CTR */
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
static int aria_setkey_dec_wrap(void *ctx, const unsigned char *key,
|
||||
unsigned int key_bitlen)
|
||||
{
|
||||
@ -1269,7 +1269,7 @@ static const mbedtls_cipher_base_t aria_info = {
|
||||
NULL,
|
||||
#endif
|
||||
aria_setkey_enc_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
aria_setkey_dec_wrap,
|
||||
#endif
|
||||
aria_ctx_alloc,
|
||||
@ -1444,7 +1444,7 @@ static const mbedtls_cipher_base_t gcm_aria_info = {
|
||||
NULL,
|
||||
#endif
|
||||
gcm_aria_setkey_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
gcm_aria_setkey_wrap,
|
||||
#endif
|
||||
gcm_ctx_alloc,
|
||||
@ -1515,7 +1515,7 @@ static const mbedtls_cipher_base_t ccm_aria_info = {
|
||||
NULL,
|
||||
#endif
|
||||
ccm_aria_setkey_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
ccm_aria_setkey_wrap,
|
||||
#endif
|
||||
ccm_ctx_alloc,
|
||||
@ -1625,7 +1625,7 @@ static int des3_crypt_cbc_wrap(void *ctx, mbedtls_operation_t operation, size_t
|
||||
}
|
||||
#endif /* MBEDTLS_CIPHER_MODE_CBC */
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
static int des_setkey_dec_wrap(void *ctx, const unsigned char *key,
|
||||
unsigned int key_bitlen)
|
||||
{
|
||||
@ -1643,7 +1643,7 @@ static int des_setkey_enc_wrap(void *ctx, const unsigned char *key,
|
||||
return mbedtls_des_setkey_enc((mbedtls_des_context *) ctx, key);
|
||||
}
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
static int des3_set2key_dec_wrap(void *ctx, const unsigned char *key,
|
||||
unsigned int key_bitlen)
|
||||
{
|
||||
@ -1661,7 +1661,7 @@ static int des3_set2key_enc_wrap(void *ctx, const unsigned char *key,
|
||||
return mbedtls_des3_set2key_enc((mbedtls_des3_context *) ctx, key);
|
||||
}
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
static int des3_set3key_dec_wrap(void *ctx, const unsigned char *key,
|
||||
unsigned int key_bitlen)
|
||||
{
|
||||
@ -1740,7 +1740,7 @@ static const mbedtls_cipher_base_t des_info = {
|
||||
NULL,
|
||||
#endif
|
||||
des_setkey_enc_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
des_setkey_dec_wrap,
|
||||
#endif
|
||||
des_ctx_alloc,
|
||||
@ -1793,7 +1793,7 @@ static const mbedtls_cipher_base_t des_ede_info = {
|
||||
NULL,
|
||||
#endif
|
||||
des3_set2key_enc_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
des3_set2key_dec_wrap,
|
||||
#endif
|
||||
des3_ctx_alloc,
|
||||
@ -1846,7 +1846,7 @@ static const mbedtls_cipher_base_t des_ede3_info = {
|
||||
NULL,
|
||||
#endif
|
||||
des3_set3key_enc_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
des3_set3key_dec_wrap,
|
||||
#endif
|
||||
des3_ctx_alloc,
|
||||
@ -1949,7 +1949,7 @@ static const mbedtls_cipher_base_t chacha20_base_info = {
|
||||
chacha20_stream_wrap,
|
||||
#endif
|
||||
chacha20_setkey_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
chacha20_setkey_wrap,
|
||||
#endif
|
||||
chacha20_ctx_alloc,
|
||||
@ -2026,7 +2026,7 @@ static const mbedtls_cipher_base_t chachapoly_base_info = {
|
||||
NULL,
|
||||
#endif
|
||||
chachapoly_setkey_wrap,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
chachapoly_setkey_wrap,
|
||||
#endif
|
||||
chachapoly_ctx_alloc,
|
||||
@ -2096,7 +2096,7 @@ static const mbedtls_cipher_base_t null_base_info = {
|
||||
null_crypt_stream,
|
||||
#endif
|
||||
null_setkey,
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
null_setkey,
|
||||
#endif
|
||||
null_ctx_alloc,
|
||||
|
@ -93,7 +93,7 @@ struct mbedtls_cipher_base_t {
|
||||
int (*setkey_enc_func)(void *ctx, const unsigned char *key,
|
||||
unsigned int key_bitlen);
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
|
||||
#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
|
||||
/** Set key for decryption purposes */
|
||||
int (*setkey_dec_func)(void *ctx, const unsigned char *key,
|
||||
unsigned int key_bitlen);
|
||||
|
Reference in New Issue
Block a user