From d58602adef3412b354fd521bbd4bda24a0b1a789 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 13 Feb 2014 18:14:10 +0100 Subject: crypto: Add rand_seed function This function is needed on OSs that do not automatically initialize the PRNG seed. --- lib/crypto/doc/src/crypto.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/crypto/doc') diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 40f829e704..952808d9db 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -552,6 +552,21 @@ + + rand_seed(Seed) -> ok + Set the seed for random bytes generation + + Seed = binary() + + +

Set the seed for PRNG to the given binary. This calls the + RAND_seed function from openssl. Only use this if the system + you are running on does not have enough "randomness" built in. + Normally this is when + stong_rand_bytes/1 returns low_entropy

+
+
+ rand_uniform(Lo, Hi) -> N Generate a random number -- cgit v1.2.3