mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-01 08:09:49 +08:00
feat(crypto): add crypto library
This commit is contained in:
34
components/wpa_supplicant/include/crypto/random.h
Normal file
34
components/wpa_supplicant/include/crypto/random.h
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Random number generator
|
||||
* Copyright (c) 2010-2011, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef RANDOM_H
|
||||
#define RANDOM_H
|
||||
|
||||
#define CONFIG_NO_RANDOM_POOL
|
||||
|
||||
#ifdef CONFIG_NO_RANDOM_POOL
|
||||
#define random_init(e) do { } while (0)
|
||||
#define random_deinit() do { } while (0)
|
||||
#define random_add_randomness(b, l) do { } while (0)
|
||||
#define random_get_bytes(b, l) os_get_random((b), (l))
|
||||
#define random_pool_ready() 1
|
||||
#define random_mark_pool_ready() do { } while (0)
|
||||
#else /* CONFIG_NO_RANDOM_POOL */
|
||||
void random_init(const char *entropy_file);
|
||||
void random_deinit(void);
|
||||
void random_add_randomness(const void *buf, size_t len);
|
||||
int random_get_bytes(void *buf, size_t len);
|
||||
#endif /* CONFIG_NO_RANDOM_POOL */
|
||||
|
||||
#endif /* RANDOM_H */
|
Reference in New Issue
Block a user