Skip to content

Commit

Permalink
dep: getrandom v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
brycx committed Jan 27, 2025
1 parent e7151e4 commit 377188e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exclude = [".gitignore", ".travis.yml", "tests/*"]
subtle = { version = "^2.2.2", default-features = false }
zeroize = { version = "1.1.0", default-features = false }
fiat-crypto = { version = "0.2.1", default-features = false }
getrandom = { version = "0.2.0", optional = true }
getrandom = { version = "0.3.0", optional = true }
ct-codecs = { version = "1.1.1", optional = true }

[dependencies.serde]
Expand Down
5 changes: 2 additions & 3 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ fn test_unknown_crypto_error_debug_display() {
#[cfg(feature = "safe_api")]
// format! is only available with std
fn test_unknown_crypto_from_getrandom() {
use core::num::NonZeroU32;
// Choose some random error code.
let err_code = NonZeroU32::new(12).unwrap();
let err_foreign: getrandom::Error = getrandom::Error::from(err_code);
let err_code: u16 = 12;
let err_foreign: getrandom::Error = getrandom::Error::new_custom(err_code);

// Tests Debug impl through "{:?}"
let err = format!("{:?}", UnknownCryptoError::from(err_foreign));
Expand Down
2 changes: 1 addition & 1 deletion src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn secure_rand_bytes(dst: &mut [u8]) -> Result<(), errors::UnknownCryptoErro
return Err(errors::UnknownCryptoError);
}

getrandom::getrandom(dst).unwrap();
getrandom::fill(dst).unwrap();

Ok(())
}
Expand Down

0 comments on commit 377188e

Please sign in to comment.