zx_cprng_draw
Summary
Draw from the kernel's CPRNG.
Declaration
#include <zircon/syscalls.h>
void zx_cprng_draw(void* buffer, size_t buffer_size);
Description
zx_cprng_draw()
draws random bytes from the kernel CPRNG. This data should
be suitable for cryptographic applications.
Clients that require a large volume of randomness should consider using these
bytes to seed a user-space random number generator for better performance.
As always, test the actual latency of your call site before optimizing.
Rights
None.
Notes
zx_cprng_draw()
terminates the calling process if buffer
is not a valid
userspace pointer.
There are no other error conditions. If its arguments are valid,
zx_cprng_draw()
will succeed.
See also
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-02 UTC."],[],[]]