summaryrefslogtreecommitdiff
path: root/src/lib/libc/crypt/arc4random.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/crypt/arc4random.c')
-rw-r--r--src/lib/libc/crypt/arc4random.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c
index 356e231815..e836395803 100644
--- a/src/lib/libc/crypt/arc4random.c
+++ b/src/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random.c,v 1.25 2013/10/01 18:34:57 markus Exp $ */ 1/* $OpenBSD: arc4random.c,v 1.26 2013/10/21 20:33:23 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -158,31 +158,6 @@ _rs_random_u32(u_int32_t *val)
158 return; 158 return;
159} 159}
160 160
161void
162arc4random_stir(void)
163{
164 _ARC4_LOCK();
165 _rs_stir();
166 _ARC4_UNLOCK();
167}
168
169void
170arc4random_addrandom(u_char *dat, int datlen)
171{
172 int m;
173
174 _ARC4_LOCK();
175 if (!rs_initialized)
176 _rs_stir();
177 while (datlen > 0) {
178 m = MIN(datlen, KEYSZ + IVSZ);
179 _rs_rekey(dat, m);
180 dat += m;
181 datlen -= m;
182 }
183 _ARC4_UNLOCK();
184}
185
186u_int32_t 161u_int32_t
187arc4random(void) 162arc4random(void)
188{ 163{