mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 08:16:33 +01:00
Adapt cipher tests to configurable padding
This commit is contained in:
parent
b7d24bc7ca
commit
6c9789932e
5 changed files with 247 additions and 241 deletions
|
|
@ -7,7 +7,7 @@ depends_on:POLARSSL_CIPHER_C
|
|||
END_DEPENDENCIES
|
||||
|
||||
BEGIN_CASE
|
||||
enc_dec_buf:cipher_id:cipher_string:key_len:length:
|
||||
enc_dec_buf:cipher_id:cipher_string:key_len:length:pad_mode:
|
||||
size_t length = {length};
|
||||
unsigned char key[32];
|
||||
unsigned char iv[16];
|
||||
|
|
@ -45,6 +45,12 @@ enc_dec_buf:cipher_id:cipher_string:key_len:length:
|
|||
TEST_ASSERT( 0 == cipher_setkey( &ctx_dec, key, {key_len}, POLARSSL_DECRYPT ) );
|
||||
TEST_ASSERT( 0 == cipher_setkey( &ctx_enc, key, {key_len}, POLARSSL_ENCRYPT ) );
|
||||
|
||||
if( -1 != {pad_mode} )
|
||||
{
|
||||
TEST_ASSERT( 0 == cipher_set_padding_mode( &ctx_dec, {pad_mode} ) );
|
||||
TEST_ASSERT( 0 == cipher_set_padding_mode( &ctx_enc, {pad_mode} ) );
|
||||
}
|
||||
|
||||
TEST_ASSERT( 0 == cipher_reset( &ctx_dec, iv ) );
|
||||
TEST_ASSERT( 0 == cipher_reset( &ctx_enc, iv ) );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue