summaryrefslogtreecommitdiff
path: root/cryptopp/crypto/misc.cpp
diff options
context:
space:
mode:
authorwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-26 14:19:43 +0000
committerwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-26 14:19:43 +0000
commit7aff1e4cb053394db57c2814d5fe1e6493e0cc75 (patch)
treec8585e44049b37e4da152495c954242204c2c38d /cryptopp/crypto/misc.cpp
parent6f3d69266933ef120d229e0daf2da164b77214d0 (diff)
Project folders rename part 2
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@214 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'cryptopp/crypto/misc.cpp')
-rw-r--r--cryptopp/crypto/misc.cpp98
1 files changed, 0 insertions, 98 deletions
diff --git a/cryptopp/crypto/misc.cpp b/cryptopp/crypto/misc.cpp
deleted file mode 100644
index 92aa7d2..0000000
--- a/cryptopp/crypto/misc.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-// 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 <new>
-
-NAMESPACE_BEGIN(CryptoPP)
-
-void xorbuf(byte *buf, const byte *mask, size_t count)
-{
- size_t i;
-
- if (IsAligned<word32>(buf) && IsAligned<word32>(mask))
- {
- #if defined(WORD64_AVAILABLE) && !defined(CRYPTOPP_SLOW_WORD64)
- if (IsAligned<word64>(buf) && IsAligned<word64>(mask))
- {
- for (i=0; i<count/8; i++)
- ((word64*)buf)[i] ^= ((word64*)mask)[i];
- count -= 8*i;
- if (!count)
- return;
- buf += 8*i;
- mask += 8*i;
- }
- #endif
-
- for (i=0; i<count/4; i++)
- ((word32*)buf)[i] ^= ((word32*)mask)[i];
- count -= 4*i;
- if (!count)
- return;
- buf += 4*i;
- mask += 4*i;
- }
-
- for (i=0; i<count; i++)
- buf[i] ^= mask[i];
-}
-
-void xorbuf(byte *output, const byte *input, const byte *mask, size_t count)
-{
- size_t i;
-
- if (IsAligned<word32>(output) && IsAligned<word32>(input) && IsAligned<word32>(mask))
- {
- #if defined(WORD64_AVAILABLE) && !defined(CRYPTOPP_SLOW_WORD64)
- if (IsAligned<word64>(output) && IsAligned<word64>(input) && IsAligned<word64>(mask))
- {
- for (i=0; i<count/8; i++)
- ((word64*)output)[i] = ((word64*)input)[i] ^ ((word64*)mask)[i];
- count -= 8*i;
- if (!count)
- return;
- output += 8*i;
- input += 8*i;
- mask += 8*i;
- }
- #endif
-
- for (i=0; i<count/4; i++)
- ((word32*)output)[i] = ((word32*)input)[i] ^ ((word32*)mask)[i];
- count -= 4*i;
- if (!count)
- return;
- output += 4*i;
- input += 4*i;
- mask += 4*i;
- }
-
- for (i=0; i<count; i++)
- output[i] = input[i] ^ mask[i];
-}
-
-#if !(defined(_MSC_VER) && (_MSC_VER < 1300))
-using std::new_handler;
-using std::set_new_handler;
-#endif
-
-void CallNewHandler()
-{
- new_handler newHandler = set_new_handler(NULL);
- if (newHandler)
- set_new_handler(newHandler);
-
- if (newHandler)
- newHandler();
- else
- throw std::bad_alloc();
-}
-
-NAMESPACE_END
-
-#endif