]> pd.if.org Git - zpackage/blob - libtomcrypt/src/misc/zeromem.c
commit files needed for zpm-fetchurl
[zpackage] / libtomcrypt / src / misc / zeromem.c
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2  *
3  * LibTomCrypt is a library that provides various cryptographic
4  * algorithms in a highly modular and flexible manner.
5  *
6  * The library is free for all purposes without any express
7  * guarantee it works.
8  */
9 #include "tomcrypt.h"
10
11 /**
12    @file zeromem.c
13    Zero a block of memory, Tom St Denis
14 */
15
16 /**
17    Zero a block of memory
18    @param out    The destination of the area to zero
19    @param outlen The length of the area to zero (octets)
20 */
21 void zeromem(volatile void *out, size_t outlen)
22 {
23    volatile char *mem = out;
24    LTC_ARGCHKVD(out != NULL);
25    while (outlen-- > 0) {
26       *mem++ = '\0';
27    }
28 }
29
30 /* ref:         $Format:%D$ */
31 /* git commit:  $Format:%H$ */
32 /* commit time: $Format:%ai$ */