* http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
*/
-/* $Cambridge: exim/src/src/pdkim/rsa.c,v 1.3 2009/12/07 13:05:07 tom Exp $ */
-
#include "rsa.h"
#include "base64.h"
#include <string.h>
#include <stdio.h>
-
-
/* *************** begin copy from x509parse.c ********************/
/*
* ASN.1 DER decoding routines
do
{
- MPI_CHK( mpi_gen_prime( &ctx->P, ( nbits + 1 ) >> 1, 0,
+ MPI_CHK( mpi_gen_prime( &ctx->P, ( nbits + 1 ) >> 1, 0,
f_rng, p_rng ) );
MPI_CHK( mpi_gen_prime( &ctx->Q, ( nbits + 1 ) >> 1, 0,
return( POLARSSL_ERR_RSA_KEY_GEN_FAILED | ret );
}
- return( 0 );
+ return( 0 );
}
#endif
MPI_CHK( mpi_gcd( &G, &ctx->E, &H ) );
MPI_CHK( mpi_gcd( &G2, &P1, &Q1 ) );
- MPI_CHK( mpi_div_mpi( &L1, &L2, &H, &G2 ) );
+ MPI_CHK( mpi_div_mpi( &L1, &L2, &H, &G2 ) );
MPI_CHK( mpi_mod_mpi( &I, &DE, &L1 ) );
/*
return( 0 );
}
-
+
cleanup:
mpi_free( &G, &I, &H, &Q1, &P1, &DE, &PQ, &G2, &L1, &L2, NULL );