mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
LinuxKPI: Add get_random_u64() function
Sponsored by: Serenity Cyber Security, LLC Reviewed by: manu, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42816 (cherry picked from commit 7f88d742e578c4cef4e26ce10b9a936e58237964)
This commit is contained in:
parent
96e464b8d5
commit
c535e8ae7f
1 changed files with 9 additions and 0 deletions
|
|
@ -87,6 +87,15 @@ get_random_long(void)
|
|||
return (val);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
get_random_u64(void)
|
||||
{
|
||||
uint64_t val;
|
||||
|
||||
get_random_bytes(&val, sizeof(val));
|
||||
return (val);
|
||||
}
|
||||
|
||||
static __inline uint32_t
|
||||
prandom_u32(void)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue