diff --git a/rust/pv/src/req/context.rs b/rust/pv/src/req/context.rs index 1cc6c9f3..1e49ef67 100644 --- a/rust/pv/src/req/context.rs +++ b/rust/pv/src/req/context.rs @@ -2,6 +2,8 @@ // // Copyright IBM Corp. +//! Request encryption context for managing UV request encryption. + use std::mem::size_of; use openssl::nid::Nid; @@ -34,7 +36,7 @@ impl ReqEncrCtx { /// * `priv_key` - Private key to wrap [`Keyslot`](super::Keyslot) /// * `prot_key` - Symmetric key for request encryption. Part of [`Keyslot`](super::Keyslot) /// - /// If an argument is set to `None` a ranom is generated + /// If an argument is set to `None` a random is generated /// /// # Errors /// @@ -62,8 +64,8 @@ impl ReqEncrCtx { /// # Errors /// /// This function will return an error if OpenSSL could not generate a random value. - pub fn random(ket_tp: SymKeyType) -> Result { - match ket_tp { + pub fn random(key_tp: SymKeyType) -> Result { + match key_tp { SymKeyType::Aes256Gcm => Self::new_aes_256(None, None, None), SymKeyType::Aes256Xts => Err(Error::NoAeadKey), } diff --git a/rust/pv/src/req/ec_coord.rs b/rust/pv/src/req/ec_coord.rs index 850feb30..b8882e3f 100644 --- a/rust/pv/src/req/ec_coord.rs +++ b/rust/pv/src/req/ec_coord.rs @@ -2,6 +2,8 @@ // // Copyright IBM Corp. +//! EC public key coordinate utilities and conversions. + use openssl::bn::{BigNum, BigNumContext}; use openssl::ec::{EcGroup, EcGroupRef, EcKey, EcPointRef}; use openssl::error::ErrorStack; diff --git a/rust/pv/src/req/encrypt.rs b/rust/pv/src/req/encrypt.rs index f51fe0c6..3f91f9ce 100644 --- a/rust/pv/src/req/encrypt.rs +++ b/rust/pv/src/req/encrypt.rs @@ -2,9 +2,11 @@ // // Copyright IBM Corp. +//! Encryption trait and authenticated data types for UV requests. + use openssl::pkey::{PKeyRef, Private}; -use super::keyslot::Keyslot; +use crate::req::Keyslot; use crate::Result; /// Encrypt a _secret_ using self and a given private key. diff --git a/rust/pv/src/req/header.rs b/rust/pv/src/req/header.rs index 9ddcd5b4..da4a5f05 100644 --- a/rust/pv/src/req/header.rs +++ b/rust/pv/src/req/header.rs @@ -2,12 +2,13 @@ // // Copyright IBM Corp. +//! Request header structure for UV requests. use zerocopy::{BigEndian, FromBytes, Immutable, IntoBytes, U32}; use crate::assert_size; /// Representation of the shared parts of the request header. -/// Used by [`ReqEncrCtx`] +/// Used by [`ReqEncrCtx`](super::ReqEncrCtx) #[repr(C)] #[derive(Debug, Copy, Clone, IntoBytes, FromBytes, Immutable)] pub struct RequestHdr { diff --git a/rust/pv/src/req/keyslot.rs b/rust/pv/src/req/keyslot.rs index 82d6e169..7989ee48 100644 --- a/rust/pv/src/req/keyslot.rs +++ b/rust/pv/src/req/keyslot.rs @@ -2,6 +2,8 @@ // // Copyright IBM Corp. +//! IBM Z Host key-slot implementations. + use openssl::hash::MessageDigest; use openssl::pkey::{PKey, PKeyRef, Private, Public};