Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Frodek on July 20, 2014, 02:55:36 PM



Title: How much operations take SHA-2 ?
Post by: Frodek on July 20, 2014, 02:55:36 PM
Traditionally is conversion factor 12700 flops per hash/s. In Talk:FLOPS (https://en.wikipedia.org/wiki/Talk:FLOPS) :
Quote
bitcoinwatch.com calculates PFLOPS of bitcoin network as: take number of Hashes/second (Terahashes/s of SHA256) and multiply by 12700 to get a "Single-precision FLOPS estimate". One hash calculation is considered as 6350 32-bit integer operations, and each integer operation is considered equal to two single-precision flops. Source of constants is: http://forum.bitcoin.org/index.php?topic=4689.0 (http://forum.bitcoin.org/index.php?topic=4689.0)  (with reference to bincoinwatch's admin). Actual bitcoin mining contains no (or almost no) floating-point calculations.
But I wonder: one 32 bit integer operation is counts as two floating point operations?  While one floating point operation take longer tome than one integer operation.
Second question: How compute 6350 operations while SHA of long data take long time and SHA of short data take short time? How long data must be digest compute?


Title: Re: How much operations take SHA-2 ?
Post by: Frodek on July 22, 2014, 07:46:51 AM
Where can I find source of SHA implementation on CPU?


Title: Re: How much operations take SHA-2 ?
Post by: shorena on July 22, 2014, 10:57:06 AM
Wikipedia has pseudocode for sha256, rosettacode has several implementations and your favorite programming language has probably a libary for it.

 rosettacode.org/wiki/SHA-256