summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arith.c1
-rw-r--r--mpi/mpi.h5
2 files changed, 6 insertions, 0 deletions
diff --git a/arith.c b/arith.c
index 1c3c33ce..5eb022ec 100644
--- a/arith.c
+++ b/arith.c
@@ -62,6 +62,7 @@ static val make_ubignum(void)
{
val n = make_obj();
n->bn.type = BGNUM;
+ mp_init_minimal(&n->bn.mp);
return n;
}
diff --git a/mpi/mpi.h b/mpi/mpi.h
index cd7e823d..aac49019 100644
--- a/mpi/mpi.h
+++ b/mpi/mpi.h
@@ -85,6 +85,11 @@ void mp_set_prec(unsigned int prec);
/* Memory management */
mp_err mp_init(mp_int *mp);
+INLINE mp_err mp_init_minimal(mp_int *mp)
+{
+ DIGITS(mp) = 0;
+ return MP_OKAY;
+}
mp_err mp_init_array(mp_int mp[], int count);
mp_err mp_init_size(mp_int *mp, mp_size prec);
mp_err mp_init_copy(mp_int *mp, mp_int *from);