From 30e9097985656920f01a72efc1088caa2b8d41b3 Mon Sep 17 00:00:00 2001 From: bertagaz Date: Tue, 14 Jun 2011 15:26:19 +0200 Subject: Imported Upstream version 0.5.29 --- embeddedcryptopp/misc.cpp | 130 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 embeddedcryptopp/misc.cpp (limited to 'embeddedcryptopp/misc.cpp') diff --git a/embeddedcryptopp/misc.cpp b/embeddedcryptopp/misc.cpp new file mode 100644 index 0000000..7e4fa89 --- /dev/null +++ b/embeddedcryptopp/misc.cpp @@ -0,0 +1,130 @@ +// misc.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "misc.h" +#include "words.h" +#include + +NAMESPACE_BEGIN(CryptoPP) + +void xorbuf(byte *buf, const byte *mask, size_t count) +{ + size_t i; + + if (IsAligned(buf) && IsAligned(mask)) + { + if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(buf) && IsAligned(mask)) + { + for (i=0; i(output) && IsAligned(input) && IsAligned(mask)) + { + if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(output) && IsAligned(input) && IsAligned(mask)) + { + for (i=0; i(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