title: Using SHA2-512 (CALG_SHA_512) on Windows 7 returns "Invalid Algorithm Specified"
body: <p>I'm trying to use SHA2-512 on Windows 7 with CryptoAPI, however, calling <code>CryptCreateHash</code> fails with <code>GetLastError()</code>=2148073480=0x80090008, i.e. "Invalid Algorithm Specified". According to <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa375549%28v=vs.85%29.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/windows/desktop/aa375549%28v=vs.85%29.aspx</a> SHA2 should be available since Windows XP SP3.</p>
  
  <p>Here is the code I'm using:</p>
  
  <pre><code>HCRYPTPROV hCryptProv;
  CryptAcquireContext(&amp;hCryptProv, nullptr, nullptr, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
  
  HCRYPTHASH hHash;
  if (!CryptCreateHash(hCryptProv, CALG_SHA_512, 0, 0, &amp;hHash)) {
      DWORD err = GetLastError(); // -&gt; 2148073480=0x80090008
  }
  </code></pre>
  
  <p>Using <code>CALG_SHA1</code> instead of <code>CALG_SHA512</code> works.</p>
  
  <p>Do I have to conduct some further initialization, e.g. explicitely activating SHA2?</p>