Skip to content

Commit

Permalink
Feature gate key generation on the "rand" dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
isislovecruft committed Sep 21, 2020
1 parent 6609642 commit b5a15bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ impl Keypair {
/// The standard hash function used for most ed25519 libraries is SHA-512,
/// which is available with `use sha2::Sha512` as in the example above.
/// Other suitable hash functions include Keccak-512 and Blake2b-512.
#[cfg(feature = "rand")]
pub fn generate<R>(csprng: &mut R) -> Keypair
where
R: CryptoRng + RngCore,
Expand Down
1 change: 1 addition & 0 deletions src/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ impl SecretKey {
/// # Input
///
/// A CSPRNG with a `fill_bytes()` method, e.g. `rand::OsRng`
#[cfg(feature = "rand")]
pub fn generate<T>(csprng: &mut T) -> SecretKey
where
T: CryptoRng + RngCore,
Expand Down

0 comments on commit b5a15bf

Please sign in to comment.