summary refs log tree commit diff stats
path: root/lib/std/sysrand.nim
Commit message (Collapse)AuthorAgeFilesLines
* refactor os imports into corresponding small modules (#20720)ringabout2022-11-011-1/+1
|
* macOS use SecRandomCopyBytes instead of getentropy (#20466)Matt Haggard2022-10-051-17/+4
| | | | | * On macOS use SecRandomCopyBytes instead of getentropy (which is only available on macOS 10.12+) * Change passL to passl
* make more standard libraries work with `nimPreviewSlimSystem` (#20343)ringabout2022-09-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | * make more standard libraries work with `nimPreviewSlimSystem` * typo * part two * Delete specutils.nim * fixes more tests * more fixes * fixes tests * fixes three more tests * add formatfloat import * fix * last
* sysrand: fix syscall signature [backport] (#19982)Jacek Sieka2022-07-071-4/+3
| | | | | sysrand: fix syscall signature `syscall` is a `C` varags function
* Implement zephyr urandom and monotime (#19142)Jaremy Creechley2021-11-141-1/+11
| | | | | | | * implement urandom for Zephyr * add monotime on zephyr Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Fix undeclared 'SYS_getrandom' on emscripten (#19144)Anuken2021-11-131-1/+1
|
* Fix #19052; [backport:1.6.0] (#19053)Timothy Alexander2021-10-261-1/+6
| | | | | | | | | | | | | | | | | * Fix #19052; [backport:1.6.0] Adds a compile flag to avoid a getrandom syscall, fixing #19052. This is neccesary when the getrandom syscall is missing, as noted in #19052, particularly in kernel versions < 3.17 when getrandom was introduced. Specifically relevant is this is missing from kernel 3.10, which is the supported kernel throughout RHEL 7 and CentOS 7, which is widely used at many organizations. Without this, versions of nim that include sysrand (i.e. versions >= 1.6.0) will not compile without modification, however with this change a compile flag may be used to fall back using /dev/urandom as done with any unknown Posix OS (preferred here as a fallback since it already supplies a cryptographically secure PRNG and existing code deals with entropy pool init, etc). The change is placed behind a compile flag, as discussed in github ticket #19052 (summed up here): * First, I can't seem to catch that a importc such as SYS_getrandom is declared without using it (the declared proc returns true, but compiler throws an undeclared identifier flag when referencing it). * Second, it seemed preferable to be behaviorally explicit vs implicit when considering this is intended to be a cryptographically secure PRNG. * Third, if I intend to compile on a kernel >= 3.17 while running the binary on at least one system < 3.17, I'll want to be able to target this without relying on a compile time determination if the getrandom syscall is available. * Documenting compile flag for -d:nimNoGetRandom and adding changelog entry Related to #19052 and comments in PR #19053. Also created a new changelog file since none currently exists. Co-authored-by: Timothy Alexander <talexander@midwestlabs.com>
* deprecate cuchar, don't redefine it (#18505)Andreas Rumpf2021-07-161-1/+1
|
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-211-5/+5
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* Update `sysrand` documentation (#17676)konsumlamm2021-04-081-16/+16
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* make std/sysrand better (#17360)flywind2021-03-151-19/+29
|
* add warnings to std/sysrand (#17191)flywind2021-02-261-0/+4
| | | | | | | | | | | | | | * remove unnecessary when statement * remove outdated codes * add warnings to std/sysrand * Update lib/std/sysrand.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fix #17078 csources generation (#17079)Timothee Cour2021-02-181-5/+3
| | | | | * fix #17078 csources generation * fixup
* make system random work in VM (#17059)flywind2021-02-171-4/+5
| | | | * make system random work in VM
* add system random to stdlib: std/sysrand (#16459)flywind2021-02-111-0/+308