#include <corecrypto/cc.h>
#if ( CC_HAS_MEMSET_S == 1 ) && (defined( __STDC_WANT_LIB_EXT1__ ) && ( __STDC_WANT_LIB_EXT1__ == 1 ) )
void cc_clear(size_t len, void *dst)
{
memset_s(dst,len,0,len);
}
#elif defined(_WIN32) && !defined(__clang__) //Clang with Microsoft CodeGen, doesn't support SecureZeroMemory
#include <windows.h>
static void cc_clear(size_t len, void *dst)
{
SecureZeroMemory(dst, len);
}
#else
void cc_clear(size_t len, void *dst)
{
volatile char *vptr = (volatile char *)dst;
while (len--)
*vptr++ = '\0';
}
#endif