drivers: Rename random
to entropy
This should clear up some of the confusion with random number generators and drivers that obtain entropy from the hardware. Also, many hardware number generators have limited bandwidth, so it's natural for their output to be only used for seeding a random number generator. Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This commit is contained in:
parent
adce1d1888
commit
da9b0ddf5b
114 changed files with 379 additions and 380 deletions
|
@ -74,12 +74,12 @@ config ETH_MCUX
|
|||
|
||||
endif # NET_L2_ETHERNET
|
||||
|
||||
if RANDOM_GENERATOR
|
||||
if ENTROPY_GENERATOR
|
||||
|
||||
config RANDOM_MCUX_RNGA
|
||||
config ENTROPY_MCUX_RNGA
|
||||
def_bool y
|
||||
|
||||
endif # RANDOM_GENERATOR
|
||||
endif # ENTROPY_GENERATOR
|
||||
|
||||
if FLASH
|
||||
|
||||
|
|
|
@ -79,12 +79,12 @@ config SPI_MCUX_DSPI
|
|||
|
||||
endif # SPI
|
||||
|
||||
if RANDOM_GENERATOR
|
||||
if ENTROPY_GENERATOR
|
||||
|
||||
config RANDOM_MCUX_RNGA
|
||||
config ENTROPY_MCUX_RNGA
|
||||
def_bool y
|
||||
|
||||
endif # RANDOM_GENERATOR
|
||||
endif # ENTROPY_GENERATOR
|
||||
|
||||
if FLASH
|
||||
|
||||
|
|
|
@ -57,12 +57,12 @@ config I2C_MCUX
|
|||
|
||||
endif # I2C
|
||||
|
||||
if RANDOM_GENERATOR
|
||||
if ENTROPY_GENERATOR
|
||||
|
||||
config RANDOM_MCUX_TRNG
|
||||
config ENTROPY_MCUX_TRNG
|
||||
def_bool y
|
||||
|
||||
endif # RANDOM_GENERATOR
|
||||
endif # ENTROPY_GENERATOR
|
||||
|
||||
if FLASH
|
||||
|
||||
|
|
|
@ -57,12 +57,12 @@ config I2C_MCUX
|
|||
|
||||
endif # I2C
|
||||
|
||||
if RANDOM_GENERATOR
|
||||
if ENTROPY_GENERATOR
|
||||
|
||||
config RANDOM_MCUX_TRNG
|
||||
config ENTROPY_MCUX_TRNG
|
||||
def_bool y
|
||||
|
||||
endif # RANDOM_GENERATOR
|
||||
endif # ENTROPY_GENERATOR
|
||||
|
||||
if FLASH
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <stm32f4xx_ll_i2c.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RANDOM_STM32_RNG
|
||||
#ifdef CONFIG_ENTROPY_STM32_RNG
|
||||
#include <stm32f4xx_ll_rng.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ ti_ccfg[CCFG_SIZE / sizeof(u32_t)] = {
|
|||
static const u32_t clkloadctl =
|
||||
REG_ADDR(TI_CC2650_PRCM_40082000_BASE_ADDRESS,
|
||||
CC2650_PRCM_CLKLOADCTL);
|
||||
#ifdef CONFIG_CC2650_TRNG_RANDOM_GENERATOR
|
||||
#ifdef CONFIG_CC2650_TRNG_ENTROPY_GENERATOR
|
||||
static const u32_t secdmaclkgr =
|
||||
REG_ADDR(TI_CC2650_PRCM_40082000_BASE_ADDRESS,
|
||||
CC2650_PRCM_SECDMACLKGR);
|
||||
|
@ -90,11 +90,11 @@ static const u32_t uartclkgr =
|
|||
static void setup_modules_prcm(void)
|
||||
{
|
||||
#if defined(CONFIG_GPIO_CC2650) || \
|
||||
defined(CONFIG_CC2650_TRNG_RANDOM_GENERATOR) || \
|
||||
defined(CONFIG_CC2650_TRNG_ENTROPY_GENERATOR) || \
|
||||
defined(CONFIG_SERIAL)
|
||||
|
||||
/* Setup power */
|
||||
#if defined(CONFIG_GPIO_CC2650) || defined(CONFIG_CC2650_TRNG_RANDOM_GENERATOR)
|
||||
#if defined(CONFIG_GPIO_CC2650) || defined(CONFIG_CC2650_TRNG_ENTROPY_GENERATOR)
|
||||
sys_set_bit(pdctl0, CC2650_PRCM_PDCTL0_PERIPH_ON_POS);
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL
|
||||
|
@ -105,7 +105,7 @@ static void setup_modules_prcm(void)
|
|||
#ifdef CONFIG_GPIO_CC2650
|
||||
sys_set_bit(gpioclkgr, CC2650_PRCM_GPIOCLKGR_CLK_EN_POS);
|
||||
#endif
|
||||
#ifdef CONFIG_CC2650_TRNG_RANDOM_GENERATOR
|
||||
#ifdef CONFIG_CC2650_TRNG_ENTROPY_GENERATOR
|
||||
sys_set_bit(secdmaclkgr, CC2650_PRCM_SECDMACLKGR_TRNG_CLK_EN_POS);
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL
|
||||
|
@ -117,7 +117,7 @@ static void setup_modules_prcm(void)
|
|||
/* Wait for power to be completely on, to avoid bus faults
|
||||
* when accessing modules' registers.
|
||||
*/
|
||||
#if defined(CONFIG_GPIO_CC2650) || defined(CONFIG_CC2650_TRNG_RANDOM_GENERATOR)
|
||||
#if defined(CONFIG_GPIO_CC2650) || defined(CONFIG_CC2650_TRNG_ENTROPY_GENERATOR)
|
||||
while (!(sys_read32(pdstat0) &
|
||||
BIT(CC2650_PRCM_PDSTAT0_PERIPH_ON_POS))) {
|
||||
continue;
|
||||
|
|
|
@ -40,6 +40,6 @@ CONFIG_CONSOLE=y
|
|||
CONFIG_UART_CONSOLE=y
|
||||
|
||||
# Random number generator driver
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_CC2650_TRNG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_CC2650_TRNG_ENTROPY_GENERATOR=y
|
||||
CONFIG_CC2650_TRNG_IRQ_PRIO=0
|
||||
|
|
|
@ -39,9 +39,9 @@ CONFIG_CLOCK_STM32_APB1_PRESCALER=4
|
|||
CONFIG_CLOCK_STM32_APB2_PRESCALER=2
|
||||
|
||||
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
# CONFIG_RANDOM_HAS_DRIVER is not set
|
||||
CONFIG_RANDOM_NAME="RANDOM_0"
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
# CONFIG_ENTROPY_HAS_DRIVER is not set
|
||||
CONFIG_ENTROPY_NAME="ENTROPY_0"
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_TIMER_RANDOM_GENERATOR=y
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ CONFIG_CLOCK_STM32_APB1_PRESCALER=4
|
|||
CONFIG_CLOCK_STM32_APB2_PRESCALER=2
|
||||
|
||||
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
# CONFIG_RANDOM_HAS_DRIVER is not set
|
||||
CONFIG_RANDOM_NAME="RANDOM_0"
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
# CONFIG_ENTROPY_HAS_DRIVER is not set
|
||||
CONFIG_ENTROPY_NAME="ENTROPY_0"
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_TIMER_RANDOM_GENERATOR=y
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ CONFIG_PINMUX_ESP32=y
|
|||
CONFIG_GPIO=y
|
||||
CONFIG_GPIO_ESP32=y
|
||||
|
||||
CONFIG_RANDOM_ESP32_RNG=y
|
||||
CONFIG_ENTROPY_ESP32_RNG=y
|
||||
|
||||
CONFIG_SW_ISR_TABLE=y
|
||||
CONFIG_GEN_ISR_TABLES=y
|
||||
|
|
|
@ -60,10 +60,10 @@ SPI Interface
|
|||
.. doxygengroup:: spi_interface
|
||||
:project: Zephyr
|
||||
|
||||
Random Interface
|
||||
****************
|
||||
Entropy Interface
|
||||
*****************
|
||||
|
||||
.. doxygengroup:: random_interface
|
||||
.. doxygengroup:: entropy_interface
|
||||
:project: Zephyr
|
||||
|
||||
UART Interface
|
||||
|
|
|
@ -30,7 +30,7 @@ source "drivers/interrupt_controller/Kconfig"
|
|||
|
||||
source "drivers/timer/Kconfig"
|
||||
|
||||
source "drivers/random/Kconfig"
|
||||
source "drivers/entropy/Kconfig"
|
||||
|
||||
source "drivers/grove/Kconfig"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
subdir-ccflags-y += -I$(srctree)/include/drivers
|
||||
|
||||
obj-y = console/
|
||||
obj-y += random/
|
||||
obj-y += entropy/
|
||||
obj-y += serial/
|
||||
obj-y += display/
|
||||
obj-$(CONFIG_SYS_CLOCK_EXISTS) += timer/
|
||||
|
|
49
drivers/entropy/Kconfig
Normal file
49
drivers/entropy/Kconfig
Normal file
|
@ -0,0 +1,49 @@
|
|||
# Kconfig - entropy generator driver configuration options
|
||||
|
||||
#
|
||||
# Copyright (c) 2014-2015 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
menuconfig ENTROPY_GENERATOR
|
||||
bool
|
||||
prompt "Entropy Drivers"
|
||||
default n
|
||||
help
|
||||
Include entropy drivers in system config.
|
||||
|
||||
if ENTROPY_GENERATOR
|
||||
|
||||
source "drivers/entropy/Kconfig.mcux"
|
||||
source "drivers/entropy/Kconfig.stm32"
|
||||
source "drivers/entropy/Kconfig.esp32"
|
||||
|
||||
config ENTROPY_HAS_DRIVER
|
||||
bool
|
||||
default n
|
||||
help
|
||||
This is an option to be enabled by individual entropy driver
|
||||
to signal that there is a true entropy driver.
|
||||
|
||||
config ENTROPY_NAME
|
||||
string "Entropy Device Name"
|
||||
default "ENTROPY_0"
|
||||
help
|
||||
Specify the device name to be used for the ENTROPY driver.
|
||||
|
||||
config SYS_LOG_ENTROPY_LEVEL
|
||||
int "Random Log level"
|
||||
depends on SYS_LOG
|
||||
default 0
|
||||
range 0 4
|
||||
help
|
||||
Sets log level for entropy driver.
|
||||
Levels are:
|
||||
- 0 OFF: do not write
|
||||
- 1 ERROR: only write SYS_LOG_ERR
|
||||
- 2 WARNING: write SYS_LOG_WRN in addition to previous level
|
||||
- 3 INFO: write SYS_LOG_INF in addition to previous levels
|
||||
- 4 DEBUG: write SYS_LOG_DBG in addition to previous levels
|
||||
|
||||
endif
|
18
drivers/entropy/Kconfig.esp32
Normal file
18
drivers/entropy/Kconfig.esp32
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Kconfig.esp32 - esp32 entropy generator driver configuration
|
||||
#
|
||||
# Copyright (c) 2017 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config ENTROPY_ESP32_RNG
|
||||
bool "ESP32 entropy number generator driver"
|
||||
depends on ENTROPY_GENERATOR && SOC_ESP32
|
||||
default n
|
||||
select ENTROPY_HAS_DRIVER
|
||||
select ENTROPY_DEVICE_ENTROPY_GENERATOR
|
||||
help
|
||||
This option enables the entropy number generator for ESP32 SoCs.
|
||||
|
||||
With Wi-Fi and Bluetooth disabled, this will produce pseudo-entropy
|
||||
numbers: noise from these radios are used to feed entropy in this
|
||||
generator.
|
|
@ -1,23 +1,23 @@
|
|||
# Kconfig.mcux - mcux random generator driver configuration
|
||||
# Kconfig.mcux - mcux entropy generator driver configuration
|
||||
#
|
||||
# Copyright (c) 2016 ARM Ltd.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
menuconfig RANDOM_MCUX_RNGA
|
||||
menuconfig ENTROPY_MCUX_RNGA
|
||||
bool "MCUX RNGA driver"
|
||||
depends on RANDOM_GENERATOR && HAS_MCUX_RNGA
|
||||
depends on ENTROPY_GENERATOR && HAS_MCUX_RNGA
|
||||
default n
|
||||
select RANDOM_HAS_DRIVER
|
||||
select ENTROPY_HAS_DRIVER
|
||||
help
|
||||
This option enables the random number generator accelerator (RNGA)
|
||||
driver based on the MCUX RNGA driver.
|
||||
|
||||
menuconfig RANDOM_MCUX_TRNG
|
||||
menuconfig ENTROPY_MCUX_TRNG
|
||||
bool "MCUX TRNG driver"
|
||||
depends on RANDOM_GENERATOR && HAS_MCUX_TRNG
|
||||
depends on ENTROPY_GENERATOR && HAS_MCUX_TRNG
|
||||
default n
|
||||
select RANDOM_HAS_DRIVER
|
||||
select ENTROPY_HAS_DRIVER
|
||||
help
|
||||
This option enables the true random number generator (TRNG)
|
||||
driver based on the MCUX TRNG driver.
|
16
drivers/entropy/Kconfig.stm32
Normal file
16
drivers/entropy/Kconfig.stm32
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Kconfig.stm32 - STM32 entropy generator driver configuration
|
||||
#
|
||||
# Copyright (c) 2017 Erwin Rol <erwin@erwinrol.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
menuconfig ENTROPY_STM32_RNG
|
||||
bool "STM32 RNG driver"
|
||||
depends on ENTROPY_GENERATOR
|
||||
default n
|
||||
select ENTROPY_HAS_DRIVER
|
||||
select ENTROPY_DEVICE_ENTROPY_GENERATOR
|
||||
help
|
||||
This option enables the RNG processor, which is a entropy number
|
||||
generator, based on a continuous analog noise, that provides
|
||||
a entropy 32-bit value to the host when read.
|
5
drivers/entropy/Makefile
Normal file
5
drivers/entropy/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
obj-$(CONFIG_ENTROPY_MCUX_RNGA) += entropy_mcux_rnga.o
|
||||
obj-$(CONFIG_ENTROPY_MCUX_TRNG) += entropy_mcux_trng.o
|
||||
obj-$(CONFIG_ENTROPY_STM32_RNG) += entropy_stm32.o
|
||||
obj-$(CONFIG_ENTROPY_ESP32_RNG) += entropy_esp32.o
|
||||
obj-$(CONFIG_USERSPACE) += entropy_handlers.o
|
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <random.h>
|
||||
#include <entropy.h>
|
||||
|
||||
static inline u32_t random_esp32_get_u32(void)
|
||||
static inline u32_t entropy_esp32_get_u32(void)
|
||||
{
|
||||
/* The documentation specifies the random number generator at the
|
||||
* following address, which is at odds with the SDK, that specifies
|
||||
|
@ -25,10 +25,10 @@ static inline u32_t random_esp32_get_u32(void)
|
|||
return *rng_data_reg;
|
||||
}
|
||||
|
||||
static int random_esp32_get_entropy(struct device *device, u8_t *buf, u16_t len)
|
||||
static int entropy_esp32_get_entropy(struct device *device, u8_t *buf, u16_t len)
|
||||
{
|
||||
while (len) {
|
||||
u32_t v = random_esp32_get_u32();
|
||||
u32_t v = entropy_esp32_get_u32();
|
||||
|
||||
if (len >= sizeof(v)) {
|
||||
memcpy(buf, &v, sizeof(v));
|
||||
|
@ -44,19 +44,19 @@ static int random_esp32_get_entropy(struct device *device, u8_t *buf, u16_t len)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int random_esp32_init(struct device *device)
|
||||
static int entropy_esp32_init(struct device *device)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct random_driver_api random_esp32_api_funcs = {
|
||||
.get_entropy = random_esp32_get_entropy
|
||||
static struct entropy_driver_api entropy_esp32_api_funcs = {
|
||||
.get_entropy = entropy_esp32_get_entropy
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(random_esp32, CONFIG_RANDOM_NAME,
|
||||
random_esp32_init, NULL, NULL,
|
||||
DEVICE_AND_API_INIT(entropy_esp32, CONFIG_ENTROPY_NAME,
|
||||
entropy_esp32_init, NULL, NULL,
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&random_esp32_api_funcs);
|
||||
&entropy_esp32_api_funcs);
|
||||
|
||||
u32_t sys_rand32_get(void)
|
||||
{
|
16
drivers/entropy/entropy_handlers.c
Normal file
16
drivers/entropy/entropy_handlers.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2017 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <entropy.h>
|
||||
#include <syscall_handler.h>
|
||||
|
||||
_SYSCALL_HANDLER(entropy_get_entropy, dev, buffer, len)
|
||||
{
|
||||
_SYSCALL_OBJ(dev, K_OBJ_DRIVER_ENTROPY);
|
||||
_SYSCALL_MEMORY_WRITE(buffer, len);
|
||||
return _impl_entropy_get_entropy((struct device *)dev, (u8_t *)buffer,
|
||||
len);
|
||||
}
|
|
@ -5,13 +5,13 @@
|
|||
*/
|
||||
|
||||
#include <device.h>
|
||||
#include <random.h>
|
||||
#include <entropy.h>
|
||||
#include <random/rand32.h>
|
||||
#include <init.h>
|
||||
|
||||
#include "fsl_rnga.h"
|
||||
|
||||
static u8_t random_mcux_rnga_get_uint8(void)
|
||||
static u8_t entropy_mcux_rnga_get_uint8(void)
|
||||
{
|
||||
u32_t random;
|
||||
u8_t output = 0;
|
||||
|
@ -36,7 +36,7 @@ static u8_t random_mcux_rnga_get_uint8(void)
|
|||
return output;
|
||||
}
|
||||
|
||||
static int random_mcux_rnga_get_entropy(struct device *dev, u8_t *buffer,
|
||||
static int entropy_mcux_rnga_get_entropy(struct device *dev, u8_t *buffer,
|
||||
u16_t length)
|
||||
{
|
||||
int i;
|
||||
|
@ -44,24 +44,24 @@ static int random_mcux_rnga_get_entropy(struct device *dev, u8_t *buffer,
|
|||
ARG_UNUSED(dev);
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
buffer[i] = random_mcux_rnga_get_uint8();
|
||||
buffer[i] = entropy_mcux_rnga_get_uint8();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct random_driver_api random_mcux_rnga_api_funcs = {
|
||||
.get_entropy = random_mcux_rnga_get_entropy
|
||||
static const struct entropy_driver_api entropy_mcux_rnga_api_funcs = {
|
||||
.get_entropy = entropy_mcux_rnga_get_entropy
|
||||
};
|
||||
|
||||
static int random_mcux_rnga_init(struct device *);
|
||||
static int entropy_mcux_rnga_init(struct device *);
|
||||
|
||||
DEVICE_AND_API_INIT(random_mcux_rnga, CONFIG_RANDOM_NAME,
|
||||
random_mcux_rnga_init, NULL, NULL,
|
||||
DEVICE_AND_API_INIT(entropy_mcux_rnga, CONFIG_ENTROPY_NAME,
|
||||
entropy_mcux_rnga_init, NULL, NULL,
|
||||
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&random_mcux_rnga_api_funcs);
|
||||
&entropy_mcux_rnga_api_funcs);
|
||||
|
||||
static int random_mcux_rnga_init(struct device *dev)
|
||||
static int entropy_mcux_rnga_init(struct device *dev)
|
||||
{
|
||||
u32_t seed = k_cycle_get_32();
|
||||
|
|
@ -5,14 +5,14 @@
|
|||
*/
|
||||
|
||||
#include <device.h>
|
||||
#include <random.h>
|
||||
#include <entropy.h>
|
||||
#include <random/rand32.h>
|
||||
#include <init.h>
|
||||
|
||||
#include "fsl_trng.h"
|
||||
|
||||
static int random_mcux_trng_get_entropy(struct device *dev, u8_t *buffer,
|
||||
u16_t length)
|
||||
static int entropy_mcux_trng_get_entropy(struct device *dev, u8_t *buffer,
|
||||
u16_t length)
|
||||
{
|
||||
status_t status;
|
||||
|
||||
|
@ -24,18 +24,18 @@ static int random_mcux_trng_get_entropy(struct device *dev, u8_t *buffer,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct random_driver_api random_mcux_trng_api_funcs = {
|
||||
.get_entropy = random_mcux_trng_get_entropy
|
||||
static const struct entropy_driver_api entropy_mcux_trng_api_funcs = {
|
||||
.get_entropy = entropy_mcux_trng_get_entropy
|
||||
};
|
||||
|
||||
static int random_mcux_trng_init(struct device *);
|
||||
static int entropy_mcux_trng_init(struct device *);
|
||||
|
||||
DEVICE_AND_API_INIT(random_mcux_trng, CONFIG_RANDOM_NAME,
|
||||
random_mcux_trng_init, NULL, NULL,
|
||||
DEVICE_AND_API_INIT(entropy_mcux_trng, CONFIG_ENTROPY_NAME,
|
||||
entropy_mcux_trng_init, NULL, NULL,
|
||||
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&random_mcux_trng_api_funcs);
|
||||
&entropy_mcux_trng_api_funcs);
|
||||
|
||||
static int random_mcux_trng_init(struct device *dev)
|
||||
static int entropy_mcux_trng_init(struct device *dev)
|
||||
{
|
||||
trng_config_t conf;
|
||||
status_t status;
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <kernel.h>
|
||||
#include <device.h>
|
||||
#include <random.h>
|
||||
#include <entropy.h>
|
||||
#include <random/rand32.h>
|
||||
#include <init.h>
|
||||
#include <misc/__assert.h>
|
||||
|
@ -17,22 +17,22 @@
|
|||
#include <clock_control.h>
|
||||
#include <clock_control/stm32_clock_control.h>
|
||||
|
||||
struct random_stm32_rng_dev_cfg {
|
||||
struct entropy_stm32_rng_dev_cfg {
|
||||
struct stm32_pclken pclken;
|
||||
};
|
||||
|
||||
struct random_stm32_rng_dev_data {
|
||||
struct entropy_stm32_rng_dev_data {
|
||||
RNG_TypeDef *rng;
|
||||
struct device *clock;
|
||||
};
|
||||
|
||||
#define DEV_DATA(dev) \
|
||||
((struct random_stm32_rng_dev_data *)(dev)->driver_data)
|
||||
((struct entropy_stm32_rng_dev_data *)(dev)->driver_data)
|
||||
|
||||
#define DEV_CFG(dev) \
|
||||
((struct random_stm32_rng_dev_cfg *)(dev)->config->config_info)
|
||||
((struct entropy_stm32_rng_dev_cfg *)(dev)->config->config_info)
|
||||
|
||||
static void random_stm32_rng_reset(RNG_TypeDef *rng)
|
||||
static void entropy_stm32_rng_reset(RNG_TypeDef *rng)
|
||||
{
|
||||
__ASSERT_NO_MSG(rng != NULL);
|
||||
|
||||
|
@ -46,7 +46,7 @@ static void random_stm32_rng_reset(RNG_TypeDef *rng)
|
|||
LL_RNG_Enable(rng);
|
||||
}
|
||||
|
||||
static int random_stm32_got_error(RNG_TypeDef *rng)
|
||||
static int entropy_stm32_got_error(RNG_TypeDef *rng)
|
||||
{
|
||||
__ASSERT_NO_MSG(rng != NULL);
|
||||
|
||||
|
@ -61,7 +61,7 @@ static int random_stm32_got_error(RNG_TypeDef *rng)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int random_stm32_wait_ready(RNG_TypeDef *rng)
|
||||
static int entropy_stm32_wait_ready(RNG_TypeDef *rng)
|
||||
{
|
||||
/* Agording to the reference manual it takes 40 periods
|
||||
* of the RNG_CLK clock signal between two consecutive
|
||||
|
@ -79,7 +79,7 @@ static int random_stm32_wait_ready(RNG_TypeDef *rng)
|
|||
__ASSERT_NO_MSG(rng != NULL);
|
||||
|
||||
while (!LL_RNG_IsActiveFlag_DRDY(rng)) {
|
||||
if (random_stm32_got_error(rng)) {
|
||||
if (entropy_stm32_got_error(rng)) {
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -90,17 +90,17 @@ static int random_stm32_wait_ready(RNG_TypeDef *rng)
|
|||
k_yield();
|
||||
}
|
||||
|
||||
if (random_stm32_got_error(rng)) {
|
||||
if (entropy_stm32_got_error(rng)) {
|
||||
return -EIO;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int random_stm32_rng_get_entropy(struct device *dev, u8_t *buffer,
|
||||
u16_t length)
|
||||
static int entropy_stm32_rng_get_entropy(struct device *dev, u8_t *buffer,
|
||||
u16_t length)
|
||||
{
|
||||
struct random_stm32_rng_dev_data *dev_data;
|
||||
struct entropy_stm32_rng_dev_data *dev_data;
|
||||
int n = sizeof(u32_t);
|
||||
int res;
|
||||
|
||||
|
@ -112,15 +112,15 @@ static int random_stm32_rng_get_entropy(struct device *dev, u8_t *buffer,
|
|||
__ASSERT_NO_MSG(dev_data != NULL);
|
||||
|
||||
/* if the RNG has errors reset it before use */
|
||||
if (random_stm32_got_error(dev_data->rng)) {
|
||||
random_stm32_rng_reset(dev_data->rng);
|
||||
if (entropy_stm32_got_error(dev_data->rng)) {
|
||||
entropy_stm32_rng_reset(dev_data->rng);
|
||||
}
|
||||
|
||||
while (length > 0) {
|
||||
u32_t rndbits;
|
||||
u8_t *p_rndbits = (u8_t *)&rndbits;
|
||||
|
||||
res = random_stm32_wait_ready(dev_data->rng);
|
||||
res = entropy_stm32_wait_ready(dev_data->rng);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
|
@ -139,10 +139,10 @@ static int random_stm32_rng_get_entropy(struct device *dev, u8_t *buffer,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int random_stm32_rng_init(struct device *dev)
|
||||
static int entropy_stm32_rng_init(struct device *dev)
|
||||
{
|
||||
struct random_stm32_rng_dev_data *dev_data;
|
||||
struct random_stm32_rng_dev_cfg *dev_cfg;
|
||||
struct entropy_stm32_rng_dev_data *dev_data;
|
||||
struct entropy_stm32_rng_dev_cfg *dev_cfg;
|
||||
|
||||
__ASSERT_NO_MSG(dev != NULL);
|
||||
|
||||
|
@ -163,24 +163,24 @@ static int random_stm32_rng_init(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct random_driver_api random_stm32_rng_api = {
|
||||
.get_entropy = random_stm32_rng_get_entropy
|
||||
static const struct entropy_driver_api entropy_stm32_rng_api = {
|
||||
.get_entropy = entropy_stm32_rng_get_entropy
|
||||
};
|
||||
|
||||
static const struct random_stm32_rng_dev_cfg random_stm32_rng_config = {
|
||||
static const struct entropy_stm32_rng_dev_cfg entropy_stm32_rng_config = {
|
||||
.pclken = { .bus = STM32_CLOCK_BUS_AHB2,
|
||||
.enr = LL_AHB2_GRP1_PERIPH_RNG },
|
||||
};
|
||||
|
||||
static struct random_stm32_rng_dev_data random_stm32_rng_data = {
|
||||
static struct entropy_stm32_rng_dev_data entropy_stm32_rng_data = {
|
||||
.rng = RNG,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(random_stm32_rng, CONFIG_RANDOM_NAME,
|
||||
random_stm32_rng_init,
|
||||
&random_stm32_rng_data, &random_stm32_rng_config,
|
||||
DEVICE_AND_API_INIT(entropy_stm32_rng, CONFIG_ENTROPY_NAME,
|
||||
entropy_stm32_rng_init,
|
||||
&entropy_stm32_rng_data, &entropy_stm32_rng_config,
|
||||
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&random_stm32_rng_api);
|
||||
&entropy_stm32_rng_api);
|
||||
|
||||
u32_t sys_rand32_get(void)
|
||||
{
|
||||
|
@ -193,4 +193,3 @@ u32_t sys_rand32_get(void)
|
|||
|
||||
return output;
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ config ETH_MCUX_0_IRQ_PRI
|
|||
|
||||
config ETH_MCUX_0_RANDOM_MAC
|
||||
bool "Random MAC address"
|
||||
depends on ETH_MCUX_0 && RANDOM_GENERATOR
|
||||
depends on ETH_MCUX_0 && ENTROPY_GENERATOR
|
||||
default y
|
||||
help
|
||||
Generate a random MAC address dynamically.
|
||||
|
|
|
@ -50,7 +50,7 @@ config ETH_STM32_HAL_PHY_ADDRESS
|
|||
|
||||
config ETH_STM32_HAL_RANDOM_MAC
|
||||
bool "Random MAC address"
|
||||
depends on ETH_STM32_HAL && RANDOM_GENERATOR
|
||||
depends on ETH_STM32_HAL && ENTROPY_GENERATOR
|
||||
default y
|
||||
help
|
||||
Generate a random MAC address dynamically.
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
# Kconfig - random generator driver configuration options
|
||||
|
||||
#
|
||||
# Copyright (c) 2014-2015 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
menuconfig RANDOM_GENERATOR
|
||||
bool
|
||||
prompt "Random Drivers"
|
||||
default n
|
||||
help
|
||||
Include RANDOM drivers in system config.
|
||||
|
||||
if RANDOM_GENERATOR
|
||||
|
||||
source "drivers/random/Kconfig.mcux"
|
||||
source "drivers/random/Kconfig.stm32"
|
||||
source "drivers/random/Kconfig.esp32"
|
||||
|
||||
config RANDOM_HAS_DRIVER
|
||||
bool
|
||||
default n
|
||||
help
|
||||
This is an option to be enabled by individual random driver
|
||||
to signal that there is a true random driver.
|
||||
|
||||
config RANDOM_NAME
|
||||
string "Random Device Name"
|
||||
depends on RANDOM_GENERATOR
|
||||
default "RANDOM_0"
|
||||
help
|
||||
Specify the device name to be used for the RANDOM driver.
|
||||
|
||||
config SYS_LOG_RANDOM_LEVEL
|
||||
int "Random Log level"
|
||||
depends on SYS_LOG && RANDOM_GENERATOR
|
||||
default 0
|
||||
range 0 4
|
||||
help
|
||||
Sets log level for random driver.
|
||||
Levels are:
|
||||
- 0 OFF: do not write
|
||||
- 1 ERROR: only write SYS_LOG_ERR
|
||||
- 2 WARNING: write SYS_LOG_WRN in addition to previous level
|
||||
- 3 INFO: write SYS_LOG_INF in addition to previous levels
|
||||
- 4 DEBUG: write SYS_LOG_DBG in addition to previous levels
|
||||
|
||||
endif
|
|
@ -1,17 +0,0 @@
|
|||
# Kconfig.esp32 - esp32 random generator driver configuration
|
||||
#
|
||||
# Copyright (c) 2017 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config RANDOM_ESP32_RNG
|
||||
bool "ESP32 random number generator driver"
|
||||
depends on RANDOM_GENERATOR && SOC_ESP32
|
||||
default n
|
||||
select RANDOM_HAS_DRIVER
|
||||
help
|
||||
This option enables the random number generator for ESP32 SoCs.
|
||||
|
||||
With Wi-Fi and Bluetooth disabled, this will produce pseudo-random
|
||||
numbers: noise from these radios are used to feed entropy in this
|
||||
generator.
|
|
@ -1,15 +0,0 @@
|
|||
# Kconfig.stm32 - STM32 random generator driver configuration
|
||||
#
|
||||
# Copyright (c) 2017 Erwin Rol <erwin@erwinrol.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
menuconfig RANDOM_STM32_RNG
|
||||
bool "STM32 RNG driver"
|
||||
depends on RANDOM_GENERATOR
|
||||
default n
|
||||
select RANDOM_HAS_DRIVER
|
||||
help
|
||||
This option enables the RNG processor, which is a random number
|
||||
generator, based on a continuous analog noise, that provides
|
||||
a random 32-bit value to the host when read.
|
|
@ -1,6 +0,0 @@
|
|||
obj-$(CONFIG_RANDOM_MCUX_RNGA) += random_mcux_rnga.o
|
||||
obj-$(CONFIG_RANDOM_MCUX_TRNG) += random_mcux_trng.o
|
||||
obj-$(CONFIG_RANDOM_STM32_RNG) += random_stm32_rng.o
|
||||
obj-$(CONFIG_RANDOM_ESP32_RNG) += random_esp32.o
|
||||
|
||||
obj-$(CONFIG_USERSPACE) += random_handlers.o
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <random.h>
|
||||
#include <syscall_handler.h>
|
||||
|
||||
_SYSCALL_HANDLER(random_get_entropy, dev, buffer, len)
|
||||
{
|
||||
_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RANDOM);
|
||||
_SYSCALL_MEMORY_WRITE(buffer, len);
|
||||
return _impl_random_get_entropy((struct device *)dev, (u8_t *)buffer,
|
||||
len);
|
||||
}
|
|
@ -8,8 +8,8 @@ obj-$(CONFIG_ADC_MCUX_ADC16) += fsl_adc16.o
|
|||
obj-$(CONFIG_ETH_MCUX) += fsl_enet.o
|
||||
obj-$(CONFIG_I2C_MCUX) += fsl_i2c.o
|
||||
obj-$(CONFIG_PWM_MCUX_FTM) += fsl_ftm.o
|
||||
obj-$(CONFIG_RANDOM_MCUX_RNGA) += fsl_rnga.o
|
||||
obj-$(CONFIG_RANDOM_MCUX_TRNG) += fsl_trng.o
|
||||
obj-$(CONFIG_ENTROPY_MCUX_RNGA) += fsl_rnga.o
|
||||
obj-$(CONFIG_ENTROPY_MCUX_TRNG) += fsl_trng.o
|
||||
obj-$(CONFIG_SOC_FLASH_MCUX) += fsl_flash.o
|
||||
obj-$(CONFIG_SPI_MCUX_DSPI) += fsl_dspi.o
|
||||
obj-$(CONFIG_UART_MCUX) += fsl_uart.o
|
||||
|
|
|
@ -34,7 +34,7 @@ obj-$(CONFIG_CLOCK_CONTROL_STM32_CUBE) += stm32f4xx/drivers/src/stm32f4xx_ll_uti
|
|||
obj-$(CONFIG_PWM) += stm32f4xx/drivers/src/stm32f4xx_hal_tim.o
|
||||
obj-$(CONFIG_I2C) += stm32f4xx/drivers/src/stm32f4xx_ll_i2c.o
|
||||
obj-$(CONFIG_SPI_STM32) += stm32f4xx/drivers/src/stm32f4xx_ll_spi.o
|
||||
obj-$(CONFIG_RANDOM_STM32_RNG) += stm32f4xx/drivers/src/stm32f4xx_ll_rng.o
|
||||
obj-$(CONFIG_ENTROPY_STM32_RNG) += stm32f4xx/drivers/src/stm32f4xx_ll_rng.o
|
||||
obj-$(CONFIG_ETH_STM32_HAL) += stm32f4xx/drivers/src/stm32f4xx_hal_eth.o
|
||||
obj-$(CONFIG_USB_DC_STM32) += stm32f4xx/drivers/src/stm32f4xx_ll_usb.o \
|
||||
stm32f4xx/drivers/src/stm32f4xx_hal_pcd.o \
|
||||
|
|
|
@ -53,7 +53,7 @@ config TINYCRYPT_ECC_DH
|
|||
bool
|
||||
prompt "ECC_DH anonymous key agreement protocol"
|
||||
depends on TINYCRYPT
|
||||
select RANDOM_GENERATOR
|
||||
select ENTROPY_GENERATOR
|
||||
default n
|
||||
help
|
||||
This option enables support for the Elliptic curve
|
||||
|
@ -66,7 +66,7 @@ config TINYCRYPT_ECC_DSA
|
|||
bool
|
||||
prompt "ECC_DSA digital signature algorithm"
|
||||
depends on TINYCRYPT
|
||||
select RANDOM_GENERATOR
|
||||
select ENTROPY_GENERATOR
|
||||
default n
|
||||
help
|
||||
This option enables support for the Elliptic Curve Digital
|
||||
|
|
77
include/entropy.h
Normal file
77
include/entropy.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
/**
|
||||
* @file entropy.h
|
||||
*
|
||||
* @brief Public APIs for the entropy driver.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016 ARM Ltd.
|
||||
* Copyright (c) 2017 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __ENTROPY_H__
|
||||
#define __ENTROPY_H__
|
||||
|
||||
/**
|
||||
* @brief Entropy Interface
|
||||
* @defgroup entropy_interface Entropy Interface
|
||||
* @ingroup io_interfaces
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <zephyr/types.h>
|
||||
#include <device.h>
|
||||
|
||||
/**
|
||||
* @typedef entropy_get_entropy_t
|
||||
* @brief Callback API to get entropy.
|
||||
*
|
||||
* See entropy_get_entropy() for argument description
|
||||
*/
|
||||
typedef int (*entropy_get_entropy_t)(struct device *dev,
|
||||
u8_t *buffer,
|
||||
u16_t length);
|
||||
|
||||
struct entropy_driver_api {
|
||||
entropy_get_entropy_t get_entropy;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Fills a buffer with entropy.
|
||||
*
|
||||
* @param dev Pointer to the entropy device.
|
||||
* @param buffer Buffer to fill with entropy.
|
||||
* @param length Buffer length.
|
||||
* @retval 0 on success.
|
||||
* @retval -ERRNO errno code on error.
|
||||
*/
|
||||
__syscall int entropy_get_entropy(struct device *dev,
|
||||
u8_t *buffer,
|
||||
u16_t length);
|
||||
|
||||
static inline int _impl_entropy_get_entropy(struct device *dev,
|
||||
u8_t *buffer,
|
||||
u16_t length)
|
||||
{
|
||||
const struct entropy_driver_api *api = dev->driver_api;
|
||||
|
||||
__ASSERT(api->get_entropy, "Callback pointer should not be NULL");
|
||||
return api->get_entropy(dev, buffer, length);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <syscalls/entropy.h>
|
||||
|
||||
#endif /* __ENTROPY_H__ */
|
|
@ -156,7 +156,7 @@ enum k_objects {
|
|||
K_OBJ_DRIVER_IPM,
|
||||
K_OBJ_DRIVER_PINMUX,
|
||||
K_OBJ_DRIVER_PWM,
|
||||
K_OBJ_DRIVER_RANDOM,
|
||||
K_OBJ_DRIVER_ENTROPY,
|
||||
K_OBJ_DRIVER_RTC,
|
||||
K_OBJ_DRIVER_SENSOR,
|
||||
K_OBJ_DRIVER_SPI,
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
/**
|
||||
* @file random.h
|
||||
*
|
||||
* @brief Public APIs for the random driver.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016 ARM Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __RANDOM_H__
|
||||
#define __RANDOM_H__
|
||||
|
||||
/**
|
||||
* @brief Random Interface
|
||||
* @defgroup random_interface Random Interface
|
||||
* @ingroup io_interfaces
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <zephyr/types.h>
|
||||
#include <device.h>
|
||||
|
||||
/**
|
||||
* @typedef random_get_entropy_t
|
||||
* @brief Callback API to get entropy.
|
||||
*
|
||||
* See random_get_entropy() for argument description
|
||||
*/
|
||||
typedef int (*random_get_entropy_t)(struct device *dev,
|
||||
u8_t *buffer,
|
||||
u16_t length);
|
||||
|
||||
struct random_driver_api {
|
||||
random_get_entropy_t get_entropy;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Get entropy from the random driver.
|
||||
*
|
||||
* Fill a buffer with entropy from the random driver.
|
||||
*
|
||||
* @param dev Pointer to the random device.
|
||||
* @param buffer Buffer to fill with entropy.
|
||||
* @param length Buffer length.
|
||||
* @retval 0 on success.
|
||||
* @retval -ERRNO errno code on error.
|
||||
*/
|
||||
__syscall int random_get_entropy(struct device *dev, u8_t *buffer,
|
||||
u16_t length);
|
||||
|
||||
static inline int _impl_random_get_entropy(struct device *dev,
|
||||
u8_t *buffer,
|
||||
u16_t length)
|
||||
{
|
||||
const struct random_driver_api *api = dev->driver_api;
|
||||
|
||||
__ASSERT(api->get_entropy, "Callback pointer should not be NULL");
|
||||
return api->get_entropy(dev, buffer, length);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <syscalls/random.h>
|
||||
|
||||
#endif /* __RANDOM_H__ */
|
|
@ -67,8 +67,8 @@ const char *otype_to_str(enum k_objects otype)
|
|||
return "pinmux driver";
|
||||
case K_OBJ_DRIVER_PWM:
|
||||
return "pwm driver";
|
||||
case K_OBJ_DRIVER_RANDOM:
|
||||
return "random driver";
|
||||
case K_OBJ_DRIVER_ENTROPY:
|
||||
return "entropy driver";
|
||||
case K_OBJ_DRIVER_RTC:
|
||||
return "realtime clock driver";
|
||||
case K_OBJ_DRIVER_SENSOR:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_BT=y
|
||||
CONFIG_BT_PERIPHERAL=y
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Title: Random
|
||||
Title: Entropy
|
||||
|
||||
Description:
|
||||
|
||||
A simple random number generation example
|
||||
Sample for the entropy gathering driver
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -17,7 +17,7 @@ It can be built and executed on frdm_k64f as follows:
|
|||
|
||||
Sample Output:
|
||||
|
||||
Random Example! arm
|
||||
random device is 0x2000008c, name is RANDOM_0
|
||||
Entropy Example! arm
|
||||
entropy device is 0x2000008c, name is ENTROPY_0
|
||||
0xd7 0x42 0xb0 0x7b 0x56 0x3b 0xc3 0x43 0x8a 0xa3
|
||||
0xfa 0xec 0xd8 0xc3 0x36 0xf8 0x7b 0x82 0x2b 0x39
|
2
samples/drivers/entropy/prj.conf
Normal file
2
samples/drivers/entropy/prj.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_STDOUT_CONSOLE=y
|
|
@ -5,22 +5,22 @@
|
|||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <random.h>
|
||||
#include <entropy.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void main(void)
|
||||
{
|
||||
struct device *dev;
|
||||
|
||||
printf("Random Example! %s\n", CONFIG_ARCH);
|
||||
printf("Entropy Example! %s\n", CONFIG_ARCH);
|
||||
|
||||
dev = device_get_binding(CONFIG_RANDOM_NAME);
|
||||
dev = device_get_binding(CONFIG_ENTROPY_NAME);
|
||||
if (!dev) {
|
||||
printf("error: no random device\n");
|
||||
printf("error: no entropy device\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf("random device is %p, name is %s\n",
|
||||
printf("entropy device is %p, name is %s\n",
|
||||
dev, dev->config->name);
|
||||
|
||||
while (1) {
|
||||
|
@ -34,14 +34,14 @@ void main(void)
|
|||
* outside the passed buffer, and that should never
|
||||
* happen.
|
||||
*/
|
||||
r = random_get_entropy(dev, buffer, BUFFER_LENGTH-1);
|
||||
r = entropy_get_entropy(dev, buffer, BUFFER_LENGTH-1);
|
||||
if (r) {
|
||||
printf("random_get_entropy failed: %d\n", r);
|
||||
printf("entropy_get_entropy failed: %d\n", r);
|
||||
break;
|
||||
}
|
||||
|
||||
if (buffer[BUFFER_LENGTH-1] != 0) {
|
||||
printf("random_get_entropy buffer overflow\n");
|
||||
printf("entropy_get_entropy buffer overflow\n");
|
||||
}
|
||||
|
||||
for (int i = 0; i < BUFFER_LENGTH-1; i++) {
|
|
@ -1,2 +0,0 @@
|
|||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_STDOUT_CONSOLE=y
|
|
@ -4,7 +4,7 @@ CONFIG_NET_LOG=y
|
|||
CONFIG_NET_UDP=y
|
||||
CONFIG_SYS_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_COAP=y
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ CONFIG_NET_LOG=y
|
|||
CONFIG_NET_UDP=y
|
||||
CONFIG_SYS_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_COAP=y
|
||||
CONFIG_NET_L2_BT=y
|
||||
|
|
|
@ -4,7 +4,7 @@ CONFIG_NET_LOG=y
|
|||
CONFIG_NET_UDP=y
|
||||
CONFIG_SYS_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_COAP=y
|
||||
CONFIG_NET_APP_SETTINGS=y
|
||||
|
|
|
@ -15,6 +15,6 @@ CONFIG_NET_DEBUG_L2_BT=y
|
|||
CONFIG_NET_APP_BT_NODE=y
|
||||
CONFIG_SYS_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_COAP=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_UDP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
CONFIG_NET_PKT_RX_COUNT=10
|
||||
|
|
|
@ -5,7 +5,7 @@ CONFIG_NET_IPV6=y
|
|||
CONFIG_NET_IPV4=y
|
||||
#CONFIG_NET_DHCPV4=y
|
||||
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ CONFIG_NET_LOG=y
|
|||
CONFIG_NET_UDP=y
|
||||
CONFIG_SYS_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_COAP=y
|
||||
CONFIG_NET_APP_SETTINGS=y
|
||||
|
|
|
@ -11,7 +11,7 @@ CONFIG_NET_HOSTNAME="zephyr"
|
|||
|
||||
CONFIG_MDNS_RESPONDER=y
|
||||
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ CONFIG_MQTT_LIB=y
|
|||
|
||||
CONFIG_MAIN_STACK_SIZE=2048
|
||||
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_TIMER_RANDOM_GENERATOR=y
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_NET_ARP=y
|
||||
CONFIG_NET_L2_ETHERNET=y
|
||||
CONFIG_NET_LOG=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_NET_ARP=y
|
||||
CONFIG_NET_L2_ETHERNET=y
|
||||
CONFIG_NET_LOG=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_INIT_STACKS=y
|
||||
|
|
|
@ -2,7 +2,7 @@ CONFIG_ARC_INIT=n
|
|||
|
||||
CONFIG_NETWORKING=y
|
||||
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
||||
CONFIG_NET_PKT_RX_COUNT=15
|
||||
|
|
|
@ -22,5 +22,5 @@ CONFIG_SYS_LOG=y
|
|||
CONFIG_SYS_LOG_DEFAULT_LEVEL=3
|
||||
CONFIG_SYS_LOG_IEEE802154_DRIVER_LEVEL=1
|
||||
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
|
|
@ -45,7 +45,7 @@ subsystems = [
|
|||
"ipm_driver_api",
|
||||
"pinmux_driver_api",
|
||||
"pwm_driver_api",
|
||||
"random_driver_api",
|
||||
"entropy_driver_api",
|
||||
"rtc_driver_api",
|
||||
"sensor_driver_api",
|
||||
"spi_driver_api",
|
||||
|
|
|
@ -74,7 +74,7 @@ config NETWORKING
|
|||
bool "Link layer and IP networking support"
|
||||
select NET_BUF
|
||||
select POLL
|
||||
select RANDOM_GENERATOR
|
||||
select ENTROPY_GENERATOR
|
||||
default n
|
||||
help
|
||||
This option enabled generic link layer and IP networking support.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
config TEST_RANDOM_GENERATOR
|
||||
bool
|
||||
prompt "Non-random number generator"
|
||||
depends on RANDOM_GENERATOR && ! RANDOM_HAS_DRIVER
|
||||
depends on !ENTROPY_HAS_DRIVER
|
||||
default n
|
||||
help
|
||||
This option signifies that the kernel's random number APIs are
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
||||
CONFIG_TINYCRYPT=y
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
||||
CONFIG_TINYCRYPT=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_L2_ETHERNET=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
||||
# No board will enable the generic SPI hosted enc28j60 driver by
|
||||
|
|
|
@ -6,5 +6,5 @@ CONFIG_ETH_ENC28J60_0=y
|
|||
CONFIG_ETH_ENC28J60_0_MAC2=0x02
|
||||
CONFIG_ETH_ENC28J60_0_MAC3=0xde
|
||||
CONFIG_ETH_ENC28J60_0_MAC4=0xad
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_ZTEST=y
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <random.h>
|
||||
#include <entropy.h>
|
||||
#include <ztest.h>
|
||||
|
||||
/*
|
||||
* @addtogroup t_entropy_api
|
||||
* @{
|
||||
* @defgroup t_random_get_entropy test_random_get_entropy
|
||||
* @defgroup t_entropy_get_entropy test_entropy_get_entropy
|
||||
* @brief TestPurpose: verify Get entropy works
|
||||
* @details
|
||||
* - Test Steps
|
||||
|
@ -37,13 +37,13 @@ static int random_entropy(struct device *dev, char *buffer, char num)
|
|||
* outside the passed buffer, and that should never
|
||||
* happen.
|
||||
*/
|
||||
ret = random_get_entropy(dev, buffer, BUFFER_LENGTH - 1);
|
||||
ret = entropy_get_entropy(dev, buffer, BUFFER_LENGTH - 1);
|
||||
if (ret) {
|
||||
TC_PRINT("Error: random_get_entropy failed: %d\n", ret);
|
||||
TC_PRINT("Error: entropy_get_entropy failed: %d\n", ret);
|
||||
return TC_FAIL;
|
||||
}
|
||||
if (buffer[BUFFER_LENGTH - 1] != num) {
|
||||
TC_PRINT("Error: random_get_entropy buffer overflow\n");
|
||||
TC_PRINT("Error: entropy_get_entropy buffer overflow\n");
|
||||
return TC_FAIL;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ static int get_entropy(void)
|
|||
u8_t buffer[BUFFER_LENGTH] = { 0 };
|
||||
int ret;
|
||||
|
||||
dev = device_get_binding(CONFIG_RANDOM_NAME);
|
||||
dev = device_get_binding(CONFIG_ENTROPY_NAME);
|
||||
if (!dev) {
|
||||
TC_PRINT("error: no random device\n");
|
||||
return TC_FAIL;
|
||||
|
@ -98,7 +98,7 @@ static int get_entropy(void)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void test_random_get_entropy(void)
|
||||
static void test_entropy_get_entropy(void)
|
||||
{
|
||||
zassert_true(get_entropy() == TC_PASS, NULL);
|
||||
}
|
||||
|
@ -106,6 +106,6 @@ static void test_random_get_entropy(void)
|
|||
void test_main(void)
|
||||
{
|
||||
ztest_test_suite(entropy_api,
|
||||
ztest_unit_test(test_random_get_entropy));
|
||||
ztest_unit_test(test_entropy_get_entropy));
|
||||
ztest_run_test_suite(entropy_api);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
tests:
|
||||
- test_get_entropy:
|
||||
filter: CONFIG_RANDOM_HAS_DRIVER
|
||||
filter: CONFIG_ENTROPY_HAS_DRIVER
|
||||
tags: driver
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CONFIG_GPIO=y
|
||||
CONFIG_ZTEST=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
|
|
@ -2,6 +2,6 @@ CONFIG_ZTEST=y
|
|||
CONFIG_RING_BUFFER=y
|
||||
CONFIG_PRINTK=y
|
||||
CONFIG_SYS_LOG=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_POLL=y
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CONFIG_STACK_CANARIES=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_MAIN_THREAD_PRIORITY=7
|
||||
|
|
|
@ -7,7 +7,7 @@ CONFIG_NET_IPV6_DAD=n
|
|||
CONFIG_NET_IPV6_MLD=n
|
||||
CONFIG_NET_6LO=y
|
||||
CONFIG_NET_BUF=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_MAIN_STACK_SIZE=5048
|
||||
CONFIG_NET_PKT_RX_COUNT=1
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
# Generic options that are useful to be active
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_ZTEST=y
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ CONFIG_NET_MAX_CONTEXTS=10
|
|||
CONFIG_NET_L2_DUMMY=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IPV6_DAD=n
|
||||
CONFIG_NET_IPV6_MLD=n
|
||||
|
|
|
@ -9,7 +9,7 @@ CONFIG_NET_MAX_CONTEXTS=10
|
|||
CONFIG_NET_L2_DUMMY=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_PKT_TX_COUNT=10
|
||||
CONFIG_NET_PKT_RX_COUNT=10
|
||||
|
|
|
@ -9,7 +9,7 @@ CONFIG_NET_MAX_CONTEXTS=10
|
|||
CONFIG_NET_L2_DUMMY=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IPV6_DAD=n
|
||||
CONFIG_NET_IPV6_MLD=n
|
||||
|
|
|
@ -9,7 +9,7 @@ CONFIG_NET_MAX_CONTEXTS=10
|
|||
CONFIG_NET_L2_DUMMY=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IPV6_DAD=n
|
||||
CONFIG_NET_IPV6_MLD=n
|
||||
|
|
|
@ -11,7 +11,7 @@ CONFIG_NET_BUF_RX_COUNT=5
|
|||
CONFIG_NET_BUF_TX_COUNT=5
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3
|
||||
CONFIG_NET_DEBUG_ARP=y
|
||||
|
|
|
@ -10,7 +10,7 @@ CONFIG_NET_CONTEXT_SYNC_RECV=y
|
|||
CONFIG_NET_L2_DUMMY=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IPV6_ND=n
|
||||
CONFIG_NET_IPV6_DAD=n
|
||||
|
|
|
@ -10,7 +10,7 @@ CONFIG_NET_BUF_RX_COUNT=7
|
|||
CONFIG_NET_BUF_TX_COUNT=7
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
|
||||
CONFIG_NET_DEBUG_IF=y
|
||||
|
|
|
@ -10,6 +10,6 @@ CONFIG_NET_BUF_RX_COUNT=5
|
|||
CONFIG_NET_BUF_TX_COUNT=5
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_ZTEST=y
|
||||
|
|
|
@ -6,7 +6,7 @@ CONFIG_NET_IPV6_ND=n
|
|||
CONFIG_NET_IPV6_DAD=n
|
||||
CONFIG_NET_L2_IEEE802154=y
|
||||
CONFIG_NET_BUF=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_MAIN_STACK_SIZE=8192
|
||||
CONFIG_NET_PKT_RX_COUNT=2
|
||||
|
|
|
@ -14,7 +14,7 @@ CONFIG_NET_BUF_TX_COUNT=10
|
|||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_NET_LEVEL=1
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_DEBUG_IPV6=y
|
||||
CONFIG_ZTEST=y
|
||||
|
|
|
@ -8,7 +8,7 @@ CONFIG_NET_MAX_CONTEXTS=4
|
|||
CONFIG_NET_L2_DUMMY=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IPV6_DAD=n
|
||||
CONFIG_NET_IPV6_MLD=n
|
||||
|
|
|
@ -13,7 +13,7 @@ CONFIG_NET_BUF_RX_COUNT=5
|
|||
CONFIG_NET_BUF_TX_COUNT=5
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3
|
||||
CONFIG_NET_IF_MCAST_IPV4_ADDR_COUNT=3
|
||||
|
|
|
@ -7,7 +7,7 @@ CONFIG_NET_IPV4=n
|
|||
CONFIG_NET_L2_DUMMY=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IPV6_ND=y
|
||||
CONFIG_NET_IPV6_DAD=y
|
||||
|
|
|
@ -8,7 +8,7 @@ CONFIG_NET_MAX_CONTEXTS=4
|
|||
CONFIG_NET_L2_DUMMY=y
|
||||
CONFIG_NET_LOG=y
|
||||
CONFIG_SYS_LOG_SHOW_COLOR=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_NET_IPV6_DAD=n
|
||||
CONFIG_NET_IPV6_MLD=n
|
||||
|
|
|
@ -6,7 +6,7 @@ CONFIG_NET_TCP=n
|
|||
CONFIG_NET_IPV4=n
|
||||
CONFIG_NET_BUF_LOG=y
|
||||
CONFIG_SYS_LOG_NET_BUF_LEVEL=2
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_COAP=y
|
||||
CONFIG_COAP_TEST_API_ENABLE=y
|
||||
|
|
|
@ -3,7 +3,7 @@ CONFIG_NETWORKING=y
|
|||
CONFIG_NET_TEST=y
|
||||
|
||||
# native IP stack support
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
||||
CONFIG_DNS_RESOLVER=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TEST=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
||||
CONFIG_NET_L2_DUMMY=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TEST=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
||||
CONFIG_NET_L2_DUMMY=y
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TEST=y
|
||||
CONFIG_RANDOM_GENERATOR=y
|
||||
CONFIG_ENTROPY_GENERATOR=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
CONFIG_ZTEST_STACKSIZE=320
|
||||
CONFIG_HTTP_PARSER=y
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue