summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib/Makefile.am
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-18 11:49:28 +0100
committerCorinna Vinschen <corinna@vinschen.de>2016-03-18 12:33:41 +0100
commitf74cf1350e4633892b6ee6db3664eec38579a709 (patch)
tree583373429fc4615e9189b2116c455db38af700f6 /newlib/libc/stdlib/Makefile.am
parent55c239d83413d3092c38acde8191d9249cf9f0ee (diff)
downloadcygnal-f74cf1350e4633892b6ee6db3664eec38579a709.tar.gz
cygnal-f74cf1350e4633892b6ee6db3664eec38579a709.tar.bz2
cygnal-f74cf1350e4633892b6ee6db3664eec38579a709.zip
Add arc4random() etc. from OpenBSD 5.8
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.
Diffstat (limited to 'newlib/libc/stdlib/Makefile.am')
-rw-r--r--newlib/libc/stdlib/Makefile.am2
1 files changed, 2 insertions, 0 deletions
diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
index c1067eacb..9deaf9a64 100644
--- a/newlib/libc/stdlib/Makefile.am
+++ b/newlib/libc/stdlib/Makefile.am
@@ -102,6 +102,8 @@ MALLOCR=mallocr
endif
EXTENDED_SOURCES = \
+ arc4random.c \
+ arc4random_uniform.c \
cxa_atexit.c \
cxa_finalize.c \
drand48.c \