aboutsummaryrefslogtreecommitdiffstats
path: root/mpi/mpiutil.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-07-06 10:23:57 +0000
committerWerner Koch <[email protected]>1998-07-06 10:23:57 +0000
commita9ec668cbe5b3335f5db0f05b8e9e88e29ada52c (patch)
treee159c79b615fcdcb65f31ee5d1d0a2b1ba84e9aa /mpi/mpiutil.c
parentpartly added creation of OP partial length headers (diff)
downloadgnupg-a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c.tar.gz
gnupg-a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c.zip
intermediate release
Diffstat (limited to '')
-rw-r--r--mpi/mpiutil.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c
index 231e5d578..c9af50561 100644
--- a/mpi/mpiutil.c
+++ b/mpi/mpiutil.c
@@ -94,7 +94,7 @@ mpi_alloc_secure( unsigned nlimbs )
a->d = nlimbs? mpi_alloc_limb_space( nlimbs, 1 ) : NULL;
#endif
a->alloced = nlimbs;
- a->flags |= 1;
+ a->flags = 1;
a->nlimbs = 0;
a->sign = 0;
a->nbits = 0;
@@ -178,6 +178,7 @@ mpi_clear( MPI a )
{
a->nlimbs = 0;
a->nbits = 0;
+ a->flags = 0;
}
@@ -197,7 +198,8 @@ mpi_free( MPI a )
#else
mpi_free_limb_space(a->d);
#endif
-
+ if( a->flags & ~3 )
+ log_bug("invalid flag value in mpi\n");
m_free(a);
}
@@ -231,7 +233,7 @@ mpi_set_secure( MPI a )
/****************
- * Note: This copy function shpould not interpret the MPI
+ * Note: This copy function should not interpret the MPI
* but copy it transparently.
*/
MPI
@@ -278,6 +280,7 @@ mpi_set( MPI w, MPI u)
MPN_COPY( wp, up, usize );
w->nlimbs = usize;
w->nbits = u->nbits;
+ w->flags = u->flags;
w->sign = usign;
}
@@ -290,6 +293,7 @@ mpi_set_ui( MPI w, unsigned long u)
w->nlimbs = u? 1:0;
w->sign = 0;
w->nbits = 0;
+ w->flags = 0;
}