Skip to content

Commit

Permalink
fix: Remove usage of OsRng in no_std (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d authored Dec 31, 2024
1 parent 39c52d5 commit af1c7bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sdk/src/signer/keypair.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![cfg(feature = "full")]

#[cfg(feature = "std")]
use std::path::Path;
#[cfg(feature = "wasm-bindgen")]
use wasm_bindgen::prelude::*;
use {
Expand All @@ -19,8 +17,10 @@ use {
io::{Read, Write},
prelude::*,
},
rand0_7::{rngs::OsRng, CryptoRng, RngCore},
rand0_7::{CryptoRng, RngCore},
};
#[cfg(feature = "std")]
use {rand0_7::rngs::OsRng, std::path::Path};

/// A vanilla Ed25519 key pair
#[cfg_attr(feature = "wasm-bindgen", wasm_bindgen)]
Expand Down Expand Up @@ -62,6 +62,7 @@ impl Keypair {
}

/// Constructs a new, random `Keypair` using `OsRng`
#[cfg(feature = "std")]
pub fn new() -> Self {
let mut rng = OsRng;
Self::generate(&mut rng)
Expand Down

0 comments on commit af1c7bb

Please sign in to comment.