Skip to content

Commit

Permalink
Combined fixes from parallaxsecond#218
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Devolder <[email protected]>
  • Loading branch information
keldonin committed Aug 29, 2024
1 parent 6a88acf commit 8a13adc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cryptoki/src/mechanism/ekdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl<'a> AesCbcDeriveParams<'a> {
/// * `iv` - The initialization vector
///
/// * `data` - Data that will be encryption with the base key to obtain
/// the new key from the resulted cypher.
/// the new key from the resulted cypher.
pub fn new(iv: [u8; 16], data: &'a [u8]) -> Self {
Self {
inner: cryptoki_sys::CK_AES_CBC_ENCRYPT_DATA_PARAMS {
Expand Down
14 changes: 7 additions & 7 deletions cryptoki/src/mechanism/elliptic_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ impl<'a> Ecdh1DeriveParams<'a> {
/// * `kdf` - The key derivation function to use.
///
/// * `public_data` - The other party's public key. A token MUST be able
/// to accept this value encoded as a raw octet string (as per section
/// A.5.2 of ANSI X9.62). A token MAY, in addition, support accepting
/// this value as a DER-encoded `ECPoint` (as per section E.6 of ANSI
/// X9.62) i.e. the same as a `CKA_EC_POINT` encoding. The calling
/// application is responsible for converting the offered public key to the
/// compressed or uncompressed forms of these encodings if the token does
/// not support the offered form.
/// to accept this value encoded as a raw octet string (as per section
/// A.5.2 of ANSI X9.62). A token MAY, in addition, support accepting
/// this value as a DER-encoded `ECPoint` (as per section E.6 of ANSI
/// X9.62) i.e. the same as a `CKA_EC_POINT` encoding. The calling
/// application is responsible for converting the offered public key to the
/// compressed or uncompressed forms of these encodings if the token does
/// not support the offered form.
pub fn new(kdf: EcKdf<'a>, public_data: &'a [u8]) -> Self {
Self {
kdf: kdf.kdf_type,
Expand Down
2 changes: 1 addition & 1 deletion cryptoki/src/session/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl Session {
/// # Arguments
///
/// * `random_slice` - The slice to stick the random data into. The length of the slice represents
/// the number of bytes to obtain from the RBG
/// the number of bytes to obtain from the RBG
pub fn generate_random_slice(&self, random_data: &mut [u8]) -> Result<()> {
unsafe {
Rv::from(get_pkcs11!(self.client(), C_GenerateRandom)(
Expand Down

0 comments on commit 8a13adc

Please sign in to comment.