diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 239ad77..42c6ec5 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -8,7 +8,7 @@ int base64_decode(const unsigned char *in, unsigned long len, #endif /* ---- MEM routines ---- */ -void zeromem(void *dst, size_t len); +void zeromem(volatile void *dst, size_t len); void burn_stack(unsigned long len); const char *error_to_string(int err); diff --git a/src/misc/zeromem.c b/src/misc/zeromem.c index 9dff602..3564cc1 100644 --- a/src/misc/zeromem.c +++ b/src/misc/zeromem.c @@ -20,12 +20,12 @@ @param out The destination of the area to zero @param outlen The length of the area to zero (octets) */ -void zeromem(void *out, size_t outlen) +void zeromem(volatile void *out, size_t outlen) { - unsigned char *mem = out; + volatile char *mem = out; LTC_ARGCHKVD(out != NULL); while (outlen-- > 0) { - *mem++ = 0; + *mem++ = '\0'; } }