Home
last modified time | relevance | path

Searched +full:pseudo +full:- +full:random (Results 1 – 25 of 29) sorted by relevance

12

/Zephyr-latest/subsys/random/
Drandom_timer.c2 * Copyright (c) 2013-2015 Wind River Systems, Inc.
4 * SPDX-License-Identifier: Apache-2.0
9 * @brief Non-random number generator based on system timer
11 * This module provides a non-random implementation of sys_rand32_get(), which
12 * is not meant to be used in a final product as a truly random number
14 * provide a random number generator.
17 #include <zephyr/random/random.h>
26 * @brief Get a 32 bit random number
28 * This pseudo-random number generator returns values that are based off the
32 * @return a 32-bit number
[all …]
DKconfig1 # Random configuration options
4 # SPDX-License-Identifier: Apache-2.0
6 menu "Random Number Generators"
9 bool "Allow non-random number generator"
11 This option signifies that a non-random number generator is allowed to
12 be used and the kernel's random number APIs are permitted to return
13 values that are not truly random.
15 This capability is provided for testing purposes when a truly random
16 number generator is not available. The non-random number generator
19 This option is intended to be selected only by application-level
[all …]
Drandom_xoshiro128.c5 * SPDX-License-Identifier: CC0-1.0
18 * This is xoshiro128++ 1.0, one of our 32-bit all-purpose, rock-solid
23 * For generating just single-precision (i.e., 32-bit) floating-point
42 return (x << k) | (x >> (32 - k)); in rotl()
48 return -ENODEV; in xoshiro128_initialize()
58 * up with a mix of random bytes from both threads. in xoshiro128_init_state()
65 * Reseed the PRNG state with pseudo-random data until it can in xoshiro128_init_state()
66 * be properly seeded. This may be needed if random numbers are in xoshiro128_init_state()
97 size_t rem = (outlen - (blocks * sizeof(uint32_t))); in z_impl_sys_rand_get()
106 while (blocks--) { in z_impl_sys_rand_get()
[all …]
/Zephyr-latest/modules/
DKconfig.tinycrypt4 # SPDX-License-Identifier: Apache-2.0
20 This option enables support for the pseudo-random number
24 bool "SHA-256 Hash function support"
26 This option enables support for SHA-256
33 This option enables support for HMAC using SHA-256
37 bool "PRNG (via HMAC-SHA256) support"
40 This option enables support for pseudo-random number
47 Diffie-Hellman anonymous key agreement protocol.
49 Enabling ECC requires a cryptographically secure random number
58 Enabling ECC requires a cryptographically secure random number
[all …]
/Zephyr-latest/doc/services/crypto/random/
Dindex.rst3 Random Number Generation
6 The random API subsystem provides random number generation APIs in both
7 cryptographically and non-cryptographically secure instances. Which
8 random API to use is based on the cryptographic requirements of the
9 random number. The non-cryptographic APIs will return random values
10 much faster if non-cryptographic values are needed.
12 The cryptographically secure random functions shall be compliant to the
13 FIPS 140-2 [NIST02]_ recommended algorithms. Hardware based random-number
15 Platforms without hardware RNG support shall use the `CTR-DRBG algorithm
16 <https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf>`_.
[all …]
/Zephyr-latest/dts/bindings/rng/
Despressif,esp32-trng.yaml2 # SPDX-License-Identifier: Apache-2.0
5 Espressif ESP32 TRNG (True Random Number Generator).
7 The TRNG uses the noise in the Wi-Fi/BT RF system. When Wi-Fi and BT are
8 disabled, the random number generator will give out pseudo-random numbers.
10 compatible: "espressif,esp32-trng"
/Zephyr-latest/drivers/entropy/
Dfake_entropy_native_bottom.c4 * SPDX-License-Identifier: Apache-2.0
6 * Bottom/Linux side of the pseudo-random entropy generator for
17 #include <sys/random.h>
29 nsi_print_error_and_exit("Could not get random number (%i, %s)\n", in entropy_native_seed()
35 nsi_print_trace("Random generator seeded with 0x%X\n", buf); in entropy_native_seed()
DKconfig.litex4 # SPDX-License-Identifier: Apache-2.0
13 generator, based on Pseudo-Random Binary Sequences (PRBS)
Dfake_entropy_native_posix.c4 * SPDX-License-Identifier: Apache-2.0
6 * Pseudo-random entropy generator for the ARCH_POSIX architecture:
8 * this entropy device will always generate the same random sequence when
49 length -= to_copy; in entropy_native_posix_get_entropy()
78 "Using a test - not safe - entropy source\n"); in entropy_native_posix_init()
109 .descript = "A 32-bit integer seed value for the entropy device, such as " in add_fake_entropy_option()
114 .option = "seed-random", in add_fake_entropy_option()
117 .descript = "Seed the random generator from /dev/urandom. " in add_fake_entropy_option()
/Zephyr-latest/samples/net/cellular_modem/
DREADME.rst1 .. zephyr:code-sample:: cellular-modem
11 with pseudo random data to the endpoint test-endpoint.com,
14 up the IP of test-endpoint.com.
29 .. code-block:: devicetree
31 /dts-v1/;
40 pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3 &usart2_rts_pa1 &usart2_cts_pa0>;
41 pinctrl-names = "default";
42 current-speed = <115200>;
43 hw-flow-control;
48 mdm-power-gpios = <&gpioe 2 GPIO_ACTIVE_HIGH>;
[all …]
/Zephyr-latest/dts/bindings/watchdog/
Dnxp,s32-swt.yaml1 # Copyright 2022-2024 NXP
2 # SPDX-License-Identifier: Apache-2.0
6 compatible: "nxp,s32-swt"
20 master-access-mask:
26 are chip-specific.
29 reset-on-invalid-access:
34 service-mode:
38 - "fixed"
39 - "keyed"
42 - fixed: writes a fixed sequence as defined by hardware.
[all …]
/Zephyr-latest/modules/mbedtls/
DKconfig.tls-generic5 # SPDX-License-Identifier: Apache-2.0
8 depends on MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-generic.h"
65 bool "DHE-PSK based ciphersuite modes"
68 bool "ECDHE-PSK based ciphersuite modes"
72 bool "RSA-PSK based ciphersuite modes"
75 int "Max size of TLS pre-shared keys"
78 Max size of TLS pre-shared keys, in bytes. It has no effect if no
82 bool "RSA-only based ciphersuite modes"
91 bool "DHE-RSA based ciphersuite modes"
94 bool "ECDHE-RSA based ciphersuite modes"
[all …]
/Zephyr-latest/samples/subsys/portability/cmsis_rtos_v1/philosophers/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
68 /* end - control behaviour of the demo */
107 p += snprintk(state + p, STATE_LEN - p, "Philosopher %d [%s:%s%d] ", in print_phil_state()
113 p += snprintk(state + p, STATE_LEN - p, fmt, in print_phil_state()
116 p += snprintk(state + p, STATE_LEN - p, fmt, ""); in print_phil_state()
119 p += snprintk(state + p, STATE_LEN - p, "\n"); in print_phil_state()
126 * The random delay is unit-less, and is based on the philosopher's ID in get_random_delay()
127 * and the current uptime to create some pseudo-randomness. It produces in get_random_delay()
140 return id == (NUM_PHIL - 1); in is_last_philosopher()
207 "----------------\n" \
[all …]
/Zephyr-latest/samples/posix/philosophers/src/
Dmain.c2 * Copyright (c) 2011-2016 Wind River Systems, Inc.
5 * SPDX-License-Identifier: Apache-2.0
123 * The random delay is unit-less, and is based on the philosopher's ID in get_random_delay()
124 * and the current uptime to create some pseudo-randomness. It produces in get_random_delay()
139 return id == (NUM_PHIL - 1); in is_last_philosopher()
189 return -(phil - (NUM_PHIL / 2)); in new_prio()
193 return -phil - 2; in new_prio()
248 "----------------\n" \
250 "problem (a classic multi-thread synchronization problem).\n" \
/Zephyr-latest/samples/subsys/portability/cmsis_rtos_v2/philosophers/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
64 /* end - control behaviour of the demo */
151 * The random delay is unit-less, and is based on the philosopher's ID in get_random_delay()
152 * and the current uptime to create some pseudo-randomness. It produces in get_random_delay()
165 return id == (NUM_PHIL - 1); in is_last_philosopher()
235 "----------------\n" \
237 "problem (a classic multi-thread synchronization problem) using\n" \
/Zephyr-latest/doc/security/
Dsensor-threat.rst1 .. _sensor-threat:
17 .. figure:: media/sensor-model.svg
28 This model also focuses on communicating via the MQTT-over-TLS protocol,
39 on-device flash that is the first code to run. In order to establish
43 programmed into the device, early in production [th-imboot]_.
52 [th-authrepl]_.
55 shall be done in a timely manner [th-timely-update]_.
60 [th-atomic-update]_.
64 are allowed to sign the certificate on the server. For cloud-provider
68 [th-root-certs]_, [th-root-check]_.
[all …]
/Zephyr-latest/samples/philosophers/src/
Dmain.c2 * Copyright (c) 2011-2016 Wind River Systems, Inc.
4 * SPDX-License-Identifier: Apache-2.0
83 /* end - control behaviour of the demo */
123 * The random delay is unit-less, and is based on the philosopher's ID in get_random_delay()
124 * and the current uptime to create some pseudo-randomness. It produces in get_random_delay()
137 return id == (NUM_PHIL - 1); in is_last_philosopher()
188 return -(phil - (NUM_PHIL/2)); in new_prio()
192 return -phil - 2; in new_prio()
213 * create two coop. threads (prios -2/-1) and four preemptive threads in start_threads()
214 * : (prios 0-3) in start_threads()
[all …]
/Zephyr-latest/boards/native/native_sim/doc/
Dindex.rst3 Native simulator - native_sim
63 .. zephyr-app-commands::
64 :zephyr-app: samples/hello_world
65 :host-os: unix
77 .. code-block:: console
84 You can run it with the ``--help`` command line switch to get a list of
87 .. code-block:: console
89 $ ./build/zephyr/zephyr.exe --help
95 Application tests using the :ref:`ztest framework<test-framework>` will exit after all
113 (there are no asynchronous or random components), you can execute the
[all …]
/Zephyr-latest/drivers/watchdog/
Dwdt_nxp_s32.c2 * Copyright 2022-2024 NXP
4 * SPDX-License-Identifier: Apache-2.0
81 #define REG_READ(r) sys_read32(config->base + (r))
82 #define REG_WRITE(r, v) sys_write32((v), config->base + (r))
120 switch (config->lock_mode) { in swt_lock()
139 LOG_ERR("Watchdog hard-locked"); in swt_unlock()
140 err = -EFAULT; in swt_unlock()
150 err = -ETIMEDOUT; in swt_unlock()
161 /* Calculated pseudo-random key according to Service Key Generation chapter in RM */ in swt_gen_service_key()
167 const struct swt_nxp_s32_config *config = dev->config; in swt_nxp_s32_setup()
[all …]
/Zephyr-latest/include/zephyr/drivers/
Dgnss.h4 * SPDX-License-Identifier: Apache-2.0
82 /** Quasi-Zenith Satellite System (QZSS) */
86 /** Satellite-Based Augmentation System (SBAS) */
129 /** Real-time kinematic */
131 /** Floating real-time kinematic */
200 /** Pseudo-random noise sequence */
202 /** Signal-to-noise ratio in dB */
234 * @return -errno negative errno code on failure
240 const struct gnss_driver_api *api = (const struct gnss_driver_api *)dev->api; in z_impl_gnss_set_fix_rate()
242 if (api->set_fix_rate == NULL) { in z_impl_gnss_set_fix_rate()
[all …]
/Zephyr-latest/tests/subsys/modem/backends/uart/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
10 * containing a sequence of pseudo random numbers are then transmitted, received, and validated.
139 return -EFAULT; in receive_prng()
143 return -EFAULT; in receive_prng()
195 zassert(ret > -1, "Failed to transmit data"); in ZTEST()
196 remaining -= (uint32_t)ret; in ZTEST()
202 zassert(ret > -1, "Received data is corrupted"); in ZTEST()
/Zephyr-latest/subsys/bluetooth/controller/ll_sw/
Dlll_chan.c2 * Copyright (c) 2018-2021 Nordic Semiconductor ASA
4 * SPDX-License-Identifier: Apache-2.0
138 /* Sub-expression to get natural number (N - 2d + 1) to be used in the in lll_chan_iso_subevent()
142 x = (chan_count + 1) - (d << 1); in lll_chan_iso_subevent()
166 while (byte_count--) { in chan_sel_remap()
172 while (bit_count--) { in chan_sel_remap()
177 chan_index--; in chan_sel_remap()
258 while (octet_count--) { in chan_sel_remap_index()
264 while (bit_count--) { in chan_sel_remap_index()
268 chan_index--; in chan_sel_remap_index()
[all …]
Dull_adv.c2 * Copyright (c) 2016-2021 Nordic Semiconductor ASA
5 * SPDX-License-Identifier: Apache-2.0
139 adv->hci_handle = 0; in ll_adv_cmds_set()
141 adv->is_created = 1; in ll_adv_cmds_set()
146 return -EINVAL; in ll_adv_cmds_set()
167 if (adv->is_created && (adv->hci_handle == hci_handle)) { in ll_adv_set_by_hci_handle_get()
185 if (adv->is_created) { in ll_adv_set_by_hci_handle_get_or_new()
186 if (adv->hci_handle == hci_handle) { in ll_adv_set_by_hci_handle_get_or_new()
196 adv_empty->hci_handle = hci_handle; in ll_adv_set_by_hci_handle_get_or_new()
209 LL_ASSERT(adv && adv->is_created); in ll_adv_set_hci_handle_get()
[all …]
/Zephyr-latest/tests/drivers/flash/common/src/
Dmain.c2 * Copyright (c) 2020-2024 Nordic Semiconductor ASA
4 * SPDX-License-Identifier: Apache-2.0
22 * fixed-partition nodes.
64 TC_PRINT("Test will run on device %s\n", flash_dev->name); in flash_driver_before()
71 erase_value = fparams->erase_value; in flash_driver_before()
80 page_info.size = TEST_AREA_MAX - TEST_AREA_OFFSET; in flash_driver_before()
91 /* Fill test buffer with random data */ in flash_driver_before()
119 ((EXPECTED_SIZE + page_info.size - 1) in flash_driver_before()
139 ((EXPECTED_SIZE + page_info.size - 1) in ZTEST()
159 buf[buf_o - 1] = canary; in ZTEST()
[all …]
/Zephyr-latest/scripts/pylib/twister/twisterlib/
Denvironment.py4 # Copyright (c) 2018-2024 Intel Corporation
8 # SPDX-License-Identifier: Apache-2.0
45 def _get_installed_packages() -> Generator[str, None, None]:
63 PYTEST_PLUGIN_INSTALLED = 'pytest-twister-harness' in installed_packages
71 def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
82 $ ./scripts/twister -v \\
83 --testsuite-root tests/ztest/base \\
84 --testsuite-root tests/kernel \\
85 --test tests/ztest/base/testing.ztest.verbose_0 \\
86 --test tests/kernel/fifo/fifo_api/kernel.fifo
[all …]

12