Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/lib/randgen.h @ 9451:9fff30644260 HEAD
istream-concat: Fixed a lot of bugs.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 26 Oct 2009 17:06:57 -0400 |
parents | e4eb71ae8e96 |
children |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
3040
diff
changeset
|
1 #ifndef RANDGEN_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
3040
diff
changeset
|
2 #define RANDGEN_H |
0 | 3 |
3040
50acbcc7e4d8
Added random_fill_weak() and make random_init() always initialize srand()
Timo Sirainen <tss@iki.fi>
parents:
183
diff
changeset
|
4 /* Fill given buffer with semi-strong randomness, usually from /dev/urandom. */ |
183
4a7ab9e94f25
size_t fixes for lib/. Changed OFF_T_FORMAT to PRIuOFF_T which is more
Timo Sirainen <tss@iki.fi>
parents:
62
diff
changeset
|
5 void random_fill(void *buf, size_t size); |
3040
50acbcc7e4d8
Added random_fill_weak() and make random_init() always initialize srand()
Timo Sirainen <tss@iki.fi>
parents:
183
diff
changeset
|
6 /* Fill given buffer with weak randomness, ie. with rand(). This is better if |
50acbcc7e4d8
Added random_fill_weak() and make random_init() always initialize srand()
Timo Sirainen <tss@iki.fi>
parents:
183
diff
changeset
|
7 no real randomness is required, as reading from /dev/urandom usually also |
50acbcc7e4d8
Added random_fill_weak() and make random_init() always initialize srand()
Timo Sirainen <tss@iki.fi>
parents:
183
diff
changeset
|
8 consumes /dev/random entropy, which may disturb other processes. */ |
50acbcc7e4d8
Added random_fill_weak() and make random_init() always initialize srand()
Timo Sirainen <tss@iki.fi>
parents:
183
diff
changeset
|
9 void random_fill_weak(void *buf, size_t size); |
0 | 10 |
11 /* may be called multiple times */ | |
12 void random_init(void); | |
13 void random_deinit(void); | |
14 | |
15 #endif |