Files
dropbear/zeromem.c
Matt Johnston ef7fcc83a7 make data pointers volatile so that memory zeroing won't get optimised away
--HG--
branch : libtomcrypt
extra : convert_revision : fa68f28b581de8ed5f2af8f1ab95b33bcf4a7e18
2005-01-02 17:09:05 +00:00

20 lines
510 B
C

/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@iahu.ca, http://libtomcrypt.org
*/
#include "mycrypt.h"
void zeromem(void *dst, size_t len)
{
volatile unsigned char *mem = (unsigned char *)dst;
_ARGCHK(dst != NULL);
while (len-- > 0)
*mem++ = 0;
}