Upgrade the getrandom crate
This commit is contained in:
parent
ea5e384c60
commit
74d9903f69
4 changed files with 4 additions and 4 deletions
|
@ -22,7 +22,7 @@ benchmark = ["criterion"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
base64ct = { version = "1.6.0", default-features = false, features = ["std"] }
|
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 }
|
thiserror = { version = "2.0.3", default-features = false }
|
||||||
|
|
||||||
# chacha feature:
|
# chacha feature:
|
||||||
|
|
|
@ -243,7 +243,7 @@ impl InputKeyMaterialList {
|
||||||
) -> Result<IkmId> {
|
) -> Result<IkmId> {
|
||||||
let ikm_len = scheme.get_ikm_size();
|
let ikm_len = scheme.get_ikm_size();
|
||||||
let mut content: Vec<u8> = vec![0; ikm_len];
|
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.id_counter += 1;
|
||||||
self.ikm_lst.push(InputKeyMaterial {
|
self.ikm_lst.push(InputKeyMaterial {
|
||||||
id: self.id_counter,
|
id: self.id_counter,
|
||||||
|
|
|
@ -13,7 +13,7 @@ const NONCE_SIZE: usize = 12;
|
||||||
|
|
||||||
pub(crate) fn aes128gcm_gen_nonce() -> Result<Vec<u8>> {
|
pub(crate) fn aes128gcm_gen_nonce() -> Result<Vec<u8>> {
|
||||||
let mut nonce: [u8; NONCE_SIZE] = [0; NONCE_SIZE];
|
let mut nonce: [u8; NONCE_SIZE] = [0; NONCE_SIZE];
|
||||||
getrandom::getrandom(&mut nonce)?;
|
getrandom::fill(&mut nonce)?;
|
||||||
Ok(nonce.to_vec())
|
Ok(nonce.to_vec())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ const NONCE_SIZE: usize = 24;
|
||||||
|
|
||||||
pub(crate) fn xchacha20poly1305_gen_nonce() -> Result<Vec<u8>> {
|
pub(crate) fn xchacha20poly1305_gen_nonce() -> Result<Vec<u8>> {
|
||||||
let mut nonce: [u8; NONCE_SIZE] = [0; NONCE_SIZE];
|
let mut nonce: [u8; NONCE_SIZE] = [0; NONCE_SIZE];
|
||||||
getrandom::getrandom(&mut nonce)?;
|
getrandom::fill(&mut nonce)?;
|
||||||
Ok(nonce.to_vec())
|
Ok(nonce.to_vec())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue