summaryrefslogtreecommitdiffhomepage
path: root/libtommath/bn_mp_clear.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2016-03-17 00:06:26 +0800
committerMatt Johnston <matt@ucc.asn.au>2016-03-17 00:06:26 +0800
commitad801851a26b044a364637134304973e2f3b6b9f (patch)
tree1dad8ac41b965469133799dc928b59878a7aec3d /libtommath/bn_mp_clear.c
parentb647b753e005588065f806f9830928a9b53cdcef (diff)
use m_burn for mp_clear
Diffstat (limited to 'libtommath/bn_mp_clear.c')
-rw-r--r--libtommath/bn_mp_clear.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libtommath/bn_mp_clear.c b/libtommath/bn_mp_clear.c
index 000bd06..4b8a10e 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);