blob: d13e1c49292d87180c5357e3de795064175852d1 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 * Random number generator
3 * Copyright (c) 2010-2011, Jouni Malinen <j@w1.fi>
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8
9#ifndef RANDOM_H
10#define RANDOM_H
11
12#ifdef CONFIG_NO_RANDOM_POOL
13#define random_init(e) do { } while (0)
14#define random_deinit() do { } while (0)
15#define random_add_randomness(b, l) do { } while (0)
16#define random_get_bytes(b, l) os_get_random((b), (l))
17#define random_pool_ready() 1
18#define random_mark_pool_ready() do { } while (0)
19#else /* CONFIG_NO_RANDOM_POOL */
20void random_init(const char *entropy_file);
21void random_deinit(void);
22void random_add_randomness(const void *buf, size_t len);
23int random_get_bytes(void *buf, size_t len);
24int random_pool_ready(void);
25void random_mark_pool_ready(void);
26#endif /* CONFIG_NO_RANDOM_POOL */
27
28#endif /* RANDOM_H */