diff options
Diffstat (limited to 'utils/tomcrypt/src/misc/zeromem.c')
-rw-r--r-- | utils/tomcrypt/src/misc/zeromem.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/utils/tomcrypt/src/misc/zeromem.c b/utils/tomcrypt/src/misc/zeromem.c new file mode 100644 index 0000000000..dc81d9b1e2 --- /dev/null +++ b/utils/tomcrypt/src/misc/zeromem.c | |||
@@ -0,0 +1,32 @@ | |||
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: HEAD -> master, tag: v1.18.2 */ | ||
31 | /* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */ | ||
32 | /* commit time: 2018-07-01 22:49:01 +0200 */ | ||