18 lines
298 B
C
Raw Normal View History

2014-09-13 10:31:34 -07:00
#include "zeroize.h"
2014-07-24 11:24:54 -07:00
2014-09-13 10:31:34 -07:00
void zeroize(unsigned char* b, size_t len)
2014-07-24 11:24:54 -07:00
{
2014-09-13 10:31:34 -07:00
size_t count = 0;
2014-07-24 11:24:54 -07:00
unsigned long retval = 0;
volatile unsigned char *p = b;
for (count = 0; count < len; count++)
p[count] = 0;
}
2014-09-13 10:31:34 -07:00
void zeroize_stack()
{
unsigned char m[ZEROIZE_STACK_SIZE];
zeroize(m, sizeof m);
}