<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Alessandro Ghedini via RT <span dir="ltr"><<a href="mailto:rt@openssl.org" target="_blank">rt@openssl.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I was also wondering whether it would make sense to just drop the asm<br>
implementations. Does the speed-up justify the added complexity?<br></blockquote><div><br></div><div>IMO, it should work like this:</div><div>* memset_s when memset_s is available.</div><div>* Otherwise, SecureZeroMemory, when SecureZeroMemory is available.</div><div>* Otherwise, if a flag OPENSSL_REQUIRE_SECURE_ZERO is set, fail.</div><div>* Otherwise, use an assembly language implementation, if available.<br></div><div>* Otherwise, emit a warning and use the C implementation.</div><div><br></div><div>Note in particular that the C compiler is allowed to completely defeat the purpose of the function unless SecureZeroMemory or memset_s is used, even if you use "volatile" or other tricks. The primary purpose of the assembly language implementations is to reduce the possibility that the C compiler will do the weird things that C compilers love to do.</div><div><br></div></div>Cheers,</div><div class="gmail_extra">Brian<br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><a href="https://briansmith.org/" target="_blank">https://briansmith.org/</a></div><div><br></div></div></div></div></div></div></div>
</div></div>