stdlib: Add arc4random tests
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Thu, 21 Jul 2022 13:05:00 +0000 (10:05 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 22 Jul 2022 14:58:27 +0000 (11:58 -0300)
commit8dd890d96f1833a58de6e112a14d63ab44e0a402
tree0369ccc9a88124cc69c83ad51cfc640fac45bb15
parent6f4e0fcfa2d2b0915816a3a3a1d48b4763a7dee2
stdlib: Add arc4random tests

The basic tst-arc4random-chacha20.c checks if the output of ChaCha20
implementation matches the reference test vectors from RFC8439.

The tst-arc4random-fork.c check if subprocesses generate distinct
streams of randomness (if fork handling is done correctly).

The tst-arc4random-stats.c is a statistical test to the randomness of
arc4random, arc4random_buf, and arc4random_uniform.

The tst-arc4random-thread.c check if threads generate distinct streams
of randomness (if function are thread-safe).

Checked on x86_64-linux-gnu, aarch64-linux, and powerpc64le-linux-gnu.

Co-authored-by: Florian Weimer <fweimer@redhat.com>
Checked on x86_64-linux-gnu and aarch64-linux-gnu.
stdlib/Makefile
stdlib/tst-arc4random-chacha20.c [new file with mode: 0644]
stdlib/tst-arc4random-fork.c [new file with mode: 0644]
stdlib/tst-arc4random-stats.c [new file with mode: 0644]
stdlib/tst-arc4random-thread.c [new file with mode: 0644]