1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

- Fixed a whole bunch of dependencies on defines between files, examples and tests

This commit is contained in:
Paul Bakker
2011-05-26 13:16:06 +00:00
parent 2c0994e973
commit 5690efccc4
66 changed files with 1408 additions and 701 deletions

View File

@@ -29,8 +29,16 @@
#include <stdio.h>
#include "polarssl/config.h"
#include "polarssl/bignum.h"
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_FS_IO)
int main( void )
{
printf("POLARSSL_BIGNUM_C and/or POLARSSL_FS_IO not defined.\n");
return( 0 );
}
#else
int main( void )
{
mpi E, P, Q, N, H, D, X, Y, Z;
@@ -52,6 +60,7 @@ int main( void )
mpi_write_file( " P = ", &P, 10, NULL );
mpi_write_file( " Q = ", &Q, 10, NULL );
#if defined(POLARSSL_GENPRIME)
mpi_sub_int( &P, &P, 1 );
mpi_sub_int( &Q, &Q, 1 );
mpi_mul_mpi( &H, &P, &Q );
@@ -59,7 +68,9 @@ int main( void )
mpi_write_file( " D = E^-1 mod (P-1)*(Q-1) = ",
&D, 10, NULL );
#else
printf("\nTest skipped (POLARSSL_GENPRIME not defined).\n\n");
#endif
mpi_read_string( &X, 10, "55555" );
mpi_exp_mod( &Y, &X, &E, &N, NULL );
mpi_exp_mod( &Z, &Y, &D, &N, NULL );
@@ -81,3 +92,4 @@ int main( void )
return( 0 );
}
#endif /* POLARSSL_BIGNUM_C && POLARSSL_FS_IO */