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:
committed by
Gavin Andresen
parent
9f35575ca3
commit
3dd20ff2f8
14
util.h
14
util.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user