Library files moved to use platform layer
diff --git a/library/ecp.c b/library/ecp.c
index ad6e5f5..2577fa7 100644
--- a/library/ecp.c
+++ b/library/ecp.c
@@ -1,7 +1,7 @@
/*
* Elliptic curves over GF(p): generic functions
*
- * Copyright (C) 2006-2013, Brainspark B.V.
+ * Copyright (C) 2006-2014, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
@@ -50,9 +50,10 @@
#include "polarssl/ecp.h"
-#if defined(POLARSSL_MEMORY_C)
-#include "polarssl/memory.h"
+#if defined(POLARSSL_PLATFORM_C)
+#include "polarssl/platform.h"
#else
+#define polarssl_printf printf
#define polarssl_malloc malloc
#define polarssl_free free
#endif
@@ -1904,7 +1905,7 @@
#endif
if( verbose != 0 )
- printf( " ECP test #1 (constant op_count, base point G): " );
+ polarssl_printf( " ECP test #1 (constant op_count, base point G): " );
/* Do a dummy multiplication first to trigger precomputation */
MPI_CHK( mpi_lset( &m, 2 ) );
@@ -1933,7 +1934,7 @@
mul_count != mul_c_prev )
{
if( verbose != 0 )
- printf( "failed (%u)\n", (unsigned int) i );
+ polarssl_printf( "failed (%u)\n", (unsigned int) i );
ret = 1;
goto cleanup;
@@ -1941,10 +1942,10 @@
}
if( verbose != 0 )
- printf( "passed\n" );
+ polarssl_printf( "passed\n" );
if( verbose != 0 )
- printf( " ECP test #2 (constant op_count, other point): " );
+ polarssl_printf( " ECP test #2 (constant op_count, other point): " );
/* We computed P = 2G last time, use it */
add_count = 0;
@@ -1970,7 +1971,7 @@
mul_count != mul_c_prev )
{
if( verbose != 0 )
- printf( "failed (%u)\n", (unsigned int) i );
+ polarssl_printf( "failed (%u)\n", (unsigned int) i );
ret = 1;
goto cleanup;
@@ -1978,12 +1979,12 @@
}
if( verbose != 0 )
- printf( "passed\n" );
+ polarssl_printf( "passed\n" );
cleanup:
if( ret < 0 && verbose != 0 )
- printf( "Unexpected error, return code = %08X\n", ret );
+ polarssl_printf( "Unexpected error, return code = %08X\n", ret );
ecp_group_free( &grp );
ecp_point_free( &R );
@@ -1991,7 +1992,7 @@
mpi_free( &m );
if( verbose != 0 )
- printf( "\n" );
+ polarssl_printf( "\n" );
return( ret );
}