added a subset of Crypto++ 5.6.0 with 48% faster ASM SHA-256, combined speedup 2.5x faster vs 0.3.3, thanks BlackEye for figuring out the alignment problem

This commit is contained in:
--author=Satoshi Nakamoto
2010-07-27 20:43:55 +00:00
committed by Gavin Andresen
parent 9f35575ca3
commit 3dd20ff2f8
26 changed files with 6093 additions and 895 deletions

14
util.h
View File

@@ -54,6 +54,20 @@ inline T& REF(const T& val)
return (T&)val;
}
// Align by increasing pointer, must have extra space at end of buffer
template <size_t nBytes, typename T>
T* alignup(T* p)
{
union
{
T* ptr;
size_t n;
} u;
u.ptr = p;
u.n = (u.n + (nBytes-1)) & ~(nBytes-1);
return u.ptr;
}
#ifdef __WXMSW__
#define MSG_NOSIGNAL 0
#define MSG_DONTWAIT 0