Commit Graph

106 Commits

Author SHA1 Message Date
Joe Richey 0579fe3014 Update documentation and error messages
This allows users to get an actionable error message about this
particular problem. We also add detection for this problem.

Signed-off-by: Joe Richey <joerichey@google.com>
2022-09-13 02:56:51 -07:00
Mauri Mustonen d3aa089bbd Add description about Cargo js feature for WebAssembly section (#280)
* add description about Cargo js feature
* add note about different crate types
* clean up
* Fix wording/grammer
* Remove "Indirect Depenencies" section
* Note that libraries shouldn't add their own JS feature

Signed-off-by: Joe Richey <joerichey@google.com>
Co-authored-by: Mauri Mustonen <mauri.mustonen@hotmail.com>
Co-authored-by: Joe Richey <joerichey@google.com>
2022-08-30 01:06:17 -07:00
Artyom Pavlov 0b71d50b49 Fix link to wasm-bindgen (#278) 2022-08-18 18:58:34 -07:00
Autumn 9a64857ae6 document the variation in underlying details of abstracted randomness sources (#276) 2022-08-18 01:53:05 +00: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
Артём Павлов [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
Þórhallur Sverrisson cf02327ac9 Enable support for espidf (esp32 family of microcontrollers) (#245) 2022-02-05 00:55:59 +00:00
Artyom Pavlov b9c7c0c13d Release v0.2.4 (#238) 2022-01-13 21:46:24 +00:00
Stewart Mackenzie ec445bb0ac Added x86_64-unknown-hermit support (#236) 2021-12-07 14:48:30 +00:00
Tomoaki Kawada f5e33009ed Add SOLID target support (#235) 2021-11-30 00:21:36 +00:00
Joseph Richey e4004f41fa redox: Switch to /dev/urandom (#222)
Signed-off-by: Joe Richey <joerichey@google.com>
2021-10-14 18:16:03 -07:00
Artyom Pavlov de51e2961d Release v0.2.3 (#211) 2021-05-20 08:00:44 +00:00
Tobias Klauser 24716865bd Fix dead link to NetBSD sysctl man page (#212)
Use the offical NetBSD man page URL https://man.netbsd.org

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2021-05-02 20:31:17 +00:00
Tobias Klauser 36d085a1f4 Add support for getrandom syscall on DragonFly BSD (#210)
DragonFly BSD supports the getrandom system call since version 5.7 [1].
Use it if available, otherwise fall back to /dev/random.

[1] https://leaf.dragonflybsd.org/cgi/web-man?command=getrandom

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2021-04-04 03:14:02 +00:00
Joseph Richey 0eb0be130e Update docs and compile_errors for wasm32-unknown-unknown (#209)
Signed-off-by: Joe Richey <joerichey@google.com>
2021-03-06 02:15:07 -08:00
Artyom Pavlov 9b2d55803e Fix WASI function name and doc link (#202) 2021-02-02 02:29:30 -08: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
Joseph Richey e29ed04f28 Move tests to tests/ directory (#195)
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 22:24:48 -08:00
Joe Richey d5186e0c86 Add Clippy msrv configuration file
This allows us to automatically ignore lints that are
incompatible with our MSRV.

Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 20:46:12 -08:00
Joe Richey a37be0df31 Fix Target Triple
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 07:38:34 -08:00
Joe Richey a0d23eb34e Rename BCryptGenRandom impl to windows.rs 2021-01-03 07:38:34 -08:00
Joe Richey ffb7215995 Remove RtlGenRandom implementation
Also remove outdated comment from windows_uwp.rs
2021-01-03 07:38:34 -08:00
Artyom Pavlov cadf11ecce Fix clippy warning (#187) 2021-01-02 15:20:56 -08:00
Artyom Pavlov 77740f8c45 remove direct stdweb support (#178) 2021-01-02 02:54:25 -08:00
Artyom Pavlov 9b4bb0047f Remove CloudABI support (#184)
* Remove CloudABI support and update CI
2021-01-02 02:42:43 -08:00
Robin Appelman b4834a5466 Fix redox<->cloudabi mixup in supported targets list (#182) 2020-12-18 05:24:40 +00:00
Joe Richey b9299988ea docs: add target triple to docs table
Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-10 00:45:13 -07:00
Joe Richey 1ebd2ce0e3 docs: Clarify intended usage for Custom RNGs
Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-10 00:45:13 -07:00
Joe Richey a6fa63c607 docs: Update section headers
Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-10 00:45:13 -07:00
Joe Richey b4160604d7 docs: Clarify when/where to use custom implementations
Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-10 00:45:13 -07:00
Joe Richey e8ff222285 docs: Update wasm32 support section
Include more links, exampales, and clarify wording

Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-10 00:45:13 -07:00
Joe Richey 4f4009a10f Format compile_error!
Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-10 00:45:13 -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 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 618593ca03 cpu: Have "cpu" feature take precedence over "custom"
Right now, features are always enabled across all targets. This means
that if _any_ Custom RNG is used _anywhere_ in a crate's dependancy
graph on _any_ target. The "custom" feature will be active on all
targets.

This makes it impossible to have a bare metal target that uses "cpu" on
x86_64 and a Custom RNG on aarch64. This solution also makes sure that
any implementation `getrandom` itself provides cannot be overridden.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-28 19:03:02 -07:00
Joe Richey afcfcd1525 build: Remove getrandom_uwp cfg
As our minimum rust version is 1.33, we can just use `target_vendor`.
2020-04-27 00:14:53 -07:00
Joe Richey 2e39004c4b rdrand: Add 32-bit x86 support
Also add tests for 32-bit x86
2020-02-20 15:24:57 -08:00
Joe Richey 52e7e9fe23 tests: Test CPU-based RNG on all x86 targets
This allows us to verify the RDRAND implementation on Linux.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-02-19 10:21:58 -08:00
Joe Richey 1375181832 tests: Improve testing infrastructure
- Cleanup .travis.yml
  - Loops over std/no_std targets
  - Remove deprecated/useless keys
  - No more `cd`, we just use `--package`.
- Improve tests
  - Main `getrandom` tests are now unit test modules instead of
    integration tests, making the code cleaner.
  - The custom RNG crates now use this common module as part of their
    integration tests.
  - No more weird test-only features needed to get the crate to build.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-02-19 10:21:58 -08: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 cd84484205 target: Drop support for some x86_64 targets
We will use a more generic "cpu" mechanism to support these.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-02-19 10:21:58 -08: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
Joseph Richey 8096bac100 0.2: Error and Testing improvements (#120) 2019-10-28 08:06:05 +00:00
Joseph Richey cf2d81bfff Improve src/lib.rs cfgs (#119)
Right now for each of `util_libc` and `use_file` we have a list of
`target_os` configs to determine if we build the module.

This PR moves these mod declarations into the main `cfg_if` statement
(the one that selects which implementation we use). This way, the mod
statements are kept in-sync with the implementations that use them.

Also, I merged together `target_os` cfgs that have the same
implementation. The downside to this is that the targets are no longer
in alphabetical order.

Also, this is only being applied to `0.2` as the `0.1` cfgs still have
to keep `std` around.
2019-10-25 12:55:12 +00:00