MCPcopy Create free account
hub / github.com/ElementsProject/lightning / pseudorand_

Function pseudorand_

common/pseudorand.c:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29uint64_t pseudorand_(uint64_t max, uint64_t *offset)
30{
31 init_if_needed();
32
33 assert(max);
34
35 /* We try to avoid being order-dependent here. */
36 if (randbytes_overridden()) {
37 uint64_t rand;
38 randbytes_(&rand, sizeof(rand), offset);
39 return rand % max;
40 }
41 return isaac64_next_uint(&isaac64, max);
42}
43
44uint64_t pseudorand_u64_(uint64_t *offset)
45{

Callers

nothing calls this directly

Calls 4

init_if_neededFunction · 0.85
isaac64_next_uintFunction · 0.85
randbytes_overriddenFunction · 0.70
randbytes_Function · 0.70

Tested by

no test coverage detected