Mercurial > dropbear
annotate src/misc/burn_stack.c @ 209:39d5d58461d6 libtomcrypt-orig LTC_1.05
Import of libtomcrypt 1.05
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 06 Jul 2005 03:53:40 +0000 |
parents | 1c15b283127b |
children |
rev | line source |
---|---|
191
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
2 * |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
3 * LibTomCrypt is a library that provides various cryptographic |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
4 * algorithms in a highly modular and flexible manner. |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
5 * |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
6 * The library is free for all purposes without any express |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
7 * guarantee it works. |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
8 * |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
9 * Tom St Denis, [email protected], http://libtomcrypt.org |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
10 */ |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
11 #include "tomcrypt.h" |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
12 |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
13 /** |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
14 @file burn_stack.c |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
15 Burn stack, Tom St Denis |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
16 */ |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
17 |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
18 /** |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
19 Burn some stack memory |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
20 @param len amount of stack to burn in bytes |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
21 */ |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
22 void burn_stack(unsigned long len) |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
23 { |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
24 unsigned char buf[32]; |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
25 zeromem(buf, sizeof(buf)); |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
26 if (len > (unsigned long)sizeof(buf)) |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
27 burn_stack(len - sizeof(buf)); |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
28 } |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
29 |
1c15b283127b
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
30 |
209 | 31 |
32 /* $Source: /cvs/libtom/libtomcrypt/src/misc/burn_stack.c,v $ */ | |
33 /* $Revision: 1.3 $ */ | |
34 /* $Date: 2005/05/05 14:35:59 $ */ |