File: arc4random.c

package info (click to toggle)
scanssh 2.0-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, jessie, jessie-kfreebsd, lenny, sarge, squeeze, wheezy
  • size: 500 kB
  • ctags: 499
  • sloc: ansic: 4,462; sh: 334; makefile: 68
file content (22 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <sys/types.h>
#include <stdlib.h>

#include "config.h"

/*
 * For those poor operating systems, that do not have a PRNG in their
 * libc.  We do not require cryptographic random numbers for this
 * application anyway.  Screw you, hippy!
 */

u_int32_t
arc4random(void)
{
	static int init;

	if (!init) {
		init = 1;
		srandom(time(NULL));
	}
	return (random());
}