From f74cf1350e4633892b6ee6db3664eec38579a709 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 18 Mar 2016 11:49:28 +0100 Subject: 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 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. --- newlib/libc/include/machine/_arc4random.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 newlib/libc/include/machine/_arc4random.h (limited to 'newlib/libc/include/machine/_arc4random.h') diff --git a/newlib/libc/include/machine/_arc4random.h b/newlib/libc/include/machine/_arc4random.h new file mode 100644 index 000000000..52808d722 --- /dev/null +++ b/newlib/libc/include/machine/_arc4random.h @@ -0,0 +1 @@ +/* Use default implementation, see arc4random.h */ -- cgit v1.2.3