summaryrefslogtreecommitdiff
path: root/mpi/mpicoder.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-06-16 15:13:27 +0000
committerWerner Koch <wk@gnupg.org>1998-06-16 15:13:27 +0000
commita436a4553609f4c231f2c4200ad011e109a1a568 (patch)
tree89abc6d0a21e37aae0d40ec87de9ea4d323d29f2 /mpi/mpicoder.c
parent91d9566516ffa468ebd1034f32f927d8864b1998 (diff)
downloadlibgcrypt-a436a4553609f4c231f2c4200ad011e109a1a568.tar.gz
some more internall structure changes
Diffstat (limited to 'mpi/mpicoder.c')
-rw-r--r--mpi/mpicoder.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/mpi/mpicoder.c b/mpi/mpicoder.c
index a868923f..eba82a28 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];