From a8595f5b03bb3eeca46b6313f723a67114fb81fd Mon Sep 17 00:00:00 2001 From: chrysn Date: Thu, 11 Apr 2024 12:44:20 +0200 Subject: [PATCH] coap: Use OS RNG --- examples/coap/Cargo.toml | 3 ++- examples/coap/laze.yml | 1 + examples/coap/src/main.rs | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/coap/Cargo.toml b/examples/coap/Cargo.toml index a5b2962cc..0c6219c79 100644 --- a/examples/coap/Cargo.toml +++ b/examples/coap/Cargo.toml @@ -25,7 +25,8 @@ coap-message = "0.3.1" embassy-futures = "0.1.1" coap-message-demos = { version = "0.4.0", default-features = false } coap-request-implementations = "0.1.0-alpha.4" -rand = { version = "0.8.5", default-features = false, features = [ "small_rng" ] } +# ... and we ensure that it is usable by laze-depending on rng +riot-rs-random = { version = "0.1.0", path = "../../src/riot-rs-random" } [features] default = [ "proto-ipv4" ] # shame diff --git a/examples/coap/laze.yml b/examples/coap/laze.yml index ce37ee7fb..27218a407 100644 --- a/examples/coap/laze.yml +++ b/examples/coap/laze.yml @@ -3,3 +3,4 @@ apps: selects: - ?release - network + - rng diff --git a/examples/coap/src/main.rs b/examples/coap/src/main.rs index e795dec8e..5054f2bc3 100644 --- a/examples/coap/src/main.rs +++ b/examples/coap/src/main.rs @@ -74,8 +74,7 @@ where // Sync, and async_std expects to work in multiple threads embassy_futures::join::join( async { - let mut rand = rand::rngs::SmallRng::seed_from_u64(4); - use rand::SeedableRng; + let mut rand = riot_rs_random::get_rng(); server .run( &mut sock,