<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 4, 2017, at 7:07 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Wed, Oct 4, 2017 at 20:32 Chris Lattner <<a href="mailto:clattner@nondot.org" class="">clattner@nondot.org</a>> wrote:<br class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class="">FWIW, I agree with Ben here: if the true cryptographically secure random numbers force this complexity onto users, then we should settle for something close but not quite that bulletproof.</div></div></blockquote><div dir="auto" class=""><br class=""></div><div dir="auto" class="">As long as it's a conscious design choice, that's potentially fine. My purpose in raising this issue is to point out that there is a choice to be made. Another consideration is that, if primitives such as Int.random() silently degrade, they cannot be the basis upon which more sophisticated secure APIs are built.</div></div></div></div></blockquote><br class=""></div><div>Understood - and please keep in mind that I am not a random number expert. :-)</div><div><br class=""></div><div>I think that the default Int.random() sorts of functions should provide an abstraction that never fails. Forcing failure onto clients will cause more bugs than it will prevent IMO (and it sounds like Ben is aligned on that as well). I suspect that folks who truly need verifiably cryptographically secure RNG’s will also have other requirements which would lead to them not wanting to use a “Int.random()” style interface anyway, so it is fine to push that complexity down to the more power-user API.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><br class=""></body></html>