Library files moved to use platform layer
diff --git a/library/camellia.c b/library/camellia.c
index 2366cae..f007a46 100644
--- a/library/camellia.c
+++ b/library/camellia.c
@@ -1,7 +1,7 @@
/*
* Camellia implementation
*
- * 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>
@@ -35,6 +35,12 @@
#include "polarssl/camellia.h"
+#if defined(POLARSSL_PLATFORM_C)
+#include "polarssl/platform.h"
+#else
+#define polarssl_printf printf
+#endif
+
#if !defined(POLARSSL_CAMELLIA_ALT)
/*
@@ -889,8 +895,8 @@
v = j & 1;
if( verbose != 0 )
- printf( " CAMELLIA-ECB-%3d (%s): ", 128 + u * 64,
- (v == CAMELLIA_DECRYPT) ? "dec" : "enc");
+ polarssl_printf( " CAMELLIA-ECB-%3d (%s): ", 128 + u * 64,
+ (v == CAMELLIA_DECRYPT) ? "dec" : "enc");
for (i = 0; i < CAMELLIA_TESTS_ECB; i++ ) {
memcpy( key, camellia_test_ecb_key[u][i], 16 + 8 * u);
@@ -910,18 +916,18 @@
if( memcmp( buf, dst, 16 ) != 0 )
{
if( verbose != 0 )
- printf( "failed\n" );
+ polarssl_printf( "failed\n" );
return( 1 );
}
}
if( verbose != 0 )
- printf( "passed\n" );
+ polarssl_printf( "passed\n" );
}
if( verbose != 0 )
- printf( "\n" );
+ polarssl_printf( "\n" );
#if defined(POLARSSL_CIPHER_MODE_CBC)
/*
@@ -933,8 +939,8 @@
v = j & 1;
if( verbose != 0 )
- printf( " CAMELLIA-CBC-%3d (%s): ", 128 + u * 64,
- ( v == CAMELLIA_DECRYPT ) ? "dec" : "enc" );
+ polarssl_printf( " CAMELLIA-CBC-%3d (%s): ", 128 + u * 64,
+ ( v == CAMELLIA_DECRYPT ) ? "dec" : "enc" );
memcpy( src, camellia_test_cbc_iv, 16);
memcpy( dst, camellia_test_cbc_iv, 16);
@@ -963,19 +969,19 @@
if( memcmp( buf, dst, 16 ) != 0 )
{
if( verbose != 0 )
- printf( "failed\n" );
+ polarssl_printf( "failed\n" );
return( 1 );
}
}
if( verbose != 0 )
- printf( "passed\n" );
+ polarssl_printf( "passed\n" );
}
#endif /* POLARSSL_CIPHER_MODE_CBC */
if( verbose != 0 )
- printf( "\n" );
+ polarssl_printf( "\n" );
#if defined(POLARSSL_CIPHER_MODE_CTR)
/*
@@ -987,8 +993,8 @@
v = i & 1;
if( verbose != 0 )
- printf( " CAMELLIA-CTR-128 (%s): ",
- ( v == CAMELLIA_DECRYPT ) ? "dec" : "enc" );
+ polarssl_printf( " CAMELLIA-CTR-128 (%s): ",
+ ( v == CAMELLIA_DECRYPT ) ? "dec" : "enc" );
memcpy( nonce_counter, camellia_test_ctr_nonce_counter[u], 16 );
memcpy( key, camellia_test_ctr_key[u], 16 );
@@ -1006,7 +1012,7 @@
if( memcmp( buf, camellia_test_ctr_pt[u], len ) != 0 )
{
if( verbose != 0 )
- printf( "failed\n" );
+ polarssl_printf( "failed\n" );
return( 1 );
}
@@ -1021,18 +1027,18 @@
if( memcmp( buf, camellia_test_ctr_ct[u], len ) != 0 )
{
if( verbose != 0 )
- printf( "failed\n" );
+ polarssl_printf( "failed\n" );
return( 1 );
}
}
if( verbose != 0 )
- printf( "passed\n" );
+ polarssl_printf( "passed\n" );
}
if( verbose != 0 )
- printf( "\n" );
+ polarssl_printf( "\n" );
#endif /* POLARSSL_CIPHER_MODE_CTR */
return ( 0 );