mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-06 06:28:56 +01:00
tests: Reformating due to hexcmp() renaming
Command to find the files in which lines have gone
larger than 79 characters due to the renaming:
grep '.\{80\}' \
`git diff-tree --no-commit-id --name-only -r HEAD` \
| grep hexcmp
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
d239794deb
commit
9fde353f68
15 changed files with 185 additions and 76 deletions
|
|
@ -23,7 +23,8 @@ void aes_encrypt_ecb( data_t * key_str, data_t * src_str,
|
|||
{
|
||||
TEST_ASSERT( mbedtls_aes_crypt_ecb( &ctx, MBEDTLS_AES_ENCRYPT, src_str->x, output ) == 0 );
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, 16, hex_dst_string->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x,
|
||||
16, hex_dst_string->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -47,7 +48,8 @@ void aes_decrypt_ecb( data_t * key_str, data_t * src_str,
|
|||
{
|
||||
TEST_ASSERT( mbedtls_aes_crypt_ecb( &ctx, MBEDTLS_AES_DECRYPT, src_str->x, output ) == 0 );
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, 16, hex_dst_string->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x,
|
||||
16, hex_dst_string->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -72,7 +74,9 @@ void aes_encrypt_cbc( data_t * key_str, data_t * iv_str,
|
|||
if( cbc_result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x,
|
||||
src_str->len,
|
||||
hex_dst_string->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -96,7 +100,9 @@ void aes_decrypt_cbc( data_t * key_str, data_t * iv_str,
|
|||
if( cbc_result == 0)
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x,
|
||||
src_str->len,
|
||||
hex_dst_string->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -241,7 +247,8 @@ void aes_encrypt_cfb128( data_t * key_str, data_t * iv_str,
|
|||
mbedtls_aes_setkey_enc( &ctx, key_str->x, key_str->len * 8 );
|
||||
TEST_ASSERT( mbedtls_aes_crypt_cfb128( &ctx, MBEDTLS_AES_ENCRYPT, 16, &iv_offset, iv_str->x, src_str->x, output ) == 0 );
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, 16, hex_dst_string->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x,
|
||||
16, hex_dst_string->len ) == 0 );
|
||||
|
||||
exit:
|
||||
mbedtls_aes_free( &ctx );
|
||||
|
|
@ -263,7 +270,8 @@ void aes_decrypt_cfb128( data_t * key_str, data_t * iv_str,
|
|||
mbedtls_aes_setkey_enc( &ctx, key_str->x, key_str->len * 8 );
|
||||
TEST_ASSERT( mbedtls_aes_crypt_cfb128( &ctx, MBEDTLS_AES_DECRYPT, 16, &iv_offset, iv_str->x, src_str->x, output ) == 0 );
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, 16, hex_dst_string->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x,
|
||||
16, hex_dst_string->len ) == 0 );
|
||||
|
||||
exit:
|
||||
mbedtls_aes_free( &ctx );
|
||||
|
|
@ -284,7 +292,9 @@ void aes_encrypt_cfb8( data_t * key_str, data_t * iv_str,
|
|||
mbedtls_aes_setkey_enc( &ctx, key_str->x, key_str->len * 8 );
|
||||
TEST_ASSERT( mbedtls_aes_crypt_cfb8( &ctx, MBEDTLS_AES_ENCRYPT, src_str->len, iv_str->x, src_str->x, output ) == 0 );
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x,
|
||||
src_str->len,
|
||||
hex_dst_string->len ) == 0 );
|
||||
|
||||
exit:
|
||||
mbedtls_aes_free( &ctx );
|
||||
|
|
@ -305,7 +315,9 @@ void aes_decrypt_cfb8( data_t * key_str, data_t * iv_str,
|
|||
mbedtls_aes_setkey_enc( &ctx, key_str->x, key_str->len * 8 );
|
||||
TEST_ASSERT( mbedtls_aes_crypt_cfb8( &ctx, MBEDTLS_AES_DECRYPT, src_str->len, iv_str->x, src_str->x, output ) == 0 );
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x,
|
||||
src_str->len,
|
||||
hex_dst_string->len ) == 0 );
|
||||
|
||||
exit:
|
||||
mbedtls_aes_free( &ctx );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue