1 /* 2 * Random number generator 3 * Copyright (c) 2010-2011, Jouni Malinen <j@w1.fi> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 * 9 * Alternatively, this software may be distributed under the terms of BSD 10 * license. 11 * 12 * See README and COPYING for more details. 13 */ 14 15 #ifndef RANDOM_H 16 #define RANDOM_H 17 18 #define CONFIG_NO_RANDOM_POOL 19 20 #ifdef CONFIG_NO_RANDOM_POOL 21 #define random_init(e) do { } while (0) 22 #define random_deinit() do { } while (0) 23 #define random_add_randomness(b, l) do { } while (0) 24 #define random_get_bytes(b, l) os_get_random((b), (l)) 25 #define random_pool_ready() 1 26 #define random_mark_pool_ready() do { } while (0) 27 #else /* CONFIG_NO_RANDOM_POOL */ 28 void random_init(const char *entropy_file); 29 void random_deinit(void); 30 void random_add_randomness(const void *buf, size_t len); 31 int random_get_bytes(void *buf, size_t len); 32 #endif /* CONFIG_NO_RANDOM_POOL */ 33 34 #endif /* RANDOM_H */ 35