Does FIPS 140-2 crypto certification matter for Bitcoin?

2

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?

goodguys_activate

Posted 2012-12-13T23:54:58.883

Reputation: 11 898

"Does the choice of SHA-2 library for Bitcoin?" Does it what? Is there a grammatical error in that sentence?Highly Irregular 2012-12-19T00:45:42.707

@HighlyIrregular Oops & TY. I missed a word while typing on my cell phone. Incomplete sentences seem togoodguys_activate 2012-12-19T01:01:18.230

Answers

2

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.

David Schwartz

Posted 2012-12-13T23:54:58.883

Reputation: 46 931

Would upvote if you said why FIPS-140 is less desirable.Highly Irregular 2012-12-19T00:47:05.720

1Too many reasons. For one thing, say you find a bug in your FIPS validated code. Do you pay $35,000 to fix it (since you'll need a new validation) or do you leave the bug in? And FIPS requires you to break things that are perfectly capable of working. Also, FIPS modes are maintained under the assumption that nobody will ever enable them. They're only there so that you can put a checkmark in the "FIPS validated" box. If you enable FIPS mode and something doesn't work and you file a bug report, you will be told "disable FIPS mode".David Schwartz 2012-12-19T03:51:19.940

1

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.

goodguys_activate

Posted 2012-12-13T23:54:58.883

Reputation: 11 898