title: Calculating SHA256 hash with OpenSSL in FIPS mode
body: <p><strong>The background</strong><br>
  I've compiled OpenSSL with the OpenSSL FIPS Object Module (following the instructions for cross compiling to Android).</p>
  
  <p>Now in my code I want to use SHA256 (from what I can see at least some sha256 algorithms are FIPS approved).</p>
  
  <p><strong>The problem</strong><br>
  After calling set_mode(1) to enable FIPS in runtime, the following code crashes in OpenSSLDie (presumably means disabled by FIPS)</p>
  
  <pre><code>SHA256_CTX sha256;
  SHA256_Init(&amp;sha256);
  SHA256_Update(&amp;sha256, data, len);
  SHA256_Final(outputBuffer, &amp;sha256);
  </code></pre>
  
  <p><strong>The questions</strong>  </p>
  
  <ol>
  <li><p>It seems that calling <code>private_SHA256_Init</code> instead works, but is it the correct way or does it circumvent the FIPS compliance?
  If it isn't the correct way how can I calculate SHA256 in FIPS mode?</p></li>
  <li><p>Since usage of non-approved algorithms is allowed if not for cryptography (by FIPS-140.2), would calling the private function be good then (for example to calculate SHA1, which seems out of the question at all in FIPS mode, but it's not to be used for crypto)</p></li>
  </ol>
  
  <p><strong>More info</strong><br>
  versions used: openssl-1.0.1q, openssl-fips-2.0.11</p>