Skip to content

Commit c64c770

Browse files
Update rand to 0.9
1 parent ba46fc5 commit c64c770

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ aes-gcm = { version = "0.10.0", optional = true }
2929
hmac = { version = "0.12.0", optional = true }
3030
sha2 = { version = "0.10.0", optional = true }
3131
base64 = { version = "0.22", optional = true }
32-
rand = { version = "0.8", optional = true }
32+
rand = { version = "0.9", optional = true }
3333
hkdf = { version = "0.12.0", optional = true }
3434
subtle = { version = "2.3", optional = true }
3535

src/secure/key.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ impl Key {
137137
/// let key = Key::try_generate();
138138
/// ```
139139
pub fn try_generate() -> Option<Key> {
140-
use crate::secure::rand::RngCore;
140+
use crate::secure::rand::TryRngCore;
141141

142-
let mut rng = crate::secure::rand::thread_rng();
142+
let mut rng = crate::secure::rand::rng();
143143
let mut key = Key::zero();
144144
rng.try_fill_bytes(&mut key.0).ok()?;
145145
Some(key)

src/secure/private.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{Cookie, CookieJar};
88

99
use self::aes_gcm::aead::{generic_array::GenericArray, Aead, AeadInPlace, KeyInit, Payload};
1010
use self::aes_gcm::Aes256Gcm;
11-
use self::rand::RngCore;
11+
use self::rand::TryRngCore;
1212

1313
// Keep these in sync, and keep the key len synced with the `private` docs as
1414
// well as the `KEYS_INFO` const in secure::Key.
@@ -50,7 +50,7 @@ impl<J> PrivateJar<J> {
5050
in_out.copy_from_slice(cookie_val);
5151

5252
// Fill nonce piece with random data.
53-
let mut rng = self::rand::thread_rng();
53+
let mut rng = self::rand::rng();
5454
rng.try_fill_bytes(nonce).expect("couldn't random fill nonce");
5555
let nonce = GenericArray::clone_from_slice(nonce);
5656

0 commit comments

Comments
 (0)