diff --git a/misc.cpp b/misc.cpp index d02c5202..305edfdf 100644 --- a/misc.cpp +++ b/misc.cpp @@ -12,24 +12,68 @@ NAMESPACE_BEGIN(CryptoPP) void xorbuf(byte *buf, const byte *mask, size_t count) { - if (((size_t)buf | (size_t)mask | count) % WORD_SIZE == 0) - XorWords((word *)buf, (const word *)mask, count/WORD_SIZE); - else + size_t i; + + if (IsAligned(buf) && IsAligned(mask)) { - for (unsigned int i=0; i(buf) && IsAligned(mask)) + { + for (i=0; i(output) && IsAligned(input) && IsAligned(mask)) { - for (unsigned int i=0; i(output) && IsAligned(input) && IsAligned(mask)) + { + for (i=0; i