The Great Renaming
A simple execution of tmp/invoke-rename.pl
diff --git a/tests/suites/test_suite_entropy.function b/tests/suites/test_suite_entropy.function
index 41a115c..83584e1 100644
--- a/tests/suites/test_suite_entropy.function
+++ b/tests/suites/test_suite_entropy.function
@@ -24,7 +24,7 @@
int *d = (int *) data;
if( *d < 0 )
- return( POLARSSL_ERR_ENTROPY_SOURCE_FAILED );
+ return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
else
*olen = *d;
}
@@ -36,64 +36,64 @@
/* END_HEADER */
/* BEGIN_DEPENDENCIES
- * depends_on:POLARSSL_ENTROPY_C
+ * depends_on:MBEDTLS_ENTROPY_C
* END_DEPENDENCIES
*/
-/* BEGIN_CASE depends_on:POLARSSL_FS_IO */
+/* BEGIN_CASE depends_on:MBEDTLS_FS_IO */
void entropy_seed_file( char *path, int ret )
{
- entropy_context ctx;
+ mbedtls_entropy_context ctx;
- entropy_init( &ctx );
+ mbedtls_entropy_init( &ctx );
- TEST_ASSERT( entropy_write_seed_file( &ctx, path ) == ret );
- TEST_ASSERT( entropy_update_seed_file( &ctx, path ) == ret );
+ TEST_ASSERT( mbedtls_entropy_write_seed_file( &ctx, path ) == ret );
+ TEST_ASSERT( mbedtls_entropy_update_seed_file( &ctx, path ) == ret );
exit:
- entropy_free( &ctx );
+ mbedtls_entropy_free( &ctx );
}
/* END_CASE */
/* BEGIN_CASE */
void entropy_too_many_sources( )
{
- entropy_context ctx;
+ mbedtls_entropy_context ctx;
size_t i;
- entropy_init( &ctx );
+ mbedtls_entropy_init( &ctx );
/*
* It's hard to tell precisely when the error will occur,
* since we don't know how many sources were automatically added.
*/
- for( i = 0; i < ENTROPY_MAX_SOURCES; i++ )
- (void) entropy_add_source( &ctx, entropy_dummy_source, NULL, 16 );
+ for( i = 0; i < MBEDTLS_ENTROPY_MAX_SOURCES; i++ )
+ (void) mbedtls_entropy_add_source( &ctx, entropy_dummy_source, NULL, 16 );
- TEST_ASSERT( entropy_add_source( &ctx, entropy_dummy_source, NULL, 16 )
- == POLARSSL_ERR_ENTROPY_MAX_SOURCES );
+ TEST_ASSERT( mbedtls_entropy_add_source( &ctx, entropy_dummy_source, NULL, 16 )
+ == MBEDTLS_ERR_ENTROPY_MAX_SOURCES );
exit:
- entropy_free( &ctx );
+ mbedtls_entropy_free( &ctx );
}
/* END_CASE */
/* BEGIN_CASE */
void entropy_func_len( int len, int ret )
{
- entropy_context ctx;
- unsigned char buf[ENTROPY_BLOCK_SIZE + 10] = { 0 };
- unsigned char acc[ENTROPY_BLOCK_SIZE + 10] = { 0 };
+ mbedtls_entropy_context ctx;
+ unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE + 10] = { 0 };
+ unsigned char acc[MBEDTLS_ENTROPY_BLOCK_SIZE + 10] = { 0 };
size_t i, j;
- entropy_init( &ctx );
+ mbedtls_entropy_init( &ctx );
/*
- * See comments in entropy_self_test()
+ * See comments in mbedtls_entropy_self_test()
*/
for( i = 0; i < 8; i++ )
{
- TEST_ASSERT( entropy_func( &ctx, buf, len ) == ret );
+ TEST_ASSERT( mbedtls_entropy_func( &ctx, buf, len ) == ret );
for( j = 0; j < sizeof( buf ); j++ )
acc[j] |= buf[j];
}
@@ -110,47 +110,47 @@
/* BEGIN_CASE */
void entropy_source_fail( char *path )
{
- entropy_context ctx;
+ mbedtls_entropy_context ctx;
int fail = -1;
unsigned char buf[16];
- entropy_init( &ctx );
+ mbedtls_entropy_init( &ctx );
- TEST_ASSERT( entropy_add_source( &ctx, entropy_dummy_source, &fail, 16 )
+ TEST_ASSERT( mbedtls_entropy_add_source( &ctx, entropy_dummy_source, &fail, 16 )
== 0 );
- TEST_ASSERT( entropy_func( &ctx, buf, sizeof( buf ) )
- == POLARSSL_ERR_ENTROPY_SOURCE_FAILED );
- TEST_ASSERT( entropy_gather( &ctx )
- == POLARSSL_ERR_ENTROPY_SOURCE_FAILED );
-#if defined(POLARSSL_FS_IO)
- TEST_ASSERT( entropy_write_seed_file( &ctx, path )
- == POLARSSL_ERR_ENTROPY_SOURCE_FAILED );
- TEST_ASSERT( entropy_update_seed_file( &ctx, path )
- == POLARSSL_ERR_ENTROPY_SOURCE_FAILED );
+ TEST_ASSERT( mbedtls_entropy_func( &ctx, buf, sizeof( buf ) )
+ == MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
+ TEST_ASSERT( mbedtls_entropy_gather( &ctx )
+ == MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
+#if defined(MBEDTLS_FS_IO)
+ TEST_ASSERT( mbedtls_entropy_write_seed_file( &ctx, path )
+ == MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
+ TEST_ASSERT( mbedtls_entropy_update_seed_file( &ctx, path )
+ == MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
#else
((void) path);
#endif
exit:
- entropy_free( &ctx );
+ mbedtls_entropy_free( &ctx );
}
/* END_CASE */
/* BEGIN_CASE */
void entropy_threshold( int threshold, int chunk_size, int result )
{
- entropy_context ctx;
- unsigned char buf[ENTROPY_BLOCK_SIZE] = { 0 };
+ mbedtls_entropy_context ctx;
+ unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 };
int ret;
- entropy_init( &ctx );
+ mbedtls_entropy_init( &ctx );
- TEST_ASSERT( entropy_add_source( &ctx, entropy_dummy_source,
+ TEST_ASSERT( mbedtls_entropy_add_source( &ctx, entropy_dummy_source,
&chunk_size, threshold ) == 0 );
entropy_dummy_calls = 0;
- ret = entropy_func( &ctx, buf, sizeof( buf ) );
+ ret = mbedtls_entropy_func( &ctx, buf, sizeof( buf ) );
if( result >= 0 )
{
@@ -163,13 +163,13 @@
}
exit:
- entropy_free( &ctx );
+ mbedtls_entropy_free( &ctx );
}
/* END_CASE */
-/* BEGIN_CASE depends_on:POLARSSL_SELF_TEST */
+/* BEGIN_CASE depends_on:MBEDTLS_SELF_TEST */
void entropy_selftest( )
{
- TEST_ASSERT( entropy_self_test( 0 ) == 0 );
+ TEST_ASSERT( mbedtls_entropy_self_test( 0 ) == 0 );
}
/* END_CASE */