# HG changeset patch # User Matt Johnston # Date 1458144386 -28800 # Node ID eebff2079bdc93c5876492ece97151aa0537caf3 # Parent 94d4038bb34c473bf84d0a74fe281bffdcb739cb use m_burn for mp_clear diff -r 94d4038bb34c -r eebff2079bdc libtommath/bn_mp_clear.c --- a/libtommath/bn_mp_clear.c Wed Mar 16 23:39:39 2016 +0800 +++ b/libtommath/bn_mp_clear.c Thu Mar 17 00:06:26 2016 +0800 @@ -1,4 +1,5 @@ #include +#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);