<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 12, 2016 at 3:53 PM, Jeffrey Walton <span dir="ltr"><<a href="mailto:noloader@gmail.com" target="_blank">noloader@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">> So what is the correct way, 1 or 2?<br>
><br>
> 1)<br>
><br>
> RAND_poll()<br>
> /* RAND_bytes is unnecessary */<br>
> /* RAND_add is unnecessary */<br>
><br>
> 2)<br>
><br>
> RAND_poll()<br>
> RAND_bytes(buf, 128);<br>
> /* RAND_add is unnecessary */<br>
<br>
</span>On Windows, you call CryptGenRandom to obtain your seed for the<br>
OpenSSL PRNG. On Linux, you use one of the random devices, like<br>
/dev/srandom, /dev/random, or /dev/urandom.<br>
<br>
Windows Phone and Windows Store apps add a twist, like requiring calls<br>
to BCryptGenRandom. There's no way to wrote portable code when you<br>
factor in Windows Phone and Windows Store. It will be a #define mess.<br>
<br>
Jeff</blockquote></div><div class="gmail_extra"><br></div>Perfect! So I just need to call RAND_poll(), because it seems already choosing that funcs above. :-)</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://github.com/openssl/openssl/blob/master/crypto/rand/rand_win.c#L49">https://github.com/openssl/openssl/blob/master/crypto/rand/rand_win.c#L49</a></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://github.com/openssl/openssl/blob/master/crypto/rand/rand_unix.c#L161">https://github.com/openssl/openssl/blob/master/crypto/rand/rand_unix.c#L161</a><br clear="all"><div><br></div><div>Thanks a lot dude!</div><div><br></div>--<br><div class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div>
</div></div>