aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2018-09-13 14:34:19 +0200
committerRaimo Niskanen <[email protected]>2018-09-13 14:34:19 +0200
commit510048b8efd0a72706f3232f0842ee9828c63f79 (patch)
tree5cb054451943b139d519ca2c5bbb2468eb44aa75 /lib/stdlib/test
parentae074a6d4ed9a056d6687b2736be28a9dcc0649d (diff)
downloadotp-510048b8efd0a72706f3232f0842ee9828c63f79.tar.gz
otp-510048b8efd0a72706f3232f0842ee9828c63f79.tar.bz2
otp-510048b8efd0a72706f3232f0842ee9828c63f79.zip
Prototype crypto_aes PRNG
Conflicts: lib/crypto/src/crypto.erl
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/rand_SUITE.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/stdlib/test/rand_SUITE.erl b/lib/stdlib/test/rand_SUITE.erl
index 636ba71fcf..c46e370dd5 100644
--- a/lib/stdlib/test/rand_SUITE.erl
+++ b/lib/stdlib/test/rand_SUITE.erl
@@ -848,7 +848,8 @@ do_measure(_Config) ->
Algs =
algs() ++
try crypto:strong_rand_bytes(1) of
- <<_>> -> [crypto64, crypto_cache, crypto]
+ <<_>> ->
+ [crypto64, crypto_cache, crypto_aes, crypto]
catch
error:low_entropy -> [];
error:undef -> []
@@ -1097,6 +1098,10 @@ measure_1(RangeFun, Fun, Alg, TMark) ->
{rand, crypto:rand_seed_alg(crypto_cache)};
crypto ->
{rand, crypto:rand_seed_s()};
+ crypto_aes ->
+ {rand,
+ crypto:rand_seed_alg(
+ {crypto_aes,crypto:strong_rand_bytes(256)})};
random ->
{random, random:seed(os:timestamp()), get(random_seed)};
_ ->
@@ -1112,7 +1117,7 @@ measure_1(RangeFun, Fun, Alg, TMark) ->
_ -> (Time * 100 + 50) div TMark
end,
io:format(
- "~.12w: ~p ns ~p% [16#~.16b]~n",
+ "~.20w: ~p ns ~p% [16#~.16b]~n",
[Alg, (Time * 1000 + 500) div ?LOOP_MEASURE,
Percent, Range]),
Parent ! {self(), Time},