user1878: I'm implementing part of the Bitcoin client in C# and noticed that I have the choice between FIPS 140-2 and non certified versions of SHA256.  Supposedly both versions give the same hash.
Does the choice of SHA-2 library matter for Bitcoin?  Does the FIPS-2 library exist in Mono and mobile devices?

user1878: Here are some performance stats I've come up with so far for my C# implementation:
A single ECC public key (after the ECC operation) can have the Base58Checked algorithm applied at this rate
   Algorithm                             Time for 100,000 Base58Check(byte[] key)
   ------------------------------       ---------------------------------------------
   SHA256Managed()                       4500ms
   SHA256CryptoServiceProvider()         3640ms  <--- CSP FIPS version

So yes, the FIPS validated version is faster & likely better.

user85: You should basically never choose FIPS-140 unless you have no choice. FIPS-140 compliance is provided primarily for people who must comply with FIPS-140 for regulatory or policy reasons.
Note that that's not to say FIPS-140 validation is bad. It's great. If it finds bugs or problems, that's a pure win. If you have a choice between an implementation that has been FIPS validated and one that has not, the former is the better choice. But that has nothing to do with whether you enable FIPS-140 modes.
Your implementation has been FIPS validated. Don't brain damage it.

1878: <p>I'm implementing part of the Bitcoin client in C# and noticed that I have the choice between <a href="http://en.wikipedia.org/wiki/FIPS_140-2" rel="nofollow">FIPS 140-2</a> and non certified versions of SHA256.  Supposedly both versions give the same hash.</p>

<p>Does the choice of SHA-2 library matter for Bitcoin?  Does the FIPS-2 library exist in Mono and mobile devices?</p>
 1878: <p>Here are some performance stats I've come up with so far for my C# implementation:</p>

<p>A single ECC public key (after the ECC operation) can have the Base58Checked algorithm applied at this rate</p>

<pre><code>   Algorithm                             Time for 100,000 Base58Check(byte[] key)
   ------------------------------       ---------------------------------------------
   SHA256Managed()                       4500ms
   SHA256CryptoServiceProvider()         3640ms  &lt;--- CSP FIPS version
</code></pre>

<p>So yes, the FIPS validated version is faster &amp; likely better.</p>
 85: <p>You should basically <em>never</em> choose FIPS-140 unless you have no choice. FIPS-140 compliance is provided primarily for people who must comply with FIPS-140 for regulatory or policy reasons.</p>

<p>Note that that's not to say FIPS-140 <em>validation</em> is bad. It's great. If it finds bugs or problems, that's a pure win. If you have a choice between an implementation that has been FIPS validated and one that has not, the former is the better choice. But that has nothing to do with whether you enable FIPS-140 modes.</p>

<p>Your implementation has been FIPS validated. <em>Don't</em> brain damage it.</p>
