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