comparison libtomcrypt/src/misc/zeromem.c @ 1283:3017bc7d6238

move m_burn and function attributes to dbhelpers use m_burn for libtomcrypt zeromem() too
author Matt Johnston <matt@ucc.asn.au>
date Thu, 17 Mar 2016 23:21:33 +0800
parents 0cbe8f6dbf9e
children f849a5ca2efc
comparison
equal deleted inserted replaced
1282:a3bb15115816 1283:3017bc7d6238
7 * guarantee it works. 7 * guarantee it works.
8 * 8 *
9 * Tom St Denis, [email protected], http://libtomcrypt.com 9 * Tom St Denis, [email protected], http://libtomcrypt.com
10 */ 10 */
11 #include "tomcrypt.h" 11 #include "tomcrypt.h"
12 #include "dbhelpers.h"
12 13
13 /** 14 /**
14 @file zeromem.c 15 @file zeromem.c
15 Zero a block of memory, Tom St Denis 16 Zero a block of memory, Tom St Denis
16 */ 17 */
20 @param out The destination of the area to zero 21 @param out The destination of the area to zero
21 @param outlen The length of the area to zero (octets) 22 @param outlen The length of the area to zero (octets)
22 */ 23 */
23 void zeromem(void *out, size_t outlen) 24 void zeromem(void *out, size_t outlen)
24 { 25 {
25 unsigned char *mem = out; 26 m_burn(out, outlen);
26 LTC_ARGCHKVD(out != NULL);
27 while (outlen-- > 0) {
28 *mem++ = 0;
29 }
30 } 27 }
31 28
32 /* $Source: /cvs/libtom/libtomcrypt/src/misc/zeromem.c,v $ */ 29 /* $Source: /cvs/libtom/libtomcrypt/src/misc/zeromem.c,v $ */
33 /* $Revision: 1.6 $ */ 30 /* $Revision: 1.6 $ */
34 /* $Date: 2006/06/09 01:38:13 $ */ 31 /* $Date: 2006/06/09 01:38:13 $ */