<div dir="ltr">I was actually going to file a ticket somewhere and never got around to it...<br><br>In BoringSSL, we've instead gone the route of removing BN_FLG_CONSTTIME altogether. Rather call sites which need a particular function call that function directly. I think this is much less error-prone (as the various problems here show). Of course, OpenSSL can't fully get rid of BN_FLG_CONSTTIME until 1.2.0, but it could arrange for the library to no longer rely on it internally.<div><br></div><div>In a crypto library, "modular exponentiation" is not a complete API contract. Rather, you need contracts like "modular exponentiation with secret fully-reduced base and public exponent" or "modular exponentiation with secret fully-reduced base and secret exponent publicly bounded by such-and-such". Cast in that light, I think it becomes much clearer that they should be separate functions. You could even imagine embedding secrecy into the type (either for safety or to take advantage of some future compiler annotations), in which case separate functions is necessary.<div><div><br>This also aligns with the guidelines here:</div><div><a href="https://github.com/HACS-workshop/spectre-mitigations/blob/master/crypto_guidelines.md#2-avoid-indirect-branches-in-constant-time-code">https://github.com/HACS-workshop/spectre-mitigations/blob/master/crypto_guidelines.md#2-avoid-indirect-branches-in-constant-time-code</a><br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 16, 2018 at 1:09 PM Salz, Rich <<a href="mailto:rsalz@akamai.com">rsalz@akamai.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think this is a great idea, but that it is way too late for this release.  We really should be concentrating on testing and fixes, and open PR's and other release criteria.  Ideally the release goes out in a month (IETF RFC editor willing)<br>
<br>
_______________________________________________<br>
openssl-project mailing list<br>
<a href="mailto:openssl-project@openssl.org" target="_blank">openssl-project@openssl.org</a><br>
<a href="https://mta.openssl.org/mailman/listinfo/openssl-project" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-project</a><br>
</blockquote></div></div></div></div>