Lines Matching full:rs
66 } *rs; variable
149 if (rs == NULL) { in _rs_init()
151 if ((rs = mmap(NULL, sizeof(*rs), PROT_READ|PROT_WRITE, in _rs_init()
155 if (minherit(rs, sizeof(*rs), MAP_INHERIT_ZERO) == -1) in _rs_init()
159 rs = malloc(sizeof(*rs)); in _rs_init()
160 if(!rs) in _rs_init()
197 if (!rs) in _rs_stir()
204 rs->rs_have = 0; in _rs_stir()
210 rs->rs_count = REKEY_BASE + (rekey_fuzz % REKEY_BASE); in _rs_stir()
223 if (rs) in _rs_stir_if_needed()
224 rs->rs_count = 0; in _rs_stir_if_needed()
227 if (!rs || rs->rs_count <= len) in _rs_stir_if_needed()
229 if (rs->rs_count <= len) in _rs_stir_if_needed()
230 rs->rs_count = 0; in _rs_stir_if_needed()
232 rs->rs_count -= len; in _rs_stir_if_needed()
255 rs->rs_have = sizeof(rsx->rs_buf) - KEYSZ - IVSZ; in _rs_rekey()
267 if (rs->rs_have > 0) { in _rs_random_buf()
268 m = arc4_min(n, rs->rs_have); in _rs_random_buf()
270 - rs->rs_have; in _rs_random_buf()
275 rs->rs_have -= m; in _rs_random_buf()
277 if (rs->rs_have == 0) in _rs_random_buf()
287 if (rs->rs_have < sizeof(*val)) in _rs_random_u32()
289 keystream = rsx->rs_buf + sizeof(rsx->rs_buf) - rs->rs_have; in _rs_random_u32()
292 rs->rs_have -= sizeof(*val); in _rs_random_u32()