mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
mbedtls: Revert changes to upstream library sources.
This reverts part of commit 0f83831c743801960242525bc19ed15383e091e7.
This commit is contained in:
parent
6f006c25fb
commit
eb47a25012
@ -1237,8 +1237,9 @@ int mbedtls_aes_self_test( int verbose )
|
||||
unsigned char stream_block[16];
|
||||
#endif
|
||||
mbedtls_aes_context ctx;
|
||||
|
||||
memset( key, 0, 32 );
|
||||
|
||||
memset( key, 0, 32 );
|
||||
mbedtls_aes_init( &ctx );
|
||||
|
||||
/*
|
||||
* ECB mode
|
||||
@ -1254,8 +1255,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
|
||||
memset( buf, 0, 16 );
|
||||
|
||||
mbedtls_aes_init( &ctx );
|
||||
|
||||
if( v == MBEDTLS_AES_DECRYPT )
|
||||
{
|
||||
mbedtls_aes_setkey_dec( &ctx, key, 128 + u * 64 );
|
||||
@ -1268,7 +1267,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "failed\n" );
|
||||
|
||||
mbedtls_aes_free( &ctx );
|
||||
ret = 1;
|
||||
goto exit;
|
||||
}
|
||||
@ -1285,8 +1283,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "failed\n" );
|
||||
|
||||
mbedtls_aes_free( &ctx );
|
||||
|
||||
ret = 1;
|
||||
goto exit;
|
||||
}
|
||||
@ -1294,8 +1290,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "passed\n" );
|
||||
|
||||
mbedtls_aes_free( &ctx );
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
@ -1318,8 +1312,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
memset( prv, 0, 16 );
|
||||
memset( buf, 0, 16 );
|
||||
|
||||
mbedtls_aes_init( &ctx );
|
||||
|
||||
if( v == MBEDTLS_AES_DECRYPT )
|
||||
{
|
||||
mbedtls_aes_setkey_dec( &ctx, key, 128 + u * 64 );
|
||||
@ -1332,8 +1324,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "failed\n" );
|
||||
|
||||
mbedtls_aes_free( &ctx );
|
||||
|
||||
ret = 1;
|
||||
goto exit;
|
||||
}
|
||||
@ -1358,8 +1348,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "failed\n" );
|
||||
|
||||
mbedtls_aes_free( &ctx );
|
||||
|
||||
ret = 1;
|
||||
goto exit;
|
||||
}
|
||||
@ -1367,8 +1355,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "passed\n" );
|
||||
|
||||
mbedtls_aes_free( &ctx );
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
@ -1391,8 +1377,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
memcpy( iv, aes_test_cfb128_iv, 16 );
|
||||
memcpy( key, aes_test_cfb128_key[u], 16 + u * 8 );
|
||||
|
||||
mbedtls_aes_init( &ctx );
|
||||
|
||||
offset = 0;
|
||||
mbedtls_aes_setkey_enc( &ctx, key, 128 + u * 64 );
|
||||
|
||||
@ -1449,8 +1433,6 @@ int mbedtls_aes_self_test( int verbose )
|
||||
memcpy( nonce_counter, aes_test_ctr_nonce_counter[u], 16 );
|
||||
memcpy( key, aes_test_ctr_key[u], 16 );
|
||||
|
||||
mbedtls_aes_init( &ctx );
|
||||
|
||||
offset = 0;
|
||||
mbedtls_aes_setkey_enc( &ctx, key, 128 );
|
||||
|
||||
|
@ -396,13 +396,13 @@ int mbedtls_sha1_self_test( int verbose )
|
||||
unsigned char sha1sum[20];
|
||||
mbedtls_sha1_context ctx;
|
||||
|
||||
mbedtls_sha1_init( &ctx );
|
||||
|
||||
/*
|
||||
* SHA-1
|
||||
*/
|
||||
for( i = 0; i < 3; i++ )
|
||||
{
|
||||
mbedtls_sha1_init( &ctx );
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( " SHA-1 test #%d: ", i + 1 );
|
||||
|
||||
@ -426,22 +426,19 @@ int mbedtls_sha1_self_test( int verbose )
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "failed\n" );
|
||||
|
||||
mbedtls_sha1_free( &ctx );
|
||||
|
||||
ret = 1;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "passed\n" );
|
||||
|
||||
mbedtls_sha1_free( &ctx );
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "\n" );
|
||||
|
||||
exit:
|
||||
mbedtls_sha1_free( &ctx );
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
@ -393,13 +393,13 @@ int mbedtls_sha256_self_test( int verbose )
|
||||
unsigned char sha256sum[32];
|
||||
mbedtls_sha256_context ctx;
|
||||
|
||||
mbedtls_sha256_init( &ctx );
|
||||
|
||||
for( i = 0; i < 6; i++ )
|
||||
{
|
||||
j = i % 3;
|
||||
k = i < 3;
|
||||
|
||||
mbedtls_sha256_init( &ctx );
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( " SHA-%d test #%d: ", 256 - k * 32, j + 1 );
|
||||
|
||||
@ -423,22 +423,19 @@ int mbedtls_sha256_self_test( int verbose )
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "failed\n" );
|
||||
|
||||
mbedtls_sha256_free( &ctx );
|
||||
|
||||
ret = 1;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "passed\n" );
|
||||
|
||||
mbedtls_sha256_free( &ctx );
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "\n" );
|
||||
|
||||
exit:
|
||||
mbedtls_sha256_free( &ctx );
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
@ -449,13 +449,13 @@ int mbedtls_sha512_self_test( int verbose )
|
||||
unsigned char sha512sum[64];
|
||||
mbedtls_sha512_context ctx;
|
||||
|
||||
mbedtls_sha512_init( &ctx );
|
||||
|
||||
for( i = 0; i < 6; i++ )
|
||||
{
|
||||
j = i % 3;
|
||||
k = i < 3;
|
||||
|
||||
mbedtls_sha512_init( &ctx );
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( " SHA-%d test #%d: ", 512 - k * 128, j + 1 );
|
||||
|
||||
@ -479,23 +479,19 @@ int mbedtls_sha512_self_test( int verbose )
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "failed\n" );
|
||||
|
||||
mbedtls_sha512_free( &ctx );
|
||||
|
||||
ret = 1;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "passed\n" );
|
||||
|
||||
mbedtls_sha512_free( &ctx );
|
||||
}
|
||||
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "\n" );
|
||||
|
||||
exit:
|
||||
|
||||
mbedtls_sha512_free( &ctx );
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user