- removes cryptopp dependency in BitcoinMiner() and replace it with OpenSSL
- add simple unittest for SHA256Transform()
This has only been tested on Linux so it would be great if someone can try this on win/osx.
This has only been tested on Linux so it would be great if someone can try this on win/osx.
689 | + return T((x>>y) | (x<<(sizeof(T)*8-y))); 690 | +} 691 | + 692 | +inline uint32_t ByteReverse(uint32_t value) 693 | +{ 694 | +#if defined(__MWERKS__) && TARGET_CPU_PPC
I vote for getting rid of these #ifdefs and just using the generic code.
681 | +{ 682 | + assert(y < sizeof(T)*8); 683 | + return T((x<<y) | (x>>(sizeof(T)*8-y))); 684 | +} 685 | + 686 | +template <class T> inline T rotrFixed(T x, unsigned int y)
rotrFixed isn't used anywhere, right?
Now that midstate is deprecated I will rework this patch to as it does not need to support midstate anymore. Though, what is the most generic code for ByteSwap/Reverse that we can safely use in bitcoin and works on GCC (lin/win/osx) and VisualStudio?
The generic byte-swap would be the code in the #else that uses rotlFixed...
Also, I think it'd be cleaner to move rotlFixed and the body of ByteReverse to util.cpp.
Can you hold off on removing midstate support? I'd like to pull this for the 0.5 release, we can remove the deprecated midstate a few months AFTER the 0.5 release (gotta give people time to adapt).
Looks like github does not handle rebased pull requests correctly.
Changes:
ByteReverse() to a single function using shift, OR and ANDWe can't move it to util.cpp because it is declared inline and it is used when looping over arrays so performance is still somewhat important.
Can you cherry-pick just the (two?) commits into a fresh tree, merge them, and update this pull request? github or your branch are very confused...