[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $RANDOM not Cryptographically secure pseudorandom number generator
From: |
Eduardo Bustamante |
Subject: |
Re: $RANDOM not Cryptographically secure pseudorandom number generator |
Date: |
Sat, 5 Jan 2019 12:20:03 -0800 |
On Sat, Jan 5, 2019 at 12:12 PM Eduardo A. Bustamante López
<dualbus@gmail.com> wrote:
(...)
> 2. Performance impact
>
> The new RNG does more work, and thus, it is expected to have a performance
> impact when generating lots of random numbers. I tested 3 systems (2 amd64
> and 1
> armhf) and include the results below.
>
>
> AMD Ryzen 7 2700X:
>
> | dualbus@system76-pc:~/src/gnu/bash$ (set -x; lscpu; for bash in /bin/bash
> ./bash; do "$bash" ~/test-speed.sh; echo; done)
> | + lscpu
(...)
Oops, I forgot to attach the test-speed script, it's fairly simple:
| #!/bin/bash
|
| iterations=1000000
|
| TIMEFORMAT='time: %R'
|
| echo "iterations: $iterations"
| echo "BASH_VERSION: $BASH_VERSION"
|
| RANDOM=1
| time for ((i=0; i<iterations; i++)); do
| : "$RANDOM"
| done