Upgrade the getrandom crate

This commit is contained in:
Rodolphe Bréard 2025-01-27 09:26:38 +01:00
parent ea5e384c60
commit 74d9903f69
Signed by: rodolphe
SSH key fingerprint: SHA256:3rodCKnk1MUOfSlIKY0nHbBtvFyQx4EqjS+JIy69lN0
4 changed files with 4 additions and 4 deletions

View file

@ -22,7 +22,7 @@ benchmark = ["criterion"]
[dependencies]
base64ct = { version = "1.6.0", default-features = false, features = ["std"] }
getrandom = { version = "0.2.12", default-features = false }
getrandom = { version = "0.3.0", default-features = false }
thiserror = { version = "2.0.3", default-features = false }
# chacha feature:

View file

@ -243,7 +243,7 @@ impl InputKeyMaterialList {
) -> Result<IkmId> {
let ikm_len = scheme.get_ikm_size();
let mut content: Vec<u8> = vec![0; ikm_len];
getrandom::getrandom(content.as_mut_slice())?;
getrandom::fill(content.as_mut_slice())?;
self.id_counter += 1;
self.ikm_lst.push(InputKeyMaterial {
id: self.id_counter,

View file

@ -13,7 +13,7 @@ const NONCE_SIZE: usize = 12;
pub(crate) fn aes128gcm_gen_nonce() -> Result<Vec<u8>> {
let mut nonce: [u8; NONCE_SIZE] = [0; NONCE_SIZE];
getrandom::getrandom(&mut nonce)?;
getrandom::fill(&mut nonce)?;
Ok(nonce.to_vec())
}

View file

@ -9,7 +9,7 @@ const NONCE_SIZE: usize = 24;
pub(crate) fn xchacha20poly1305_gen_nonce() -> Result<Vec<u8>> {
let mut nonce: [u8; NONCE_SIZE] = [0; NONCE_SIZE];
getrandom::getrandom(&mut nonce)?;
getrandom::fill(&mut nonce)?;
Ok(nonce.to_vec())
}