decipher works now.

This commit is contained in:
NIIBE Yutaka
2010-09-08 14:24:12 +09:00
parent f543fd5ff1
commit 90a1f0379a
21 changed files with 376 additions and 67 deletions

View File

@@ -310,6 +310,7 @@ cleanup:
return( ret );
}
#if 0
/*
* Helper to write the digits high-order first
*/
@@ -466,6 +467,7 @@ cleanup:
return( ret );
}
#endif
/*
* Import X from unsigned binary data, big endian

View File

@@ -245,13 +245,13 @@ int rsa_private( rsa_context *ctx,
mpi_init( &T, &T1, &T2, NULL );
MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
#if 0
if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
{
mpi_free( &T, NULL );
return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
}
#endif
#if 0
MPI_CHK( mpi_exp_mod( &T, &T, &ctx->D, &ctx->N, &ctx->RN ) );
#else
@@ -358,7 +358,7 @@ int rsa_pkcs1_decrypt( rsa_context *ctx,
{
int ret, ilen;
unsigned char *p;
unsigned char buf[1024];
unsigned char buf[256];
ilen = ctx->len;

View File

@@ -326,6 +326,7 @@ void sha1( const unsigned char *input, int ilen, unsigned char output[20] )
memset( &ctx, 0, sizeof( sha1_context ) );
}
#if 0
/*
* output = SHA-1( file contents )
*/
@@ -357,6 +358,7 @@ int sha1_file( const char *path, unsigned char output[20] )
fclose( f );
return( 0 );
}
#endif
/*
* SHA-1 HMAC context setup