From cf70b1a013b4582d577463a99861016e295c857a Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 18 May 2018 05:29:09 -0700 Subject: [PATCH] Revert ForceZero changes in favor of PR #1567. --- wolfcrypt/src/misc.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index 1fbe774da..6d7f0e3ed 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -200,35 +200,14 @@ STATIC INLINE void ForceZero(const void* mem, word32 len) { volatile byte* z = (volatile byte*)mem; -#ifndef NO_ALIGNED_FORCEZERO #if defined(WOLFSSL_X86_64_BUILD) && defined(WORD64_AVAILABLE) volatile word64* w; - /* align buffer */ - while (len && ((size_t)z % sizeof(word64)) != 0) { - *z++ = 0; len--; - } - - /* do aligned force zero */ for (w = (volatile word64*)z; len >= sizeof(*w); len -= sizeof(*w)) *w++ = 0; z = (volatile byte*)w; -#else - volatile word32* w; - - /* align buffer */ - while (len && ((size_t)z % sizeof(word32)) != 0) { - *z++ = 0; len--; - } - - /* do aligned force zero */ - for (w = (volatile word32*)z; len >= sizeof(*w); len -= sizeof(*w)) - *w++ = 0; - z = (volatile byte*)w; #endif -#endif /* NO_ALIGNED_FORCEZERO */ - /* do byte by byte force zero */ while (len--) *z++ = 0; }