mirror of
https://github.com/clearml/dropbear
synced 2025-02-07 13:21:15 +00:00
use m_burn for mp_clear
This commit is contained in:
parent
b647b753e0
commit
ad801851a2
@ -1,4 +1,5 @@
|
|||||||
#include <tommath.h>
|
#include <tommath.h>
|
||||||
|
#include "dbutil.h"
|
||||||
#ifdef BN_MP_CLEAR_C
|
#ifdef BN_MP_CLEAR_C
|
||||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis
|
/* LibTomMath, multiple-precision integer library -- Tom St Denis
|
||||||
*
|
*
|
||||||
@ -19,17 +20,10 @@
|
|||||||
void
|
void
|
||||||
mp_clear (mp_int * a)
|
mp_clear (mp_int * a)
|
||||||
{
|
{
|
||||||
volatile mp_digit *p;
|
|
||||||
int len;
|
|
||||||
|
|
||||||
/* only do anything if a hasn't been freed previously */
|
/* only do anything if a hasn't been freed previously */
|
||||||
if (a->dp != NULL) {
|
if (a->dp != NULL) {
|
||||||
/* first zero the digits */
|
/* first zero the digits */
|
||||||
len = a->alloc;
|
m_burn(a->dp, a->alloc * sizeof(*a->dp));
|
||||||
p = a->dp;
|
|
||||||
while (len--) {
|
|
||||||
*p++ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* free ram */
|
/* free ram */
|
||||||
XFREE(a->dp);
|
XFREE(a->dp);
|
||||||
|
Loading…
Reference in New Issue
Block a user