libtommath/bn_mp_zero.c
Daniel Mendler 61d9e528a4
hardening: add MP_ZERO_BUFFER, MP_ZERO_DIGITS
* (!) Always zero buffer before freeing if MP_NO_ZERO_ON_FREE is not defined
* Add MP_NO_ZERO_ON_FREE to disable hardening
* Add MP_ZERO_BUFFER, MP_ZERO_DIGITS, MP_FREE_BUFFFER, MP_FREE_DIGITS
* Never use MP_FREE directly, use MP_FREE_DIGITS or MP_FREE_BUFFER
* Add MP_USE_MEMSET to use memset instead of loop
* Disable astyle backups which are annonying in the times of git
2019-05-12 01:01:03 +02:00

14 lines
287 B
C

#include "tommath_private.h"
#ifdef BN_MP_ZERO_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */
/* set to zero */
void mp_zero(mp_int *a)
{
a->sign = MP_ZPOS;
a->used = 0;
MP_ZERO_DIGITS(a->dp, a->alloc);
}
#endif