// misc.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "config.h" #if CRYPTOPP_MSC_VERSION # pragma warning(disable: 4189) # if (CRYPTOPP_MSC_VERSION >= 1400) # pragma warning(disable: 6237) # endif #endif #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE # pragma GCC diagnostic ignored "-Wcast-align" #endif #ifndef CRYPTOPP_IMPORTS #include "misc.h" #include "words.h" #include "words.h" #include "stdcpp.h" #include "integer.h" // for memalign #if defined(CRYPTOPP_MEMALIGN_AVAILABLE) || defined(CRYPTOPP_MM_MALLOC_AVAILABLE) || defined(QNX) # include #endif NAMESPACE_BEGIN(CryptoPP) void xorbuf(byte *buf, const byte *mask, size_t count) { assert(buf != NULL); assert(mask != NULL); assert(count > 0); size_t i=0; if (IsAligned(buf) && IsAligned(mask)) { if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(buf) && IsAligned(mask)) { for (i=0; i 0); size_t i=0; if (IsAligned(output) && IsAligned(input) && IsAligned(mask)) { if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(output) && IsAligned(input) && IsAligned(mask)) { for (i=0; i 0); size_t i=0; byte acc8 = 0; if (IsAligned(buf) && IsAligned(mask)) { word32 acc32 = 0; if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(buf) && IsAligned(mask)) { word64 acc64 = 0; for (i=0; i>32); } for (i=0; i>8) | byte(acc32>>16) | byte(acc32>>24); } for (i=0; i