mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
rust/crypto: Export random_array
The function is useful, therefore export it. Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
385ba6b51f
commit
dec796d52f
@@ -150,7 +150,7 @@ pub fn derive_aes256_gcm_key(k1: &PKeyRef<Private>, k2: &PKeyRef<Public>) -> Res
|
||||
/// # Errors
|
||||
///
|
||||
/// This function will return an error if the entropy source fails or is not available.
|
||||
pub(crate) fn random_array<const COUNT: usize>() -> Result<[u8; COUNT]> {
|
||||
pub fn random_array<const COUNT: usize>() -> Result<[u8; COUNT]> {
|
||||
let mut rand = [0; COUNT];
|
||||
rand_bytes(&mut rand)?;
|
||||
Ok(rand)
|
||||
|
||||
@@ -92,7 +92,7 @@ pub use pv_core::{FileAccessErrorType, FileIoErrorType};
|
||||
/// Functionalities to build UV requests
|
||||
pub mod request {
|
||||
pub use crate::brcb::BootHdrTags;
|
||||
pub use crate::crypto::{derive_aes256_gcm_key, SymKey, SymKeyType};
|
||||
pub use crate::crypto::{derive_aes256_gcm_key, random_array, SymKey, SymKeyType};
|
||||
pub use crate::req::{EcPubKeyCoord, Keyslot, ReqEncrCtx, Request};
|
||||
pub use crate::verify::{CertVerifier, HkdVerifier, NoVerifyHkd};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user