mbedTLS: memset vs hash_zeroize
Hello!
This function was defined and used instead of memset to reset mbedtls's sha256 context. Is there a good reason behind this choice?
/* Implementation that should never be optimized out by the compiler */
void hash_zeroize( void *v, size_t n )
{
volatile unsigned char *p = (unsigned char *)v;
while (n--)
{
*p++ = 0;
}
}
