title: HMAC verification goes wrong with Openssl EVP
body: <p>The code i wrote somehow does not work properly.
  When using the same key and cipher with an online tool, the hmac is different.</p>
  <p>My code is:</p>
  <pre><code>    EVP_MD_CTX* mdctx = NULL;
      const EVP_MD* md = NULL;
      EVP_PKEY *pkey = NULL;
      
      unsigned char md_value[EVP_MAX_MD_SIZE];
      size_t md_len = 0;
  
      mdctx = EVP_MD_CTX_create();
      md = EVP_get_digestbyname(&quot;SHA256&quot;);
      const unsigned char  a[] = &quot;qwertzuiopqwertzuiopqw&quot;;
      pkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, NULL, a, strlen(&quot;qwertzuiopqwertzuiopqw&quot;));
      EVP_DigestSignInit(mdctx, NULL, md, NULL, pkey);
     EVP_DigestSignUpdate(mdctx, &quot;Hallo&quot;, sizeof(&quot;Hallo&quot;)); // iv
      EVP_DigestSignFinal(mdctx, md_value, &amp;md_len);
  
  </code></pre>
  <p>The hmac calculated by my code is : eadfb51c9fb3f3fcd5741006861d04bc0d695347db4bfb9e04e954e17583c3c5.</p>
  <p>The hmac calculated by the <a href="https://www.freeformatter.com/hmac-generator.html#ad-output" rel="nofollow noreferrer">online-tool</a> is: a9e0f9acc1452bdb796556c3c64e29d7f7ab47a59a179ec918c61894eefeba26.</p>
  <p>What am i doing wrong?</p>