Skip to content

Commit 0922b2a

Browse files
committed
Set bls_lagrange rand dependency to workspace.
Update to [email protected] and replace deprecated names.
1 parent 7628c5c commit 0922b2a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

anchor/common/bls_lagrange/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ blst_single_thread = ["blst"]
1414
bls = { workspace = true }
1515
blst = { workspace = true, optional = true }
1616
blstrs_plus = { workspace = true, optional = true }
17-
rand = "0.8.5"
17+
rand = { workspace= true }
1818
vsss-rs = { workspace = true, optional = true }
1919
zeroize = { workspace = true }
2020

anchor/common/bls_lagrange/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ pub fn split(
2727
threshold: u64,
2828
ids: impl IntoIterator<Item = KeyId>,
2929
) -> Result<Vec<(KeyId, SecretKey)>, Error> {
30-
split_with_rng(key, threshold, ids, &mut thread_rng())
30+
split_with_rng(key, threshold, ids, &mut rand::rng())
3131
}
3232

3333
#[cfg(any(feature = "blst", test))]
3434
pub(crate) fn random_key(rng: &mut (impl CryptoRng + Rng)) -> Result<SecretKey, Error> {
35-
let ikm = zeroize::Zeroizing::new(rng.r#gen::<[u8; 32]>());
35+
let ikm = zeroize::Zeroizing::new(rng.random::<[u8; 32]>());
3636
let sk =
3737
::blst::min_pk::SecretKey::key_gen(ikm.as_ref(), &[]).map_err(|_| Error::InternalError)?;
3838
// By passing a reference here, we drop "sk", zeroizing it.
@@ -57,8 +57,8 @@ mod tests {
5757
}
5858

5959
fn test_basic(rng: &mut (impl CryptoRng + Rng)) {
60-
let total = rng.gen_range(2..=13);
61-
let threshold = rng.gen_range(2..=total);
60+
let total = rng.random_range(2..=13);
61+
let threshold = rng.random_range(2..=total);
6262

6363
let master = random_key(rng).unwrap();
6464
let pk = master.public_key();
@@ -81,7 +81,7 @@ mod tests {
8181
let mut data = [0u8; 32];
8282
rng.fill(&mut data);
8383

84-
let signers = rng.gen_range(2..=total);
84+
let signers = rng.random_range(2..=total);
8585

8686
let signatures = keys
8787
.into_iter()

0 commit comments

Comments
 (0)