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

Make CBC an option, step 3: individual ciphers

This commit is contained in:
Manuel Pégourié-Gonnard
2013-09-13 16:24:20 +02:00
parent 989ed38de2
commit 92cb1d3a91
21 changed files with 162 additions and 46 deletions

View File

@ -769,6 +769,7 @@ int aes_crypt_ecb( aes_context *ctx,
return( 0 );
}
#if defined(POLARSSL_CIPHER_MODE_CBC)
/*
* AES-CBC buffer encryption/decryption
*/
@ -832,6 +833,7 @@ int aes_crypt_cbc( aes_context *ctx,
return( 0 );
}
#endif /* POLARSSL_CIPHER_MODE_CBC */
#if defined(POLARSSL_CIPHER_MODE_CFB)
/*
@ -947,6 +949,7 @@ static const unsigned char aes_test_ecb_enc[3][16] =
0xFF, 0x30, 0xB4, 0xEA, 0x21, 0x63, 0x6D, 0xA4 }
};
#if defined(POLARSSL_CIPHER_MODE_CBC)
static const unsigned char aes_test_cbc_dec[3][16] =
{
{ 0xFA, 0xCA, 0x37, 0xE0, 0xB0, 0xC8, 0x53, 0x73,
@ -966,6 +969,7 @@ static const unsigned char aes_test_cbc_enc[3][16] =
{ 0xFE, 0x3C, 0x53, 0x65, 0x3E, 0x2F, 0x45, 0xB5,
0x6F, 0xCD, 0x88, 0xB2, 0xCC, 0x89, 0x8F, 0xF0 }
};
#endif /* POLARSSL_CIPHER_MODE_CBC */
#if defined(POLARSSL_CIPHER_MODE_CFB)
/*
@ -1104,8 +1108,10 @@ int aes_self_test( int verbose )
int i, j, u, v;
unsigned char key[32];
unsigned char buf[64];
unsigned char prv[16];
unsigned char iv[16];
#if defined(POLARSSL_CIPHER_MODE_CBC)
unsigned char prv[16];
#endif
#if defined(POLARSSL_CIPHER_MODE_CTR) || defined(POLARSSL_CIPHER_MODE_CFB)
size_t offset;
#endif
@ -1170,6 +1176,7 @@ int aes_self_test( int verbose )
if( verbose != 0 )
printf( "\n" );
#if defined(POLARSSL_CIPHER_MODE_CBC)
/*
* CBC mode
*/
@ -1231,6 +1238,7 @@ int aes_self_test( int verbose )
if( verbose != 0 )
printf( "\n" );
#endif /* POLARSSL_CIPHER_MODE_CBC */
#if defined(POLARSSL_CIPHER_MODE_CFB)
/*