]> pd.if.org Git - zpackage/blob - libtomcrypt/src/misc/burn_stack.c
commit files needed for zpm-fetchurl
[zpackage] / libtomcrypt / src / misc / burn_stack.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 burn_stack.c
13    Burn stack, Tom St Denis
14 */
15
16 /**
17    Burn some stack memory
18    @param len amount of stack to burn in bytes
19 */
20 void burn_stack(unsigned long len)
21 {
22    unsigned char buf[32];
23    zeromem(buf, sizeof(buf));
24    if (len > (unsigned long)sizeof(buf))
25       burn_stack(len - sizeof(buf));
26 }
27
28
29
30 /* ref:         $Format:%D$ */
31 /* git commit:  $Format:%H$ */
32 /* commit time: $Format:%ai$ */