1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

63 Commits

Author SHA1 Message Date
LP-HAW
9cf9638fdc sys/random: fix SHAxPRNG init_by_array 2024-05-31 23:29:09 +02:00
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
Han Xinrong
bf3c038fa9 sys/random/fortuna/fortuna.c:add error check of aes_encrypt() 2024-01-30 19:04:01 +01:00
c8d4256c84
sys/random: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:54 +02:00
Benjamin Valentin
1e69740d18 random: use void * in random_bytes() 2022-07-26 19:46:14 +02:00
Leandro Lanzieri
82726a2b2b
sys/random/kconfig: remove HWRNG default in backend choice
For now we match the Makefile.dep default, ignoring if the platform
presents a Hardware RNG.
2022-04-27 15:41:23 +02:00
Benjamin Valentin
39b8cdf760 sys/random: default to musl LCG
In [0] the paper concludes with

> The Knuth LCG is the most efficient general purpose generator that
> provides decent statistical quality.
> It is simple and lean enough to run on very constrained devices.

So let's select `prng_musl_lcg` to be the default PRNG instead of
`prng_tinymt32`.

This gives a good chunk of memory on e.g. `samr21-xpro`:

prng_tinymt32
-------------

   text	   data	    bss	    dec	    hex	filename
  26452	    136	   2824	  29412	   72e4	tests/rng/bin/samr21-xpro/tests_rng.elf

prng_musl_lcg
-------------

   text	   data	    bss	    dec	    hex	filename
  26208	    136	   2808	  29152	   71e0	tests/rng/bin/samr21-xpro/tests_rng.elf

[0] https://sci-hub.se/10.1145/3453159
2021-11-11 19:59:26 +01:00
Francisco Molina
1af2462404 sys/fortuna: remove need for now64
Use a timer to required a reseed, enable use of plain ztimer (no now64)
2021-09-27 17:30:05 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Ollrogge
f5ca90b007 sys/crypto, sys/random: Fix Kconfig files in response to AES changes 2021-05-03 17:34:53 +02:00
MrKevinWeiss
008660fccf sys/random: Fix typo in kconfig 2021-04-08 16:44:10 +02:00
Leandro Lanzieri
5c4df6078e
sys/random: add modules to Kconfig 2021-01-26 17:40:53 +01:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
Leandro Lanzieri
531367a9a2
pkg/tinydtls: enforce the selection of a crypto secure PRNG
Also add a sanity checks on the prng_ modules.
2020-08-21 08:39:34 +02:00
Martine Lenders
05b13f5029
Merge pull request #14488 from PeterKietzmann/pr_add_sha256prng
sys/random: add SHA256 mode to SHA1PRNG & tests
2020-07-29 11:20:55 +02:00
PeterKietzmann
0b48298d95 sys/random: shaxprng init use digest not state 2020-07-22 12:25:09 +02:00
PeterKietzmann
7232c5291d sys/random: reset buffer position on reinitialization 2020-07-22 12:25:09 +02:00
PeterKietzmann
233fbcdb38 sys/random: improve documentation on SHA based generator 2020-07-22 12:25:09 +02:00
PeterKietzmann
5a13d00b65 sys/random: make sha1prng sha256 compatible 2020-07-22 12:25:09 +02:00
Martine Lenders
908ec472ce
Merge pull request #14453 from benpicco/sys/random-hwrng
sys/random: add option to use HWRNG as source of randomness
2020-07-08 19:30:36 +02:00
Benjamin Valentin
2f423473fc sys/random: add option to use HWRNG as source of randomness
Add the `prng_hwrng` module to enable the HWRNG as source of all randomness, not just
for seeding a PRNG.

