All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Bump MSRV to 1.60 #472
- Rename
getrandom
andgetrandom_uninit
functions tofill
andfill_uninit
respectively #532
wasm32-wasi
target support (usewasm32-wasip1
orwasm32-wasip2
instead) #499linux_disable_fallback
,rdrand
,js
,test-in-browser
, andcustom
crate features in favor of configuration flags #504register_custom_getrandom!
macro #504- Implementation of
From<NonZeroU32>
forError
andError::code
method #507
- Use
ProcessPrng
on Windows 10 and up, and use RtlGenRandom on older legacy Windows versions #415 - Do not use locale-specific
strerror_r
for retrieving error code descriptions #440 - Avoid assuming usize is the native word size in the
rdrand
backend #442 - Do not read from
errno
whenlibc
did not indicate error on Solaris #448 - Switch from
libpthread
's mutex tofutex
on Linux and tonanosleep
-based wait loop on other targets in theuse_file
backend #490 - Do not retry on
EAGAIN
while polling/dev/random
on Linux #522
wasm32-wasip1
andwasm32-wasip2
support #499getrandom_backend
configuration flag for selection of opt-in backends #504Error::new_custom
method #507rndr
opt-in backend #512linux_rustix
opt-in backend #520- Memory sanitizer support gated behind
getrandom_sanitize
configuration flag #521
0.2.15 - 2024-05-06
- Apple visionOS support #410
- Use
libc::getrandom
on DragonflyBSD, FreeBSD, illumos, and Solaris #411 #416 #417 #420 - Unify
libc::getentropy
-based implementations #418
0.2.14 - 2024-04-08
- Enable
/dev/urandom
fallback for MUSL-based Linux targets #408
0.2.13 - 2024-04-06
linux_disable_fallback
crate feature to disable/dev/urandom
-based fallback on Linux and Android targets. Enabling this feature bumps minimum supported Linux kernel version to 3.17 and Android API level to 23 (Marshmallow). #396
- Disable
/dev/urandom
fallback for Linux targets outside of the followingtarget_arch
es:aarch64
,arm
,powerpc
,powerpc64
,s390x
,x86
,x86_64
#396 - Do not catch
EPERM
error code on Android while checking availability of thegetrandom
syscall #396
0.2.12 - 2024-01-09
- Custom backend for targets without atomics #385
- Improve robustness of the Hermit backend and
sys_fill_exact
#386 - Raise minimum supported Apple OS versions to macOS 10.12 and iOS 10 #388
- Document platform support policy #387
0.2.11 - 2023-11-08
- GNU/Hurd support #370
0.2.10 - 2023-06-06
- Support for PS Vita (
armv7-sony-vita-newlibeabihf
) #359
- Use getentropy from libc on Emscripten targets #362
0.2.9 - 2023-04-06
- AIX support #282
getrandom_uninit
function #291wasm64-unknown-unknown
support #303- tvOS and watchOS support #317
- QNX/nto support #325
- Support for
getrandom
syscall on NetBSD ≥ 10.0 #331 RtlGenRandom
fallback for non-UWP Windows #337
- Update MSRV to 1.36 #291
- Solaris/OpenBSD/Dragonfly build #301
- Update MSRV to 1.36 #291
- Use getentropy on Emscripten #307
- Solaris: consistantly use
/dev/random
source #310 - Move 3ds selection above rdrand/js/custom fallback #312
- Remove buffer zeroing from Node.js implementation #315
- Use
open
instead ofopen64
#326 - Remove #cfg from bsd_arandom.rs #332
- Hermit: use
sys_read_entropy
syscall #333 - Eliminate potential panic in sys_fill_exact #334
- rdrand: Remove checking for 0 and !0 and instead check CPU family and do a self-test #335
- Move
__getrandom_custom
definition into a const block #344 - Switch the custom backend to Rust ABI #347
0.2.8 - 2022-10-20
- The Web Cryptography API will now be preferred on
wasm32-unknown-unknown
when using the"js"
feature, even on Node.js #284 #295
- Added benchmarks to track buffer initialization cost #272
- Use
$crate
inregister_custom_getrandom!
#270
- Add information about enabling
"js"
feature #280 - Fix link to
wasm-bindgen
#278 - Document the varied implementations for underlying randomness sources #276
0.2.7 - 2022-06-14
- Update
wasi
dependency to0.11
#253
- Use
AtomicPtr
instead ofAtomicUsize
for Strict Provenance compatibility. #263
0.2.6 - 2022-03-28
- Nintendo 3DS (
armv6k-nintendo-3ds
) support #248
- Retry
open
when interrupted #252
0.2.5 - 2022-02-22
- ESP-IDF targets (
*‑espidf
) support #245
0.2.4 - 2021-12-13
- Use explicit imports in the
js
backend #220 - Use
/dev/urandom
on Redox instead ofrand:
#222 - Use
NonZeroU32::new_unchecked
to convert wasi error #233
0.2.3 - 2021-04-10
- Replace build.rs with link attributes. #205
- Add support for getrandom syscall on DragonFly BSD. #210
- Improve Node.js detection. #215
0.2.2 - 2021-01-19
- Forward
rustc-dep-of-std
to dependencies. #198 - Highlight feature-dependent functionality in documentation using the
doc_cfg
feature. #200
0.2.1 - 2021-01-03
- Multithreaded WASM support. #165
0.2.0 - 2020-09-10
The following (off by default) Cargo features have been added:
"rdrand"
- use the RDRAND instruction onno_std
x86
/x86_64
targets #133"js"
- use JavaScript calls onwasm32-unknown-unknown
#149- Replaces the
stdweb
andwasm-bindgen
features (which are removed)
- Replaces the
"custom"
- allows a user to specify a custom implementation #109
- Unsupported targets no longer compile #107
- Change/Add
Error
constants #120 - Only impl
std
traits when the"std"
Cargo feature is specified #106 - Remove official support for Hermit, L4Re, and UEFI #133
- Remove optional
"log"
dependency #131 - Update minimum supported Linux kernel to 2.6.32 #153
- Update MSRV to 1.34 #159
0.1.16 - 2020-12-31
- Update
cfg-if
to v1.0. #173 - Implement
std::error::Error
for theError
type on additional targets. #169
- Multithreaded WASM support. #171
0.1.15 - 2020-09-10
0.1.14 - 2020-01-07
- Remove use of spin-locks in the
use_file
module. #125 - Update
wasi
to v0.9. #126 - Do not read errno value on DragonFlyBSD to fix compilation failure. #129
0.1.13 - 2019-08-25
- VxWorks targets support. #86
- If zero-length slice is passed to the
getrandom
function, always returnOk(())
immediately without doing any calls to the underlying operating system. #104 - Use the
kern.arandom
sysctl on NetBSD. #115
0.1.12 - 2019-08-18
- Update wasi dependency from v0.5 to v0.7. #100
0.1.11 - 2019-08-25
- Implement
std
-dependent traits for selected targets even ifstd
feature is disabled. (backward compatibility with v0.1.8) #96
0.1.10 - 2019-08-18 [YANKED]
- Use the dummy implementation on
wasm32-unknown-unknown
even with the disableddummy
feature. #90
- Fix CSP error for
wasm-bindgen
. #92
0.1.9 - 2019-08-14 [YANKED]
- Remove
std
dependency for opening and reading files. #58 - Use
wasi
instead oflibc
on WASI target. #64 - By default emit a compile-time error when built for an unsupported target.
This behaviour can be disabled by using the
dummy
feature. #71
0.1.8 - 2019-07-29
- Explicitly specify types to arguments of 'libc::syscall'. #74
0.1.7 - 2019-07-29
- Support for hermit and l4re. #61
Error::raw_os_error
method,Error::INTERNAL_START
andError::CUSTOM_START
constants. Uselibc
for retrieving OS error descriptions. #54
- Remove
lazy_static
dependency and use custom structures for lock-free initialization. #51 #52 - Try
getrandom()
first on FreeBSD. #57
- Bitrig support. #56
Error::UNKNOWN
,Error::UNAVAILABLE
. #54
0.1.6 - 2019-06-30
- Minor change of RDRAND AMD bug handling. #48
0.1.5 - 2019-06-29
- Use shared
File
instead of shared file descriptor. #44 - Workaround for RDRAND hardware bug present on some AMD CPUs. #43
- Try
getentropy
and then fallback to/dev/random
on macOS. #38
0.1.4 - 2019-06-28
- Add support for
x86_64-unknown-uefi
target by using RDRAND with CPUID feature detection. #30
- Fix long buffer issues on Windows and Linux. #31 #32
- Check
EPERM
in addition toENOSYS
on Linux. #37
- Improve efficiency by sharing file descriptor across threads. #13
- Remove
cloudabi
,winapi
, andfuchsia-cprng
dependencies. #40 - Improve RDRAND implementation. #24
- Don't block during syscall detection on Linux. #26
- Increase consistency with libc implementation on FreeBSD. #36
- Apply
rustfmt
. #39
0.1.3 - 2019-05-15
- Update for
wasm32-unknown-wasi
being renamed towasm32-wasi
, and for WASI being categorized as an OS.
0.1.2 - 2019-04-06
- Add support for
wasm32-unknown-wasi
target.
0.1.1 - 2019-04-05
- Enable std functionality for CloudABI by default.
0.1.0 - 2019-03-23
Publish initial implementation.
0.0.0 - 2019-01-19
Publish an empty template library.