Symbol: arc4random_uniform
games/adventure/wizard.c
126
return (arc4random_uniform(range));
games/arithmetic/arithmetic.c
178
op = keys[arc4random_uniform(nkeys)];
games/arithmetic/arithmetic.c
199
left = right * result + arc4random_uniform(right);
games/arithmetic/arithmetic.c
310
value = arc4random_uniform(maxval + penalty[op][operand]);
games/atc/update.c
71
return arc4random_uniform(upper_bound);
games/backgammon/common_source/back.h
46
#define rnum(r) arc4random_uniform(r)
games/battlestar/extern.h
40
#define rnd(x) arc4random_uniform(x)
games/boggle/boggle/bog.c
610
q = (int)arc4random_uniform(p + 1);
games/boggle/boggle/bog.c
618
board[i] = cubes[i][arc4random_uniform(6)];
games/boggle/boggle/bog.c
625
i = arc4random_uniform(ncubes);
games/boggle/boggle/bog.c
626
board[i] = SETHI(chal_cube[arc4random_uniform(6)]);
games/bs/bs.c
362
return(arc4random_uniform(n));
games/canfield/canfield/canfield.c
534
j = arc4random_uniform(i + 1);
games/cribbage/cards.c
64
k = arc4random_uniform(j); /* random 0 <= k < j */
games/cribbage/crib.c
195
i = arc4random_uniform(CARDS); /* random cut */
games/cribbage/crib.c
197
j = arc4random_uniform(CARDS);
games/cribbage/crib.c
377
i = arc4random_uniform(CARDS - pos);
games/cribbage/crib.c
388
i = arc4random_uniform(CARDS - pos) + pos;
games/fish/fish.c
417
return(arc4random_uniform(n));
games/fortune/fortune/fortune.c
813
choice = arc4random_uniform(100);
games/fortune/fortune/fortune.c
833
choice = arc4random_uniform(Noprob_tbl.str_numstr);
games/fortune/fortune/fortune.c
875
choice = arc4random_uniform(parent->num_children);
games/fortune/fortune/fortune.c
885
choice = arc4random_uniform(parent->tbl.str_numstr);
games/fortune/fortune/fortune.c
962
fp->pos = arc4random_uniform(fp->tbl.str_numstr);
games/fortune/strfile/strfile.c
443
i = arc4random_uniform(cnt);
games/hangman/getword.c
62
pos = arc4random_uniform(Dict_size);
games/hangman/ksyms.c
43
pos = arc4random_uniform(symsize);
games/hunt/hunt/otto.c
530
&& num_turns > 4 + (arc4random_uniform(
games/hunt/hunt/otto.c
538
duck(arc4random_uniform(NUMDIRECTIONS));
games/hunt/huntd/driver.c
901
return (arc4random_uniform(range));
games/mille/init.c
93
r = arc4random_uniform(i + 1);
games/mille/roll.c
51
tot += arc4random_uniform(nsides) + 1;
games/monop/roll.c
45
tot += arc4random_uniform(nsides) + 1;
games/quiz/quiz.c
241
next = arc4random_uniform(qsize);
games/quiz/quiz.c
251
if (tflag && arc4random_uniform(100) > 20) {
games/rain/rain.c
102
xpos[j] = arc4random_uniform(tcols) + 2;
games/rain/rain.c
103
ypos[j] = arc4random_uniform(tlines) + 2;
games/rain/rain.c
110
x = arc4random_uniform(tcols) + 2;
games/rain/rain.c
111
y = arc4random_uniform(tlines) + 2;
games/random/random.c
214
return arc4random_uniform(denom);
games/robots/rnd_pos.c
58
return arc4random_uniform(range);
games/sail/extern.h
60
#define die() (arc4random_uniform(6) + 1)
games/snake/snake.c
479
p.col = arc4random_uniform(ccnt);
games/snake/snake.c
480
p.line = arc4random_uniform(lcnt);
games/snake/snake.c
608
vp = arc4random_uniform(w);
games/snake/snake.c
824
bonus = arc4random_uniform(10);
games/tetris/tetris.c
143
tmp = &shapes[arc4random_uniform(7)];
games/tetris/tetris.c
144
j = arc4random_uniform(4);
games/worm/worm.c
236
return arc4random_uniform(range);
games/worms/worms.c
349
op->opts[arc4random_uniform(op->nopts)];
games/wump/wump.c
208
bat_num += arc4random_uniform(room_num / 2 - bat_num);
games/wump/wump.c
210
pit_num += arc4random_uniform(room_num / 2 - pit_num);
games/wump/wump.c
321
if (arc4random_uniform(15) == 1)
games/wump/wump.c
374
if (arc4random_uniform(6) == 1) {
games/wump/wump.c
399
if (arc4random_uniform(12) < 2) {
games/wump/wump.c
416
arc4random_uniform(room_num) + 1;
games/wump/wump.c
469
chance = arc4random_uniform(10);
games/wump/wump.c
495
link = (arc4random_uniform(link_num));
games/wump/wump.c
539
if (arc4random_uniform(level == EASY ? 12 : 9) < lastchance) {
games/wump/wump.c
544
lastchance = arc4random_uniform(3);
games/wump/wump.c
598
delta = arc4random_uniform(room_num - 1) + 1;
games/wump/wump.c
613
try_again: link = arc4random_uniform(room_num) + 1;
games/wump/wump.c
689
j = arc4random_uniform(20 - i);
games/wump/wump.c
742
loc = arc4random_uniform(room_num) + 1;
games/wump/wump.c
753
loc = arc4random_uniform(room_num) + 1;
games/wump/wump.c
764
wumpus_loc = arc4random_uniform(room_num) + 1;
games/wump/wump.c
771
player_loc = arc4random_uniform(room_num) + 1;
games/wump/wump.c
849
wumpus_loc = cave[wumpus_loc].tunnel[arc4random_uniform(link_num)];
include/stdlib.h
316
uint32_t arc4random_uniform(uint32_t);
lib/libc/crypt/arc4random_uniform.c
57
DEF_WEAK(arc4random_uniform);
lib/libc/hidden/stdlib.h
64
PROTO_NORMAL(arc4random_uniform);
lib/libc/net/res_random.c
180
ru_x = arc4random_uniform(RU_M);
lib/libc/net/res_random.c
194
j = arc4random_uniform(RU_N);
lib/libc/stdlib/malloc.c
1433
(arc4random_uniform(d_avail) << MALLOC_MINSHIFT));
lib/libevent/poll.c
160
i = arc4random_uniform(nfds);
lib/libevent/select.c
158
i = arc4random_uniform(sop->event_fds + 1);
lib/librthread/rthread_sem.c
120
name[i] = arc4random_uniform(255) + 1;
lib/librthread/rthread_sem_compat.c
132
name[i] = arc4random_uniform(255) + 1;
lib/libssl/ssl_tlsext.c
2478
new_idx = arc4random_uniform(idx + 1);
libexec/ftpd/ftpd.c
879
us = arc4random_uniform(3000000);
regress/lib/libc/malloc/malloc0test/malloc0test.c
95
size = arc4random_uniform(SIZE);
regress/lib/libc/malloc/malloc_general/malloc_general.c
121
r = arc4random_uniform(2);
regress/lib/libc/malloc/malloc_general/malloc_general.c
36
int p = arc4random_uniform(17) + 3;
regress/lib/libc/malloc/malloc_general/malloc_general.c
37
return arc4random_uniform(1 << p);
regress/lib/libc/malloc/malloc_general/malloc_general.c
73
p = arc4random_uniform(2);
regress/lib/libc/malloc/malloc_general/malloc_general.c
74
i = arc4random_uniform(N);
regress/lib/libc/malloc/malloc_general/malloc_general.c
90
r = arc4random_uniform(2);
regress/lib/libc/qsort/qsort_test.c
205
x[i] = arc4random_uniform(m); \
regress/lib/libc/qsort/qsort_test.c
291
x[i] = arc4random_uniform(m) ? (j += 2) : (k += 2); \
regress/lib/libcrypto/aes/aes_test.c
905
in_len = arc4random_uniform(at->in_len / 2);
regress/lib/libcrypto/aes/aes_test.c
975
in_len = arc4random_uniform(at->out_len / 2);
regress/lib/libcrypto/bf/bf_test.c
1184
in_len = arc4random_uniform(bt->in_len / 2);
regress/lib/libcrypto/bf/bf_test.c
1257
in_len = arc4random_uniform(bt->out_len / 2);
regress/lib/libcrypto/bn/bn_mod_exp.c
235
bits = avg_bits + arc4random_uniform(deviate) - deviate;
regress/lib/libcrypto/bn/bn_mod_exp.c
286
multiple = arc4random_uniform(16) + 2;
regress/lib/libcrypto/bn/bn_unit.c
59
digit = '0' + arc4random_uniform(10);
regress/lib/libcrypto/lhash/lhash_test.c
230
if (arc4random_uniform(32) != 0)
regress/lib/libcrypto/rc2/rc2_test.c
727
in_len = arc4random_uniform(rt->in_len / 2);
regress/lib/libcrypto/rc2/rc2_test.c
807
in_len = arc4random_uniform(rt->out_len / 2);
regress/lib/libcrypto/rc4/rc4_test.c
380
in_len = arc4random_uniform(rt->len / 2);
regress/lib/libcrypto/rc4/rc4_test.c
426
in_len = arc4random_uniform(rt->len / 2);
regress/lib/libcrypto/sha/sha_test.c
862
part_len = arc4random_uniform(sizeof(buf));
regress/lib/libssl/dtls/dtlstest.c
228
drop = arc4random_uniform(ctx->drop_rand) == 0;
regress/sys/kern/flock/flock.c
1093
start = arc4random_uniform(128);
regress/sys/kern/flock/flock.c
1094
end = arc4random_uniform(128);
regress/sys/kern/flock/flock.c
1097
set = arc4random_uniform(2);
regress/sys/kern/flock/flock.c
1098
wrlock = arc4random_uniform(2);
regress/sys/kern/signal/signal-stress/signal-stress.c
150
kill(pids[arc4random_uniform(nprocs)], SIGUSR1);
regress/sys/kern/signal/signal-stress/signal-stress.c
151
kill(pids[arc4random_uniform(nprocs)], SIGUSR2);
regress/sys/kern/signal/signal-stress/signal-stress.c
157
pid_t pid = pids[arc4random_uniform(nprocs)];
regress/sys/netinet/bindconnect/bindconnect.c
187
fd = fd_base + arc4random_uniform(fd_num);
regress/sys/netinet/bindconnect/bindconnect.c
205
fd = fd_base + arc4random_uniform(fd_num);
regress/sys/netinet/bindconnect/bindconnect.c
223
fd = fd_base + arc4random_uniform(fd_num);
regress/sys/sys/tree/rb-linux/rb-linux.c
106
tmp->key = arc4random_uniform(MAX - MIN);
regress/sys/sys/tree/splay/splay-test.c
70
tmp->key = arc4random_uniform(MAX-MIN);
regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
100
if (arc4random_uniform(8192) == 0) {
regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
45
r = arc4random_uniform(10);
regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
48
r = arc4random_uniform(10);
regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
63
memset(dp, arc4random_uniform(255) + 1, r);
regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
67
r = arc4random_uniform(8 * 1024);
regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
71
r = arc4random_uniform(10);
regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
89
r = arc4random_uniform(2 * 1024);
regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
93
r = arc4random_uniform(16 * 1024);
regress/usr.sbin/bgpd/unittests/chash_test.c
98
p.id = arc4random_uniform(1000) + 11000;
sbin/dhcp6leased/engine.c
634
iface->timo.tv_usec = arc4random_uniform(1000000);
sbin/dhcpleased/engine.c
655
iface->timo.tv_usec = arc4random_uniform(1000000);
sbin/iked/ikev2.c
5222
arc4random_uniform(100)) / 1000);
sbin/iked/ikev2.c
7312
start = arc4random_uniform(upper - lower) + lower;
sbin/iked/pfkey.c
616
jitter = 850 + arc4random_uniform(100);
sbin/isakmpd/sa.c
1370
seconds = sa->seconds * (850 + arc4random_uniform(100)) / 1000;
sbin/slaacd/engine.c
1304
iface->timo.tv_usec = arc4random_uniform(1000000);
sbin/slaacd/engine.c
2170
addr_proposal->timo.tv_usec = arc4random_uniform(1000000);
sbin/slaacd/engine.c
2192
arc4random_uniform(PRIV_MAX_DESYNC_FACTOR);
sbin/slaacd/engine.c
2263
dfr_proposal->timo.tv_usec = arc4random_uniform(1000000);
sbin/slaacd/engine.c
2346
rdns_proposal->timo.tv_usec = arc4random_uniform(1000000);
sbin/unwind/libunbound/config.h
1550
uint32_t arc4random_uniform(uint32_t upper_bound);
sbin/unwind/libunbound/config.h
1562
uint32_t arc4random_uniform(uint32_t upper_bound);
sbin/unwind/libunbound/util/random.c
136
return (long)arc4random_uniform((uint32_t)x);
sys/arch/hppa/hppa/pmap.c
692
for (space = 1 + arc4random_uniform(hppa_sid_max);
sys/arch/powerpc64/powerpc64/pmap.c
355
idx = arc4random_uniform(nitems(pcb->pcb_slb));
sys/ddb/db_hangman.c
100
dfa.cnt = arc4random_uniform(nsyms);
sys/dev/ic/sili.c
380
if (arc4random_uniform(sili_error_test_inv_p) == 0) {
sys/dev/pci/drm/include/linux/random.h
18
return arc4random_uniform(x);
sys/dev/pci/drm/include/linux/random.h
48
return arc4random_uniform(x + 1);
sys/dev/pci/if_qwx_pci.c
3290
seq = arc4random_uniform(MHI_BHI_TXDB_SEQNUM_BMSK);
sys/dev/pci/if_qwx_pci.c
3386
seq = arc4random_uniform(MHI_BHIE_TXVECSTATUS_SEQNUM_BMSK);
sys/dev/pci/if_qwx_pci.c
3478
seq = arc4random_uniform(MHI_BHIE_RXVECSTATUS_SEQNUM_BMSK);
sys/dev/pci/if_qwz_pci.c
3157
seq = arc4random_uniform(MHI_BHI_TXDB_SEQNUM_BMSK);
sys/dev/pci/if_qwz_pci.c
3253
seq = arc4random_uniform(MHI_BHIE_TXVECSTATUS_SEQNUM_BMSK);
sys/dev/pci/if_qwz_pci.c
3342
seq = arc4random_uniform(MHI_BHIE_RXVECSTATUS_SEQNUM_BMSK);
sys/kern/exec_subr.c
394
dist = (vsize_t)arc4random_uniform(dist >> PAGE_SHIFT) << PAGE_SHIFT;
sys/kern/kern_fork.c
687
pid = 2 + arc4random_uniform(PID_MAX - 1);
sys/net/bfd.c
420
bfd->bc_mintx * (arc4random_uniform(20) + 70) / 100);
sys/net/if_spppsubr.c
3678
i = 300 + arc4random_uniform(1 + 810 - 300);
sys/net/if_wg.c
1049
msecs += arc4random_uniform(REKEY_TIMEOUT_JITTER);
sys/net/if_wg.c
1097
msecs += arc4random_uniform(REKEY_TIMEOUT_JITTER);
sys/net/pf.c
4584
r->prob <= arc4random_uniform(UINT_MAX - 1) + 1),
sys/net/pf_lb.c
204
cut = arc4random_uniform(1 + high - low) + low;
sys/net/pf_lb.c
337
addr = arc4random_uniform(mask + 1);
sys/net/pf_lb.c
418
rpool->tblidx = (int)arc4random_uniform(cnt);
sys/net80211/ieee80211_crypto_tkip.c
573
sec = 60 + arc4random_uniform(30);
sys/netinet/igmp_var.h
106
#define IGMP_RANDOM_DELAY(X) (arc4random_uniform(X) + 1)
sys/netinet/in_pcb.c
481
candidate = lower + arc4random_uniform(count);
sys/netinet/ip_id.c
63
i2 = arc4random_uniform(i + 1);
sys/netinet/ip_ipsp.c
301
spi = sspi + arc4random_uniform(tspi - sspi);
sys/netinet6/ip6_id.c
159
p->ru_x = arc4random_uniform(p->ru_m);
sys/netinet6/ip6_id.c
172
j = arc4random_uniform(p->ru_n);
sys/netinet6/mld6_var.h
38
#define MLD_RANDOM_DELAY(X) (arc4random_uniform(X) + 1)
sys/sys/systm.h
231
u_int32_t arc4random_uniform(u_int32_t);
sys/ufs/ffs/ffs_alloc.c
423
DIP_ASSIGN(ip, gen, arc4random_uniform(UINT_MAX));
sys/ufs/ffs/ffs_alloc.c
470
prefcg = arc4random_uniform(fs->fs_ncg);
sys/uvm/uvm_addr.c
1026
(arc4random_uniform(arc4_arg) & ~(align - 1));
sys/uvm/uvm_addr.c
1115
arc4random_uniform(nitems(uaddr->up_pivots))];
sys/uvm/uvm_addr.c
890
r = arc4random_uniform(PIVOT_RND) + arc4random_uniform(PIVOT_RND) -
sys/uvm/uvm_addr.c
955
minaddr += (vsize_t)arc4random_uniform(dist >> PAGE_SHIFT) <<
sys/uvm/uvm_addr.c
957
maxaddr -= (vsize_t)arc4random_uniform(dist >> PAGE_SHIFT) <<
sys/uvm/uvm_map.c
1783
addr = (vaddr_t)arc4random_uniform((u_int32_t)space) * align;
usr.bin/calendar/day.c
292
bodun = !arc4random_uniform(3);
usr.bin/dig/dighost.c
1729
j = arc4random_uniform(i);
usr.bin/jot/jot.c
288
y = arc4random_uniform(uintx) / (double)pow10;
usr.bin/make/engine.c
682
usleep(arc4random_uniform(random_delay));
usr.bin/make/make.c
148
v = arc4random_uniform(i);
usr.bin/nc/netcat.c
1492
cp = arc4random_uniform(x + 1);
usr.bin/skeyinit/skeyinit.c
204
*p++ = arc4random_uniform(10) + '0';
usr.bin/snmp/snmp.c
409
msgid = arc4random_uniform(2147483647);
usr.bin/ssh/auth.c
557
*cp = hashchars[arc4random_uniform(sizeof(hashchars) - 1)];
usr.bin/ssh/clientloop.c
554
rate_fuzz = arc4random_uniform(fuzz_ns);
usr.bin/ssh/clientloop.c
556
interval_ns += arc4random_uniform(fuzz_ns) + rate_fuzz;
usr.bin/ssh/clientloop.c
646
arc4random_uniform(SSH_KEYSTROKE_CHAFF_RNG_MS));
usr.bin/ssh/dh.c
198
which = arc4random_uniform(bestcount);
usr.bin/ssh/misc-agent.c
110
arc4random_uniform(sizeof(presentation_chars)-1)];
usr.bin/ssh/mux.c
1339
r = arc4random_uniform(26+26+10);
usr.bin/ssh/sshd-session.c
1124
int ujitter = arc4random_uniform(4 * 1000000);
usr.bin/ssh/sshd.c
560
r = arc4random_uniform(100);
usr.bin/tcpbench/tcpbench.c
845
blen = arc4random_uniform(blen) + 1;
usr.sbin/bgpd/rtr_proto.c
1144
arc4random_uniform(10));
usr.sbin/bgpd/rtr_proto.c
1190
arc4random_uniform(10));
usr.sbin/bgpd/rtr_proto.c
1235
arc4random_uniform(10));
usr.sbin/cron/entry.c
550
num1 = arc4random_uniform(num2 - num3 + 1) + num3;
usr.sbin/cron/entry.c
587
num1 += arc4random_uniform(MINIMUM(num3, num2 - num1));
usr.sbin/ftp-proxy/ftp-proxy.c
873
arc4random_uniform(IPPORT_HILASTAUTO - IPPORT_HIFIRSTAUTO));
usr.sbin/identd/identd.c
1161
buf[0] = 'a' + arc4random_uniform(26);
usr.sbin/identd/identd.c
1163
r = arc4random_uniform(36);
usr.sbin/iscsid/initiator.c
72
arc4random_uniform(0xffffff) | ISCSI_ISID_RAND;
usr.sbin/iscsid/initiator.c
73
initiator->config.isid_qual = arc4random_uniform(0xffff);
usr.sbin/mrouted/prune.c
24
#define CACHE_LIFETIME(x) ((x) + (arc4random_uniform(x)))
usr.sbin/npppd/common/slist.c
438
slist_swap0(list, i - 1, (int)arc4random_uniform(i));
usr.sbin/npppd/pptp/pptpd.c
124
m = arc4random_uniform(i);
usr.sbin/nsd/rrl.c
481
if((rrl_slip_ratio > 0) && ((rrl_slip_ratio == 1) || ((arc4random_uniform(rrl_slip_ratio)) == 0))) {
usr.sbin/nsd/util.c
869
return (int) arc4random_uniform(max);
usr.sbin/ntpd/ntp.c
895
r = arc4random_uniform(SCALE_INTERVAL(interval));
usr.sbin/ntpd/ntp.c
905
r = arc4random_uniform(interval / 10);
usr.sbin/pppd/chap.c
721
arc4random_uniform(MAX_CHALLENGE_LENGTH - MIN_CHALLENGE_LENGTH + 1);
usr.sbin/rad/engine.c
589
tv.tv_usec = arc4random_uniform(MAX_RA_DELAY_TIME * 1000);
usr.sbin/rad/engine.c
620
tv.tv_usec = arc4random_uniform(1000000);
usr.sbin/rad/engine.c
660
arc4random_uniform(MAX_RTR_ADV_INTERVAL - MIN_RTR_ADV_INTERVAL);
usr.sbin/rad/engine.c
661
tv.tv_usec = arc4random_uniform(1000000);
usr.sbin/radiusd/radiusd_ipcp.c
887
n = arc4random_uniform(self->npools);
usr.sbin/relayd/relay.c
1335
idx = (int)arc4random_uniform(rlt->rlt_nhosts);
usr.sbin/relayd/shuffle.c
41
i2 = arc4random_uniform(i + 1);
usr.sbin/ripd/message.c
48
tv.tv_sec = KEEPALIVE + arc4random_uniform(OFFSET);
usr.sbin/ripd/message.c
58
tv.tv_sec = KEEPALIVE + arc4random_uniform(OFFSET);
usr.sbin/rpki-client/mft.c
200
new_idx = arc4random_uniform(mft->filesz + 1);
usr.sbin/rpki-client/repo.c
757
if (arc4random_uniform(1U << RRDP_RANDOM_REINIT_MAX) < (1U << weeks)) {
usr.sbin/smtpd/smtp_session.c
2276
tv.tv_usec = arc4random_uniform(1000000);
usr.sbin/unbound/smallapp/unbound-anchor.c
715
sel = (int)arc4random_uniform((uint32_t)num);
usr.sbin/unbound/util/random.c
136
return (long)arc4random_uniform((uint32_t)x);