summaryrefslogtreecommitdiff
path: root/mpi/mpiutil.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2000-01-24 11:55:48 +0000
committerWerner Koch <wk@gnupg.org>2000-01-24 11:55:48 +0000
commit57eb8c1b9d58df4cc3e026f82244f2928c008e2b (patch)
treebf97f3b0795a1a10de60ae08255e67d9e578b2c5 /mpi/mpiutil.c
parentd5bd6cb82646a4d52870b23d21262c83de77ae47 (diff)
downloadlibgcrypt-57eb8c1b9d58df4cc3e026f82244f2928c008e2b.tar.gz
See ChangeLog: Mon Jan 24 13:04:28 CET 2000 Werner Koch
Diffstat (limited to 'mpi/mpiutil.c')
-rw-r--r--mpi/mpiutil.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c
index 58d06970..2dad135d 100644
--- a/mpi/mpiutil.c
+++ b/mpi/mpiutil.c
@@ -1,5 +1,5 @@
/* mpiutil.ac - Utility functions for MPI
- * Copyright (C) 1998 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 2000 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -41,8 +41,6 @@ mpi_alloc( unsigned nlimbs )
{
MPI a;
- if( DBG_MEMORY )
- log_debug("mpi_alloc(%u)\n", nlimbs*BITS_PER_MPI_LIMB );
a = g10_xmalloc( sizeof *a );
a->d = nlimbs? mpi_alloc_limb_space( nlimbs, 0 ) : NULL;
a->alloced = nlimbs;
@@ -64,8 +62,6 @@ mpi_alloc_secure( unsigned nlimbs )
{
MPI a;
- if( DBG_MEMORY )
- log_debug("mpi_alloc_secure(%u)\n", nlimbs*BITS_PER_MPI_LIMB );
a = g10_xmalloc( sizeof *a );
a->d = nlimbs? mpi_alloc_limb_space( nlimbs, 1 ) : NULL;
a->alloced = nlimbs;
@@ -83,9 +79,6 @@ mpi_alloc_limb_space( unsigned nlimbs, int secure )
size_t len = nlimbs * sizeof(mpi_limb_t);
mpi_ptr_t p;
- if( DBG_MEMORY )
- log_debug("mpi_alloc_limb_space(%u)\n", (unsigned)len*8 );
-
p = secure? g10_xmalloc_secure( len ) : g10_xmalloc( len );
return p;
@@ -96,9 +89,6 @@ mpi_free_limb_space( mpi_ptr_t a )
{
if( !a )
return;
- if( DBG_MEMORY )
- log_debug("mpi_free_limb_space\n" );
-
g10_free(a);
}
@@ -147,8 +137,6 @@ mpi_free( MPI a )
{
if( !a )
return;
- if( DBG_MEMORY )
- log_debug("mpi_free\n" );
if( a->flags & 4 )
g10_free( a->d );
else {
@@ -385,7 +373,7 @@ gcry_mpi_randomize( GCRY_MPI w,
char *p = mpi_is_secure(w) ? gcry_random_bytes( (nbits+7)/8, level )
: gcry_random_bytes_secure( (nbits+7)/8, level );
mpi_set_buffer( w, p, (nbits+7)/8, 0 );
- m_free(p);
+ g10_free(p);
}