Optimize the WASI random_get implementation. (#4917)
* Optimize the WASI `random_get` implementation. Use `StdRng` instead of the `OsRng` in the default implementation of `random_get`. This uses a userspace CSPRNG, making `random_get` 3x faster in simple benchmarks. * Update cargo-vet audits for cap-std 0.25.3. * Update all cap-std packages to 0.25.3.
This commit is contained in:
@@ -141,5 +141,5 @@ impl WasiCtxBuilder {
|
||||
}
|
||||
|
||||
pub fn random_ctx() -> Box<dyn RngCore + Send + Sync> {
|
||||
Box::new(cap_rand::rngs::OsRng::default(ambient_authority()))
|
||||
Box::new(cap_rand::std_rng_from_entropy(cap_rand::ambient_authority()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user