<div dir="ltr"><div>Are EVP_PKEY_new_raw_private_key() and EVP_PKEY_new_mac_key() functionally equivalent? They have very different implementations internally but appear to produce identical results when used with EVP_DigestSignInit() and key type EVP_PKEY_HMAC. The documentation says "works like" but it's not clear whether that really means "equivalent". I'm trying to write portable (openssl version agnostic) HMAC functions and I'm concerned about the note that says "New applications should use EVP_PKEY_new_raw_private_key() instead" when that doesn't exist prior to 1.1.1. Is this the recommended solution?<br></div><div><br></div><div><span style="font-family:monospace">#if OPENSSL_VERSION_NUMBER < 0x10101000L<br>    EVP_PKEY *pkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, ...);</span></div><div><span style="font-family:monospace">#else</span></div><div><span style="font-family:monospace">    EVP_PKEY *pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, ...);<br></span></div><div><span style="font-family:monospace">#endif</span><br></div><div><br></div><div><br></div><div>Thanks,</div><div>Tom.III</div><div><br></div></div>