mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-04 06:40:03 +00:00
Rename ARIA_SELF_TEST_IF_FAIL
Change to ARIA_SELF_TEST_ASSERT Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
059848ff23
commit
9b0eb90131
@ -895,7 +895,7 @@ static const uint8_t aria_test2_ctr_ct[3][48] = // CTR ciphertext
|
|||||||
};
|
};
|
||||||
#endif /* MBEDTLS_CIPHER_MODE_CFB */
|
#endif /* MBEDTLS_CIPHER_MODE_CFB */
|
||||||
|
|
||||||
#define ARIA_SELF_TEST_IF_FAIL( cond ) \
|
#define ARIA_SELF_TEST_ASSERT( cond ) \
|
||||||
do { \
|
do { \
|
||||||
if( cond ) { \
|
if( cond ) { \
|
||||||
if( verbose ) \
|
if( verbose ) \
|
||||||
@ -939,7 +939,7 @@ int mbedtls_aria_self_test( int verbose )
|
|||||||
mbedtls_printf( " ARIA-ECB-%d (enc): ", 128 + 64 * i );
|
mbedtls_printf( " ARIA-ECB-%d (enc): ", 128 + 64 * i );
|
||||||
mbedtls_aria_setkey_enc( &ctx, aria_test1_ecb_key, 128 + 64 * i );
|
mbedtls_aria_setkey_enc( &ctx, aria_test1_ecb_key, 128 + 64 * i );
|
||||||
mbedtls_aria_crypt_ecb( &ctx, aria_test1_ecb_pt, blk );
|
mbedtls_aria_crypt_ecb( &ctx, aria_test1_ecb_pt, blk );
|
||||||
ARIA_SELF_TEST_IF_FAIL(
|
ARIA_SELF_TEST_ASSERT(
|
||||||
memcmp( blk, aria_test1_ecb_ct[i], MBEDTLS_ARIA_BLOCKSIZE )
|
memcmp( blk, aria_test1_ecb_ct[i], MBEDTLS_ARIA_BLOCKSIZE )
|
||||||
!= 0 );
|
!= 0 );
|
||||||
|
|
||||||
@ -948,7 +948,7 @@ int mbedtls_aria_self_test( int verbose )
|
|||||||
mbedtls_printf( " ARIA-ECB-%d (dec): ", 128 + 64 * i );
|
mbedtls_printf( " ARIA-ECB-%d (dec): ", 128 + 64 * i );
|
||||||
mbedtls_aria_setkey_dec( &ctx, aria_test1_ecb_key, 128 + 64 * i );
|
mbedtls_aria_setkey_dec( &ctx, aria_test1_ecb_key, 128 + 64 * i );
|
||||||
mbedtls_aria_crypt_ecb( &ctx, aria_test1_ecb_ct[i], blk );
|
mbedtls_aria_crypt_ecb( &ctx, aria_test1_ecb_ct[i], blk );
|
||||||
ARIA_SELF_TEST_IF_FAIL(
|
ARIA_SELF_TEST_ASSERT(
|
||||||
memcmp( blk, aria_test1_ecb_pt, MBEDTLS_ARIA_BLOCKSIZE )
|
memcmp( blk, aria_test1_ecb_pt, MBEDTLS_ARIA_BLOCKSIZE )
|
||||||
!= 0 );
|
!= 0 );
|
||||||
}
|
}
|
||||||
@ -969,7 +969,7 @@ int mbedtls_aria_self_test( int verbose )
|
|||||||
memset( buf, 0x55, sizeof( buf ) );
|
memset( buf, 0x55, sizeof( buf ) );
|
||||||
mbedtls_aria_crypt_cbc( &ctx, MBEDTLS_ARIA_ENCRYPT, 48, iv,
|
mbedtls_aria_crypt_cbc( &ctx, MBEDTLS_ARIA_ENCRYPT, 48, iv,
|
||||||
aria_test2_pt, buf );
|
aria_test2_pt, buf );
|
||||||
ARIA_SELF_TEST_IF_FAIL( memcmp( buf, aria_test2_cbc_ct[i], 48 )
|
ARIA_SELF_TEST_ASSERT( memcmp( buf, aria_test2_cbc_ct[i], 48 )
|
||||||
!= 0 );
|
!= 0 );
|
||||||
|
|
||||||
/* Test CBC decryption */
|
/* Test CBC decryption */
|
||||||
@ -980,7 +980,7 @@ int mbedtls_aria_self_test( int verbose )
|
|||||||
memset( buf, 0xAA, sizeof( buf ) );
|
memset( buf, 0xAA, sizeof( buf ) );
|
||||||
mbedtls_aria_crypt_cbc( &ctx, MBEDTLS_ARIA_DECRYPT, 48, iv,
|
mbedtls_aria_crypt_cbc( &ctx, MBEDTLS_ARIA_DECRYPT, 48, iv,
|
||||||
aria_test2_cbc_ct[i], buf );
|
aria_test2_cbc_ct[i], buf );
|
||||||
ARIA_SELF_TEST_IF_FAIL( memcmp( buf, aria_test2_pt, 48 ) != 0 );
|
ARIA_SELF_TEST_ASSERT( memcmp( buf, aria_test2_pt, 48 ) != 0 );
|
||||||
}
|
}
|
||||||
if( verbose )
|
if( verbose )
|
||||||
mbedtls_printf( "\n" );
|
mbedtls_printf( "\n" );
|
||||||
@ -999,7 +999,7 @@ int mbedtls_aria_self_test( int verbose )
|
|||||||
j = 0;
|
j = 0;
|
||||||
mbedtls_aria_crypt_cfb128( &ctx, MBEDTLS_ARIA_ENCRYPT, 48, &j, iv,
|
mbedtls_aria_crypt_cfb128( &ctx, MBEDTLS_ARIA_ENCRYPT, 48, &j, iv,
|
||||||
aria_test2_pt, buf );
|
aria_test2_pt, buf );
|
||||||
ARIA_SELF_TEST_IF_FAIL( memcmp( buf, aria_test2_cfb_ct[i], 48 ) != 0 );
|
ARIA_SELF_TEST_ASSERT( memcmp( buf, aria_test2_cfb_ct[i], 48 ) != 0 );
|
||||||
|
|
||||||
/* Test CFB decryption */
|
/* Test CFB decryption */
|
||||||
if( verbose )
|
if( verbose )
|
||||||
@ -1010,7 +1010,7 @@ int mbedtls_aria_self_test( int verbose )
|
|||||||
j = 0;
|
j = 0;
|
||||||
mbedtls_aria_crypt_cfb128( &ctx, MBEDTLS_ARIA_DECRYPT, 48, &j,
|
mbedtls_aria_crypt_cfb128( &ctx, MBEDTLS_ARIA_DECRYPT, 48, &j,
|
||||||
iv, aria_test2_cfb_ct[i], buf );
|
iv, aria_test2_cfb_ct[i], buf );
|
||||||
ARIA_SELF_TEST_IF_FAIL( memcmp( buf, aria_test2_pt, 48 ) != 0 );
|
ARIA_SELF_TEST_ASSERT( memcmp( buf, aria_test2_pt, 48 ) != 0 );
|
||||||
}
|
}
|
||||||
if( verbose )
|
if( verbose )
|
||||||
mbedtls_printf( "\n" );
|
mbedtls_printf( "\n" );
|
||||||
@ -1028,7 +1028,7 @@ int mbedtls_aria_self_test( int verbose )
|
|||||||
j = 0;
|
j = 0;
|
||||||
mbedtls_aria_crypt_ctr( &ctx, 48, &j, iv, blk,
|
mbedtls_aria_crypt_ctr( &ctx, 48, &j, iv, blk,
|
||||||
aria_test2_pt, buf );
|
aria_test2_pt, buf );
|
||||||
ARIA_SELF_TEST_IF_FAIL( memcmp( buf, aria_test2_ctr_ct[i], 48 ) != 0 );
|
ARIA_SELF_TEST_ASSERT( memcmp( buf, aria_test2_ctr_ct[i], 48 ) != 0 );
|
||||||
|
|
||||||
/* Test CTR decryption */
|
/* Test CTR decryption */
|
||||||
if( verbose )
|
if( verbose )
|
||||||
@ -1039,7 +1039,7 @@ int mbedtls_aria_self_test( int verbose )
|
|||||||
j = 0;
|
j = 0;
|
||||||
mbedtls_aria_crypt_ctr( &ctx, 48, &j, iv, blk,
|
mbedtls_aria_crypt_ctr( &ctx, 48, &j, iv, blk,
|
||||||
aria_test2_ctr_ct[i], buf );
|
aria_test2_ctr_ct[i], buf );
|
||||||
ARIA_SELF_TEST_IF_FAIL( memcmp( buf, aria_test2_pt, 48 ) != 0 );
|
ARIA_SELF_TEST_ASSERT( memcmp( buf, aria_test2_pt, 48 ) != 0 );
|
||||||
}
|
}
|
||||||
if( verbose )
|
if( verbose )
|
||||||
mbedtls_printf( "\n" );
|
mbedtls_printf( "\n" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user