mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 11:45:42 +01:00
Changed mbedtls_platform_memset/cpy/cmp in selftest functions back to original methods
This commit is contained in:
parent
6f4e030166
commit
d49d2b6d4f
@ -1846,7 +1846,7 @@ int mbedtls_aes_self_test( int verbose )
|
||||
#endif
|
||||
mbedtls_aes_context ctx;
|
||||
|
||||
mbedtls_platform_memset( key, 0, 32 );
|
||||
memset( key, 0, 32 );
|
||||
mbedtls_aes_init( &ctx );
|
||||
|
||||
/*
|
||||
@ -1878,7 +1878,7 @@ int mbedtls_aes_self_test( int verbose )
|
||||
}
|
||||
#endif /* MBEDTLS_AES_ONLY_ENCRYPT */
|
||||
|
||||
mbedtls_platform_memset( buf, 0, 16 );
|
||||
memset( buf, 0, 16 );
|
||||
|
||||
if( mode == MBEDTLS_AES_DECRYPT )
|
||||
{
|
||||
@ -1956,9 +1956,9 @@ int mbedtls_aes_self_test( int verbose )
|
||||
}
|
||||
#endif /* MBEDTLS_AES_ONLY_ENCRYPT */
|
||||
|
||||
mbedtls_platform_memset( iv , 0, 16 );
|
||||
mbedtls_platform_memset( prv, 0, 16 );
|
||||
mbedtls_platform_memset( buf, 0, 16 );
|
||||
memset( iv , 0, 16 );
|
||||
memset( prv, 0, 16 );
|
||||
memset( buf, 0, 16 );
|
||||
|
||||
if( mode == MBEDTLS_AES_DECRYPT )
|
||||
{
|
||||
@ -2272,8 +2272,8 @@ int mbedtls_aes_self_test( int verbose )
|
||||
}
|
||||
#endif /* MBEDTLS_AES_ONLY_ENCRYPT */
|
||||
|
||||
mbedtls_platform_memset( key, 0, sizeof( key ) );
|
||||
mbedtls_platform_memcpy( key, aes_test_xts_key[u], 32 );
|
||||
memset( key, 0, sizeof( key ) );
|
||||
memcpy( key, aes_test_xts_key[u], 32 );
|
||||
data_unit = aes_test_xts_data_unit[u];
|
||||
|
||||
len = sizeof( *aes_test_xts_ct32 );
|
||||
|
@ -1047,8 +1047,8 @@ int mbedtls_aria_self_test( int verbose )
|
||||
if( verbose )
|
||||
mbedtls_printf( " ARIA-CTR-%d (enc): ", 128 + 64 * i );
|
||||
mbedtls_aria_setkey_enc( &ctx, aria_test2_key, 128 + 64 * i );
|
||||
mbedtls_platform_memset( iv, 0, MBEDTLS_ARIA_BLOCKSIZE ); // IV = 0
|
||||
mbedtls_platform_memset( buf, 0x55, sizeof( buf ) );
|
||||
memset( iv, 0, MBEDTLS_ARIA_BLOCKSIZE ); // IV = 0
|
||||
memset( buf, 0x55, sizeof( buf ) );
|
||||
j = 0;
|
||||
mbedtls_aria_crypt_ctr( &ctx, 48, &j, iv, blk,
|
||||
aria_test2_pt, buf );
|
||||
@ -1059,8 +1059,8 @@ int mbedtls_aria_self_test( int verbose )
|
||||
if( verbose )
|
||||
mbedtls_printf( " ARIA-CTR-%d (dec): ", 128 + 64 * i );
|
||||
mbedtls_aria_setkey_enc( &ctx, aria_test2_key, 128 + 64 * i );
|
||||
mbedtls_platform_memset( iv, 0, MBEDTLS_ARIA_BLOCKSIZE ); // IV = 0
|
||||
mbedtls_platform_memset( buf, 0xAA, sizeof( buf ) );
|
||||
memset( iv, 0, MBEDTLS_ARIA_BLOCKSIZE ); // IV = 0
|
||||
memset( buf, 0xAA, sizeof( buf ) );
|
||||
j = 0;
|
||||
mbedtls_aria_crypt_ctr( &ctx, 48, &j, iv, blk,
|
||||
aria_test2_ctr_ct[i], buf );
|
||||
|
@ -951,7 +951,7 @@ int mbedtls_camellia_self_test( int verbose )
|
||||
|
||||
mbedtls_camellia_context ctx;
|
||||
|
||||
mbedtls_platform_memset( key, 0, 32 );
|
||||
memset( key, 0, 32 );
|
||||
|
||||
for( j = 0; j < 6; j++ ) {
|
||||
u = j >> 1;
|
||||
|
@ -512,7 +512,7 @@ int mbedtls_ccm_self_test( int verbose )
|
||||
|
||||
return( 1 );
|
||||
}
|
||||
mbedtls_platform_memset( plaintext, 0, CCM_SELFTEST_PT_MAX_LEN );
|
||||
memset( plaintext, 0, CCM_SELFTEST_PT_MAX_LEN );
|
||||
|
||||
ret = mbedtls_ccm_auth_decrypt( &ctx, msg_len[i],
|
||||
iv, iv_len[i], ad, add_len[i],
|
||||
|
@ -1104,7 +1104,7 @@ int mbedtls_ecjpake_self_test( int verbose )
|
||||
TEST_ASSERT( len == sizeof( ecjpake_test_pms ) );
|
||||
TEST_ASSERT( memcmp( buf, ecjpake_test_pms, len ) == 0 );
|
||||
|
||||
mbedtls_platform_memset( buf, 0, len ); /* Avoid interferences with next step */
|
||||
memset( buf, 0, len ); /* Avoid interferences with next step */
|
||||
|
||||
/* Client derives PMS */
|
||||
TEST_ASSERT( mbedtls_ecjpake_derive_secret( &cli,
|
||||
|
@ -520,7 +520,7 @@ int mbedtls_ripemd160_self_test( int verbose )
|
||||
int i, ret = 0;
|
||||
unsigned char output[20];
|
||||
|
||||
mbedtls_platform_memset( output, 0, sizeof output );
|
||||
memset( output, 0, sizeof output );
|
||||
|
||||
for( i = 0; i < TESTS; i++ )
|
||||
{
|
||||
|
@ -523,7 +523,7 @@ int mbedtls_sha1_self_test( int verbose )
|
||||
|
||||
if( i == 2 )
|
||||
{
|
||||
mbedtls_platform_memset( buf, 'a', buflen = 1000 );
|
||||
memset( buf, 'a', buflen = 1000 );
|
||||
|
||||
for( j = 0; j < 1000; j++ )
|
||||
{
|
||||
|
@ -527,7 +527,7 @@ int mbedtls_sha256_self_test( int verbose )
|
||||
|
||||
if( j == 2 )
|
||||
{
|
||||
mbedtls_platform_memset( buf, 'a', buflen = 1000 );
|
||||
memset( buf, 'a', buflen = 1000 );
|
||||
|
||||
for( j = 0; j < 1000; j++ )
|
||||
{
|
||||
|
@ -585,7 +585,7 @@ int mbedtls_sha512_self_test( int verbose )
|
||||
|
||||
if( j == 2 )
|
||||
{
|
||||
mbedtls_platform_memset( buf, 'a', buflen = 1000 );
|
||||
memset( buf, 'a', buflen = 1000 );
|
||||
|
||||
for( j = 0; j < 1000; j++ )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user