mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
18 lines
298 B
C
18 lines
298 B
C
#include "zeroize.h"
|
|
|
|
void zeroize(unsigned char* b, size_t len)
|
|
{
|
|
size_t count = 0;
|
|
unsigned long retval = 0;
|
|
volatile unsigned char *p = b;
|
|
|
|
for (count = 0; count < len; count++)
|
|
p[count] = 0;
|
|
}
|
|
|
|
void zeroize_stack()
|
|
{
|
|
unsigned char m[ZEROIZE_STACK_SIZE];
|
|
zeroize(m, sizeof m);
|
|
}
|