Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: j16sdiz on December 15, 2010, 09:18:06 AM



Title: Crypto++ 5.6 ?
Post by: j16sdiz on December 15, 2010, 09:18:06 AM
I saw you are using a modified cryptopp 5.6.0,  which disable SSE2 on 32-bit x86.

On the official website, there is a newer version 5.6.1 which fix a few SHA-256 related bug. I guess you may be interested:

- fixed several bugs in the SHA-256 x86/x64 assembly code:
--- incorrect hash on non-SSE2 x86 machines on non-aligned input
--- incorrect hash on x86 machines when input crosses 0x80000000
--- incorrect hash on x64 when compiled with GCC with optimizations enabled



Title: Re: Crypto++ 5.6 ?
Post by: BioMike on December 15, 2010, 09:25:25 AM
For the gentoo ebuild I have been using the original thing for some time now (Gentoo policy is not to use bundled libs, as they are a security hazard). No problems encountered in more then a half year.


Title: Re: Crypto++ 5.6 ?
Post by: jgarzik on December 16, 2010, 04:13:55 AM

This patch updates part of Crypto++ in bitcoin to upstream:
http://yyz.us/bitcoin/patch.bitcoin-asmfix1



Title: Re: Crypto++ 5.6 ?
Post by: j16sdiz on December 16, 2010, 01:49:40 PM
I have patched the  "bitcoinr" to use system provided crypto, here is the result:

CPU:  Premium III Mobile  (yes, i know this is very very old)
Compiled with gcc 4.4,  -O3 -msse

the cryptopp 5.6.0 in bitcoinr tree:   133khash/s
the cryptopp 5.6.1 (provided in debian):   200khash/s


Here is the patch to use system-provided cryptopp (if available, with fallback)
https://github.com/j16sdiz/bitcoin-pool/commit/121a0a570bed15fc347cff091e740a02bd8e1a3f


Title: Re: Crypto++ 5.6 ?
Post by: BioMike on December 16, 2010, 02:09:57 PM
I have patched the  "bitcoinr" to use system provided crypto, here is the result:

CPU:  Premium III Mobile  (yes, i know this is very very old)
Compiled with gcc 4.4,  -O3 -msse

the cryptopp 5.6.0 in bitcoinr tree:   133khash/s
the cryptopp 5.6.1 (provided in debian):   200khash/s


Here is the patch to use system-provided cryptopp (if available, with fallback)
https://github.com/j16sdiz/bitcoin-pool/commit/121a0a570bed15fc347cff091e740a02bd8e1a3f

That's quite a difference.


Title: Re: Crypto++ 5.6 ?
Post by: jgarzik on December 16, 2010, 07:50:38 PM
I have patched the  "bitcoinr" to use system provided crypto, here is the result:

CPU:  Premium III Mobile  (yes, i know this is very very old)
Compiled with gcc 4.4,  -O3 -msse

the cryptopp 5.6.0 in bitcoinr tree:   133khash/s
the cryptopp 5.6.1 (provided in debian):   200khash/s

Out of curiosity, what speed do you get from various algorithms in the CPU miner (http://bitcointalk.org/index.php?topic=1925.0;all)?  That also uses Crypto++ code.


Title: Re: Crypto++ 5.6 ?
Post by: j16sdiz on December 20, 2010, 12:17:07 AM
the cryptopp 5.6.0 in bitcoinr tree:   133khash/s
the cryptopp 5.6.1 (provided in debian):   200khash/s

Sorry, I was mixing up some binaries. The improvement was not that great. -- in fact, that was statistically insignificant.