diff options
author | Werner Koch <[email protected]> | 1998-06-16 15:13:28 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1998-06-16 15:13:28 +0000 |
commit | e6ac5acbbf56ed8995bfa4d5a28160fa3a5d825f (patch) | |
tree | 6ff27595e33dd57d3a8979d245236bd5f404c9b4 /mpi/mpicoder.c | |
parent | extensions are now working and fixed a lot of bugs (diff) | |
download | gnupg-e6ac5acbbf56ed8995bfa4d5a28160fa3a5d825f.tar.gz gnupg-e6ac5acbbf56ed8995bfa4d5a28160fa3a5d825f.zip |
some more internall structure changes
Diffstat (limited to 'mpi/mpicoder.c')
-rw-r--r-- | mpi/mpicoder.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mpi/mpicoder.c b/mpi/mpicoder.c index a868923fe..eba82a287 100644 --- a/mpi/mpicoder.c +++ b/mpi/mpicoder.c @@ -210,8 +210,15 @@ mpi_print( FILE *fp, MPI a, int mode ) if( a == MPI_NULL ) return fprintf(fp, "[MPI_NULL]"); - if( !mode ) - n += fprintf(fp, "[%u bits]", mpi_get_nbits(a) ); + if( !mode ) { + unsigned n1, n2; + n1 = mpi_get_nbits(a); + n2 = mpi_get_nbit_info(a); + if( n2 && n2 != n1 ) + n += fprintf(fp, "[%u bits (%u)]", n1, n2 ); + else + n += fprintf(fp, "[%u bits]", n1); + } else { if( a->sign ) putc('-', fp); @@ -278,8 +285,8 @@ do_get_buffer( MPI a, unsigned *nbytes, int *sign, int force_secure ) if( sign ) *sign = a->sign; *nbytes = a->nlimbs * BYTES_PER_MPI_LIMB; - p = buffer = force_secure || a->secure ? m_alloc_secure( *nbytes) - : m_alloc( *nbytes ); + p = buffer = force_secure || mpi_is_secure(a) ? m_alloc_secure( *nbytes) + : m_alloc( *nbytes ); for(i=a->nlimbs-1; i >= 0; i-- ) { alimb = a->d[i]; |