| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Keep the Newlib arc4random.c identical to the OpenBSD upstream version.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>.
|
|
|
|
|
|
|
| |
Export to maintain backward compatibility, but don't let
them do anything useful.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
| |
* libc/stdlib/arc4random.c (arc4random_stir): New function.
(arc4random_addrandom): Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
According to the OpenBSD man page, "A Replacement Call for Random". It
offers high quality random numbers derived from input data obtained by
the OpenBSD specific getentropy() system call which is declared in
<unistd.h> and must be implemented for each Newlib port externally. The
arc4random() functions are used for example in LibreSSL and OpenSSH.
Cygwin provides currently its own implementation of the arc4random
family. Maybe it makes sense to use this getentropy() implementation:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libcrypto/crypto/getentropy_win.c?rev=1.4&content-type=text/x-cvsweb-markup
* libc/include/stdlib.h (arc4random): Declare if __BSD_VISIBLE.
(arc4random_buf): Likewise.
(arc4random_uniform): Likewise.
* libc/include/sys/unistd.h (getentropy): Likewise.
* libc/include/machine/_arc4random.h: New file.
* libc/stdlib/arc4random.c: Likewise.
* libc/stdlib/arc4random.h: Likewise.
* libc/stdlib/arc4random_uniform.c: Likewise.
* libc/stdlib/chacha_private.h: Likewise.
* libc/sys/rtems/include/machine/_arc4random.h: Likewise.
* libc/stdlib/Makefile.am (EXTENDED_SOURCES): Add arc4random.c
and arc4random_uniform.c.
* libc/stdlib/Makefile.in: Regenerate.
|