MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_random_bytes

Function get_random_bytes

freebsd/net80211/ieee80211_freebsd.c:751–762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749#include <sys/libkern.h>
750
751void
752get_random_bytes(void *p, size_t n)
753{
754 uint8_t *dp = p;
755
756 while (n > 0) {
757 uint32_t v = arc4random();
758 size_t nb = n > sizeof(uint32_t) ? sizeof(uint32_t) : n;
759 bcopy(&v, dp, n > sizeof(uint32_t) ? sizeof(uint32_t) : n);
760 dp += sizeof(uint32_t), n -= nb;
761 }
762}
763
764/*
765 * Helper function for events that pass just a single mac address.

Callers 5

wep_attachFunction · 0.70
ieee80211_node.cFile · 0.70
hostap_auth_sharedFunction · 0.70
mesh_generateidFunction · 0.70

Calls 1

arc4randomFunction · 0.50

Tested by

no test coverage detected