Merge pull request #578 from PX4/fix_mp_prime_strong_lucas_lefridge_compilation
[libtommath.git] / s_mp_zero_buf.c
blob23a458dcdfdddb8fe9a3878a4cedbfdbf7ddb0b6
1 #include "tommath_private.h"
2 #ifdef S_MP_ZERO_BUF_C
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
6 #ifdef MP_USE_MEMOPS
7 # include <string.h>
8 #endif
10 void s_mp_zero_buf(void *mem, size_t size)
12 #ifdef MP_USE_MEMOPS
13 memset(mem, 0, size);
14 #else
15 char *m = (char *)mem;
16 while (size-- > 0u) {
17 *m++ = '\0';
19 #endif
22 #endif