saves ~260 bytes compared to using tinymt32.
2020-07-08 18:23:18 +02:00
Benjamin Valentin
9d836888c2 treewide: fix file permissions
C files should not be executable.
2020-07-08 17:32:36 +02:00
PeterKietzmann
eb62ac6ff1 sys/random/sha1prng: make random_init use init_by_array 2020-05-11 10:38:44 +02:00
PeterKietzmann
54d6b0d096 sys/random/sha1prng: remove redundant sha1 update in state transistion 2020-05-11 10:37:24 +02:00
PeterKietzmann
3f626e39ab sys/random/sha1prng: rename seed size to state size 2020-05-11 10:35:58 +02:00
PeterKietzmann
9c5759112e sys/random/minstd: remove vague description 2020-05-01 17:30:36 +02:00
PeterKietzmann
090efc10de sys/random/minstd: fix signedness 2020-05-01 17:30:36 +02:00
Francois Berder
4a31f94cfc many typo fixes
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
Francisco Molina
cc2c3a0163 pkg/ucglib/src/csrc/ucg_riotos.c: fix cpp.check shiftTooManyBitsSigned 2019-11-21 11:58:07 +01:00
0ec9c57b2b add copyrights from IOTPUSH project 2019-05-02 12:09:37 +02:00
637bbdd985 sys/random: add missing includes 2019-04-01 17:05:44 +02:00
Hauke Petersen
368ab65d8a sys/random: cleanup includes 2019-03-07 10:22:10 +01:00
Hauke Petersen
64489e8b44 sys/random: add hwrng as seed source (if available) 2019-02-19 18:09:40 +01:00
Hauke Petersen
8a135d3a43 sys/random: add guard for periph/cpuid include 2019-02-19 18:09:40 +01:00
Hauke Petersen
e070d5a694 sys/random: fix indention in doxygen header 2019-02-19 18:09:40 +01:00
05b6af466c sys: add missig <string.h> includes 2018-09-20 23:47:40 +02:00
PeterKietzmann
20397c5b15 cortexm_common: add SRAM based PRNG seeder 2018-07-04 17:55:16 +02:00
PeterKietzmann
ec5fb4fbda sys/random: fix distribution of random_uint32_range() 2018-06-26 14:08:43 +02:00
PeterKietzmann
3c4360eddb sys/random: add SHA1PRNG 2018-06-22 16:11:53 +02:00
Bas Stottelaar
99755eaa0c sys: random: add fortuna PRNG 2018-05-29 18:40:58 +02:00
PeterKietzmann
8172e5782d sys/random: remove printf in xorshift 2018-04-05 12:06:12 +02:00
Francisco Acosta
f80c1b0e9a sys/random/tinymt32: remove unused static function 2018-03-16 16:24:05 +01:00
caabc15395 sys/random: provide generic random_bytes() 2018-03-14 18:17:27 +01:00
Joakim Nohlgård
2cc07f7f05
Merge pull request #7390 from tobhe/random
random: add random_bytes() function
2018-02-09 10:33:46 +01:00
tobhe
7af07bacff random: added random_bytes function 2017-12-19 09:39:55 +01:00
smlng
b283b7784c make: fix various compile errors with Wextra
pkg, nordic_softdevice_ble: disable CFLAGS to omit compiler error
        sys, pm_layered: fix casting nonscalar to the same type
        cpu, stm32_common: fix type-limits, remove always true assert
        cpu, stm32f4: fix pointer arithmetic in periph/i2c
        drivers, at86rf2xx: fix type-limits where condition always true
        saul, gpio: fix if no gpio configured for saul
        cpu, saml21: add frequency check to periph/timer
        driver, cc110x: fix unused param and type-limts errors
        boards, wsn430-common: fix old-style-declaration
        make: fix old style definition
        drivers, sdcard_spi: fix old style typedef
        driver, at30tse: remove unnecessary check
        driver, nrf24: fix type-limit
        driver, pn532: change buffer from char to uint8_t
        tests/driver_sdcard: fix type limits
        boards, feather-m0: add missing field inits
        driver, tcs37727: fix type limits
        pkg, emb6: disable some compiler warnings
        tests/emb6: disable some compiler warings
        pkg, openthread: fix sign compare and unused params
        tests/trickle: fix struct init
        tests/pthread_cooperation: fix type limits
        board, mips-malta: remove feature periph_uart
        shell: fix var size for netif command
        gnrc, netif: fix sign-compare
        gnrc, nib: fix sign-compare
        shell: fix output in netif command
        posix: fix type-limits in pthread_cond
2017-11-28 18:31:43 +01:00
Martine Lenders
c52fde668b sys: random: make fallback seed configurable at compile time 2017-11-08 17:18:26 +01:00
ccf704bab8 sys: random: use luid to generate random seed 2017-11-08 17:18:26 +01:00
Peter Kietzmann
9964a60759 Merge pull request #7545 from kaspar030/add_prng_xorshift
sys: random: add xorshift prng
2017-10-10 19:13:49 +02:00
d377a17784 sys: random: add xorshift prng 2017-10-10 18:59:58 +02:00