<div dir="ltr">Hello,<div><br></div><div>I'm trying to implement the new Russian GOST CMS specification. It uses the key wrap algorithm described here: <a href="https://tools.ietf.org/html/draft-smyshlyaev-tls12-gost-suites-06#section-8.2">https://tools.ietf.org/html/draft-smyshlyaev-tls12-gost-suites-06#section-8.2</a><br><br>I've implemented the algorithm as a cipher with the EVP_CIPH_WRAP_MODE flag.</div><div><br></div><div>It seems to me that the only way to avoid clearing the EVP_CIPHER_CTX_FLAG_WRAP_ALLOW flag in the EVP_CipherInit function is providing the ctrl function in the corresponding EVP_CIPHER object because the EVP_CipherInit function resets the passed EVP_CIPHER_CTX object. </div><div><br></div><div>The EVP_CipherInit_ex does not reset the EVP_CIPHER_CTX object and theEVP_CIPHER_CTX_FLAG_WRAP_ALLOW stays untouched, so the behavior seems a bit controversial (and undocumented, at least for the 1.1.1 branch). </div><div><br></div><div>Is this difference a desired one or an accidental one? Should it be documented or fixed?<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">SY, Dmitry Belyavsky</div></div></div>