Searched refs:rnd (Results 1 - 25 of 97) sorted by relevance

1234

/openbsd-current/games/robots/
H A Drnd_pos.c47 pos.y = rnd(Y_FIELDSIZE - 1) + 1;
48 pos.x = rnd(X_FIELDSIZE - 1) + 1;
56 rnd(int range) function
H A Drobots.h119 int rnd(int);
/openbsd-current/games/hack/
H A Dhack.mhitu.c100 youswld(mtmp,rnd(6),7,"The lurker above");
130 (!uarm || objects[uarm->otyp].a_can < rnd(3) || !rn2(50));
141 (void) hitu(mtmp,rnd(3));
142 (void) hitu(mtmp,rnd(3));
176 (void) hitu(mtmp,rnd(6));
192 (void) hitu(mtmp,rnd(8));
193 (void) hitu(mtmp,rnd(8));
211 if(17-(u.ulevel/2) > rnd(20)) {
225 nomul(-rnd(10));
230 nomul(-rnd(1
[all...]
H A Drnd.c1 /* $OpenBSD: rnd.c,v 1.5 2009/10/27 23:59:25 deraadt Exp $ */
81 rnd(int x) function
H A Dhack.mkobj.c123 if(!rn2(11)) otmp->spe = rnd(3);
126 otmp->spe = -rnd(3);
134 otmp->spe = rnd(...);
149 if(!rn2(10)) otmp->spe = rnd(3);
151 otmp->spe = -rnd(3);
164 otmp->spe = -rnd(2);
165 } else otmp->spe = rnd(2);
196 long amount = (num ? num : 1 + (rnd(dlevel+2) * rnd(30)));
H A Dhack.potion.c102 multi = -rnd(15);
125 u.uhp += rnd(10);
178 losehp(rnd(10), "contaminated potion");
190 if(u.ustr > 17) u.ustr += rnd(118-u.ustr);
232 Levitation += rnd(100);
261 num = rnd(10);
297 losehp(rnd(2), "thrown potion");
377 Confusion += rnd(5);
384 nomul(-rnd(5));
387 Fast += rnd(
[all...]
H A Dhack.fight.c91 hit = (tmp > rnd(20));
188 if(u.uac + tlev <= rnd(20)) {
210 tmp = rnd(2); /* attack with bare hands */
218 tmp = rnd(2);
221 tmp = rnd(objects[obj->otyp].wldam);
223 else if(obj->otyp == FLAIL) tmp += rnd(4);
225 tmp = rnd(objects[obj->otyp].wsdam);
240 tmp += rnd(10);
243 tmp = rnd(25); break;
272 else tmp = rnd(tm
[all...]
H A Dhack.eat.c142 Glib = rnd(15);
149 u.ustr += rnd( ((u.ustr < 17) ? 19 : 118) - u.ustr);
251 nomul(-rnd(10));
315 u.uhp += rnd(20);
463 losestr(rnd(4));
464 losehp(rnd(15), "poisonous corpse");
470 losehp(rnd(8), "cadaver");
H A Dhack.do.c261 losehp(rnd(3), "fall");
265 losehp(rnd(20), "iron ball");
278 u.ux = rnd(COLNO-1);
285 losehp(rnd(25), "iron ball");
364 losehp(uarmh ? 1 : rnd((int)(obj->owt)), "falling object");
414 if(u.uswallow || tmp >= rnd(20)) {
432 if(u.uswallow || tmp >= rnd(20)) {
/openbsd-current/lib/libcrypto/bn/
H A Dbn_rand.c123 bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) argument
128 if (rnd == NULL) {
143 BN_zero(rnd);
192 if (BN_bin2bn(buf, bytes, rnd) == NULL)
202 BN_rand(BIGNUM *rnd, int bits, int top, int bottom) argument
204 return bnrand(0, rnd, bits, top, bottom);
209 BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom) argument
211 return bnrand(1, rnd, bits, top, bottom);
217 BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) argument
219 return bnrand(2, rnd, bit
292 bn_rand_in_range(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc) argument
315 bn_rand_interval(BIGNUM *rnd, BN_ULONG lower_word, const BIGNUM *upper_exc) argument
[all...]
H A Dbn_prime.c125 static int probable_prime(BIGNUM *rnd, int bits);
126 static int probable_prime_dh(BIGNUM *rnd, int bits,
128 static int probable_prime_dh_safe(BIGNUM *rnd, int bits,
275 probable_prime(BIGNUM *rnd, int bits) argument
282 if (!BN_rand(rnd, bits, 1, 1))
286 BN_ULONG mod = BN_mod_word(rnd, primes[i]);
295 /* check that rnd is not a prime and also
296 * that gcd(rnd-1,primes) == 1 (except for 2) */
304 if (!BN_add_word(rnd, delta))
310 probable_prime_dh(BIGNUM *rnd, in argument
[all...]
/openbsd-current/games/battlestar/
H A Dcommand7.c69 hurt = rnd(70) - 2 * card(injuries, NUMOFINJURIES) - ucard(wear) - exhaustion;
71 hurt = rnd(50) % (WEIGHT - carrying) - card(injuries, NUMOFINJURIES) - encumber - exhaustion;
73 hurt = rnd(15) - card(injuries, NUMOFINJURIES) - exhaustion;
75 hurt = rnd(7) - encumber;
77 switch (rnd(3)) {
90 switch (rnd(3)) {
104 switch (rnd(3)) {
118 switch (rnd(3)) {
120 printf("A bloody gash opens up on his %s side.\n",(rnd(2) ? "left" : "right"));
132 switch (rnd(
[all...]
H A Dfly.c86 row = rnd(LINES - 3) + 1;
87 column = rnd(COLS - 2) + 1;
188 i = rnd(100);
190 r = rnd(LINES - 3) + 1;
191 c = rnd(COLS);
266 row += (rnd(9) - 4) % (4 - abs(row - MIDR));
267 column += (rnd(9) - 4) % (4 - abs(column - MIDC));
H A Dcommand1.c139 fight(ELF, rnd(30));
189 hurt = rnd(NUMOFINJURIES);
254 ourtime += rnd(CYCLE / 4);
257 hurt1 = rnd(NUMOFINJURIES - 2) + 2;
258 hurt2 = rnd(NUMOFINJURIES - 2) + 2;
H A Dcommand5.c178 if (OUTSIDE && rnd(100) < 50) {
180 switch (rnd(4)) {
183 n = rnd(NUMOFOBJECTS);
185 n = rnd(NUMOFOBJECTS);
/openbsd-current/libexec/ld.so/
H A Dutil.c111 u_int32_t rnd; local
113 _dl_arc4randombuf(&rnd, sizeof(rnd));
114 return (rnd);
/openbsd-current/lib/librthread/
H A Drthread_stack.c27 u_int32_t rnd; local
54 rnd = arc4random() & (_thread_pagesize - 1);
56 rnd = arc4random() & (_thread_pagesize / 16 - 1);
58 rnd = 0;
59 rnd &= ~_STACKALIGNBYTES;
66 stack->sp = base + rnd;
68 stack->sp = base + thread->attr.stack_size - (_STACKALIGNBYTES+1) - rnd;
103 stack->sp = base + rnd;
106 stack->sp = base + size - (_STACKALIGNBYTES+1) - rnd;
/openbsd-current/lib/libc/crypt/
H A Darc4random.c90 u_char rnd[KEYSZ + IVSZ]; local
93 if (getentropy(rnd, sizeof rnd) == -1)
97 _rs_init(rnd, sizeof(rnd));
99 _rs_rekey(rnd, sizeof(rnd));
100 explicit_bzero(rnd, sizeof(rnd)); /* discard source seed */
/openbsd-current/sys/arch/sparc64/dev/
H A Dvrng.c138 uint64_t rnd; local
143 if (!pmap_extract(pmap_kernel(), (vaddr_t)&rnd, &addr))
149 printf("vrng: %lx\n", rnd);
151 enqueue_randomness(rnd);
152 enqueue_randomness(rnd >> 32);
/openbsd-current/sys/dev/pci/drm/i915/selftests/
H A Dscatterlist.c39 struct rnd_state *rnd);
43 struct rnd_state *rnd,
53 unsigned int npages = npages_fn(n, pt->st.nents, rnd);
144 struct rnd_state *rnd,
150 err = expect_pfn_sg(pt, npages_fn, rnd, who, timeout);
167 struct rnd_state *rnd)
174 struct rnd_state *rnd)
181 struct rnd_state *rnd)
188 struct rnd_state *rnd)
190 return 1 + (prandom_u32_state(rnd)
41 expect_pfn_sg(struct pfn_table *pt, npages_fn_t npages_fn, struct rnd_state *rnd, const char *who, unsigned long timeout) argument
142 expect_pfn_sgtable(struct pfn_table *pt, npages_fn_t npages_fn, struct rnd_state *rnd, const char *who, unsigned long timeout) argument
165 one(unsigned long n, unsigned long count, struct rnd_state *rnd) argument
172 grow(unsigned long n, unsigned long count, struct rnd_state *rnd) argument
179 shrink(unsigned long n, unsigned long count, struct rnd_state *rnd) argument
186 random(unsigned long n, unsigned long count, struct rnd_state *rnd) argument
193 random_page_size_pages(unsigned long n, unsigned long count, struct rnd_state *rnd) argument
214 alloc_table(struct pfn_table *pt, unsigned long count, unsigned long max, npages_fn_t npages_fn, struct rnd_state *rnd, int alloc_error) argument
[all...]
H A Di915_random.c34 u64 i915_prandom_u64_state(struct rnd_state *rnd) argument
38 x = prandom_u32_state(rnd);
40 x |= prandom_u32_state(rnd);
H A Di915_random.h45 u64 i915_prandom_u64_state(struct rnd_state *rnd);
/openbsd-current/libexec/login_yubikey/
H A Dyubikey.h58 uint16_t rnd; member in struct:__anon8076
/openbsd-current/lib/libssl/test/
H A Dtestgen18 echo "string to make the random number generator think it has entropy" >> ./.rnd
/openbsd-current/sys/kern/
H A Dkern_acct.c265 int exp, rnd; local
268 rnd = 0;
273 rnd = s & (1 << (EXPSIZE - 1)); /* Round up? */
279 if (rnd && (++s > MAXFRACT)) {

Completed in 329 milliseconds

1234