Upgrade rand to 0.9.1

This commit is contained in:
weisd
2025-06-09 10:13:03 +08:00
committed by houseme
parent 3edfdbea76
commit 152ad57c1d
14 changed files with 49 additions and 58 deletions
+2 -1
View File
@@ -42,8 +42,9 @@ fn encrypt<T: aes_gcm::aead::Aead>(
data: &[u8],
) -> Result<Vec<u8>, crate::Error> {
use crate::error::Error;
use aes_gcm::aead::rand_core::OsRng;
let nonce = T::generate_nonce(rand::thread_rng());
let nonce = T::generate_nonce(&mut OsRng);
let encryptor = stream.encrypt(&nonce, data).map_err(Error::ErrEncryptFailed)?;