95 Commits

Author SHA1 Message Date
0c156352b5 alnyan/yggdrasil: use std instead of yggdrasil-rt 2024-01-28 18:56:27 +02:00
69a646b970 alnyan/yggdrasil: add Yggdrasil getrandom 2024-01-28 18:54:42 +02:00
Artyom Pavlov
f68a940b4d
Release v0.2.12 (#389) 2024-01-09 08:33:08 +03:00
Artyom Pavlov
853c1dc592
Release v0.2.11 (#379) 2023-11-06 22:04:43 -08:00
Artyom Pavlov
4c094c3754
Add workaround for cross-rs/cross#1345 (#380) 2023-11-07 07:39:49 +03:00
Samuel Thibault
8476c4436d
Add GNU/Hurd support (#370)
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2023-11-07 07:13:56 +03:00
Artyom Pavlov
2e483d68aa
Release v0.2.10 (#364) 2023-06-06 18:07:03 +03:00
Nikolay Arhipov
53cf0cc3af
Add support for PS Vita (armv7-sony-vita-newlibeabihf) (#359) 2023-05-07 10:35:48 +00:00
Artyom Pavlov
abe7ef3107
Release v0.2.9 (#354) 2023-04-06 16:20:27 -07:00
Florian Bartels
993505c17f
Enable tests for QNX/Neutrino, integrate new libc version 2022-12-23 07:50:53 +01:00
Thom Chiovoloni
e32ea822c3
Add tvOS and watchOS to CI 2022-10-24 23:24:56 -07:00
Joe Richey
1d371ef5e2 Add wasm64-unknown-unknown support
We can build and link just fine, but we cannot actually run the tests as
`wasm-bindgen-test-runner` hasn't yet added support.

Signed-off-by: Joe Richey <joerichey@google.com>
2022-10-23 13:47:00 -07:00
Joseph Richey
f2d76625d5
Solaris: consistantly use /dev/random source (#310)
On Solaris, we opt to use /dev/random source instead of /dev/urandom due
to reasons explained in the comments and
[in this Solaris blog post](https://blogs.oracle.com/solaris/post/solaris-new-system-calls-getentropy2-and-getrandom2).

However, we haven't been making the same choice when getting randomness
via the `getrandom(2)` function, as we just pass `0` for the flags. We
[used to](https://github.com/rust-random/rand/pull/730/files#diff-694d4302a3ff2a976f2fbd34bc05ada22ee61a4e21d2d985beab27f7a809268fR151)
always set `GRND_RANDOM`, but that was removed in the move from `OsRng`
to this crate.

For context, https://github.com/rust-random/rand/pull/730,
https://github.com/rust-random/getrandom/pull/9, and
https://github.com/rust-random/getrandom/pull/51 are the major changes
to the Solaris/Illumos implementation over the years.

See the solaris documentation for:
- [`getrandom(2)`](https://docs.oracle.com/cd/E88353_01/html/E37841/getrandom-2.html)
- [`urandom(4)`](https://docs.oracle.com/cd/E88353_01/html/E37851/urandom-4d.html)

I also updated the doucmentation to better reflect when
[Illumos added the `getrandom(2)` function](https://www.illumos.org/issues/9971#change-23483).

Signed-off-by: Joe Richey <joerichey@google.com>
2022-10-23 13:46:01 -07:00
Joseph Richey
ad08dd9e72
Cleanup wasm32-wasi target (#306)
* Cleanup wasm32-wasi target

This change ensures that we only compile our WASI implementation for
32-bit targets. The interaction between the WASI proposal and the
memory64 proposal is not yet clear, [wasmtime does not yet support](
https://github.com/bytecodealliance/wasmtime/issues/3594#issuecomment-992590383)
using WASI with memory64, and many of the interfaces use 32-bit values
for pointers.

This change also reduces the use of `unsafe` from the wasi
implementation. As noted in #253, changes to `Errno` mean that we can't
get the error message from the raw error code, but we can avoid using
unsafe when converting this code to a NonZeroU32. This handling also
makes WASI behave more like our other targets, which also manually check
that errno is non-zero.

Signed-off-by: Joe Richey <joerichey@google.com>

* Disable default features for WASI crate

Similar to this crate, the `wasi` crate just uses a `std` feature to
implement `std::error::Errno`, which we don't use.

Signed-off-by: Joe Richey <joerichey@google.com>

Signed-off-by: Joe Richey <joerichey@google.com>
2022-10-23 13:29:09 -07:00
Joseph Richey
5c1bb00b74
Release v0.2.8 (#294)
Also updates the changelog

Signed-off-by: Joe Richey <joerichey@google.com>
2022-10-20 13:53:06 -07:00
Joseph Richey
63f861c684
Release v0.2.7 (#264)
Signed-off-by: Joe Richey <joerichey@google.com>
2022-06-13 14:31:59 -07:00
Thomas de Zeeuw
2d65a40cc5
Update to wasi 0.11 (#253)
* Update to wasi 0.11

The main breaking change between v0.10 and v0.11 is that Error is
removed in favour of Errno. Unfortunately we can't create an Errno from
outside the wasi create so we're loosing some debug information for
errors.

I've opened an issue to add back such a constructor, see
<https://github.com/bytecodealliance/wasi/issues/64>.

* Use libc::strerror to get the error message on wasi

Since wasi v0.11 doesn't (yet) provided a way to create Errno, see
<https://github.com/bytecodealliance/wasi/issues/64>.

* Remove libc dependency for WASI

This does mean that we won't get an error message for the error type.
2022-04-15 02:20:44 -07:00
Артём Павлов [Artyom Pavlov]
2630158149 Release v0.2.6 2022-03-26 01:09:35 +03:00
Mark Drobnak
d40ec2c7e4
Add support for the Nintendo 3DS (armv6k-nintendo-3ds) (#248) 2022-03-25 16:26:05 +00:00
Artyom Pavlov
cd3a987b9b
Release v0.2.5 (#247) 2022-02-22 12:09:08 +00:00
Artyom Pavlov
b9c7c0c13d
Release v0.2.4 (#238) 2022-01-13 21:46:24 +00:00
Artyom Pavlov
de51e2961d
Release v0.2.3 (#211) 2021-05-20 08:00:44 +00:00
Artyom Pavlov
d79de0c95c
Release v0.2.2 (#201) 2021-01-19 12:34:27 +00:00
Артём Павлов [Artyom Pavlov]
69634b700e Use doc_cfg to improve register_custom_getrandom docs 2021-01-18 01:00:23 +03:00
Joe Richey
3661e9dc2a
Properly forward rustc-dep-of-std feature
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-17 00:28:36 -08:00
Artyom Pavlov
6c94834850
Remove outdated entries from Cargo.toml (#193) 2021-01-03 20:43:15 -08:00
Artyom Pavlov
95be9b40b4
Release v0.2.1 (#188)
Updates Changelog to include v0.1.16 changes as well
2021-01-03 19:52:26 -08:00
Artyom Pavlov
77740f8c45
remove direct stdweb support (#178) 2021-01-02 02:54:25 -08:00
Jurgis
c29dd5f80e
Fix multithreaded wasm crash (solves #164) (#165)
Signed-off-by: Joe Richey <joerichey@google.com>
2020-10-26 13:41:31 -07:00
koushiro
3a7e605345 Update wasi to 0.10
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2020-10-15 23:11:33 -07:00
Matt Brubeck
7dd681ec08 Update to cfg-if 1.0 2020-10-15 22:25:36 -07:00
Joe Richey
99260dfaef Update docs for 0.2
The main things here are clarifying how fallback functionatliy works.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-10 00:45:13 -07:00
Joe Richey
4d750dd240 travis: Enable Firefox testing
https://github.com/rustwasm/wasm-bindgen/pull/2305 released the bugfix for wasm-bindgen.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-09 00:53:31 -07:00
Joe Richey
11b4f9e406 wasm: Update testing framework
Add back the "test-in-browser" feature. This makes it easier to manage
a single file containing all of the test code.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-29 01:11:13 -07:00
Joe Richey
eacffd578a wasm: Move JS-based Custom RNGs back into the main crate
They will be gated behind the "js" feature, as we can now do detect,
at compile-time, which implementation (wasm-bindgen vs stdweb) we
should use.

The "js" implementation takes precedence over the "custom"
implementation. This prevents issues that arise from the buggy way
Cargo handles features across multiple targets.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-29 01:11:13 -07:00
Joe Richey
6aba12ccdb Rename "cpu" feature to "rdrand"
Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-28 19:03:02 -07:00
Joe Richey
ff6299dd77 cpu: Add support for CPU-based randomness
This allows freestanding targets to use getrandom.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-02-19 10:21:58 -08:00
Joe Richey
8365277450 custom: Add Custom RNG for wasm-bindgen 2020-01-10 09:16:20 +00:00
Joe Richey
7d558f1cc3 custom: Add custom RNG for stdweb 2020-01-10 09:16:20 +00:00
Joe Richey
3d7a7b5f06 Remove built-in support for wasm32-unknown-unknown 2020-01-10 09:16:20 +00:00
Joe Richey
448bcac6b1 custom: Add support for Custom RNGs 2020-01-10 09:16:20 +00:00
Joseph Richey
d6b75d1c05
log: Remove optional log dependancy (#131)
This feature isn't enabled by rand/rand_core and provides very little
error information that isn't already conveyed through our Error values.

This also simplifies the supported configuration space for getrandom.
We update the docs and CI to match this change.
2020-01-09 13:27:09 -08:00
Joe Richey
0f14f2a186 Merge branch 'master' into 0.2
Signed-off-by: Joe Richey <joerichey@google.com>
2020-01-08 11:11:08 -08:00
Artyom Pavlov
33b859bae1
Prepare release v0.1.14 (#128) 2020-01-07 12:05:23 +00:00
Joseph Richey
48781cd9ec wasi: Update and Fix Travis failures (#126) 2020-01-05 20:59:50 +00:00
Joseph Richey
8096bac100 0.2: Error and Testing improvements (#120) 2019-10-28 08:06:05 +00:00
Artyom Pavlov
d661aa7e1b
Prepare release v0.1.13 (#118) 2019-10-25 12:25:33 +00:00
Joe Richey
1f1f964e4a Merge branch 'master' into 0.2 2019-10-24 02:10:00 -07:00
Artyom Pavlov
9a385f1923
Add VxWorks support (#86) 2019-10-23 09:35:50 +00:00
Joseph Richey
add45a3899 Remove dummy implementation (#107)
Removes the “dummy” feature and “wasm32-unknown-unknown” dummy impl
2019-10-15 23:40:05 -07:00