From ad801851a26b044a364637134304973e2f3b6b9f Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Thu, 17 Mar 2016 00:06:26 +0800
Subject: [PATCH] use m_burn for mp_clear

---
 libtommath/bn_mp_clear.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libtommath/bn_mp_clear.c b/libtommath/bn_mp_clear.c
index 000bd065..4b8a10e8 100644
--- a/libtommath/bn_mp_clear.c
+++ b/libtommath/bn_mp_clear.c
@@ -1,4 +1,5 @@
 #include <tommath.h>
+#include "dbutil.h"
 #ifdef BN_MP_CLEAR_C
 /* LibTomMath, multiple-precision integer library -- Tom St Denis
  *
@@ -19,17 +20,10 @@
 void
 mp_clear (mp_int * a)
 {
-  volatile mp_digit *p;
-  int len;
-
   /* only do anything if a hasn't been freed previously */
   if (a->dp != NULL) {
     /* first zero the digits */
-	len = a->alloc;
-	p = a->dp;
-	while (len--) {
-		*p++ = 0;
-	}
+	m_burn(a->dp, a->alloc * sizeof(*a->dp));
 
     /* free ram */
     XFREE(a->dp);
-- 
GitLab