1 .\" Copyright (c) 2014 Theo de Raadt
2 .\" Copyright (c) 2015 Apple Inc. All rights reserved.
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 .Fn getentropy "void *buf" "size_t buflen"
28 fills a buffer with random data, which can be used
29 as input for process-context pseudorandom generators like
32 The maximum buffer size permitted is 256 bytes.
35 exceeds this, an error of
40 should be used as a replacement for
42 when random data derived directly from the kernel random byte generator is required.
45 pseudo-devices, it is not vulnerable to file descriptor exhaustion attacks
46 and is available when sandboxed or in a chroot, making it more reliable for security-critical applications.
48 However, it should be noted that
50 is primarily intended for use in the construction and seeding of userspace PRNGs like
54 Clients who simply require random data should use
56 .Fn CCRandomGenerateBytes
60 .Fn SecRandomCopyBytes
61 from the Security framework instead of
74 parameter points to an
77 Too many bytes requested, or some other fatal error occurred.