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:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user