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