Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include AES_CBC_ENCRYPT_DATA mechanism #149

Conversation

chrisFrodo
Copy link

@chrisFrodo chrisFrodo commented Jun 7, 2023

Hi,
I noticed AES_CBC_ENCRYPT_DATA and it's param structure AES_CBC_ENCRYPT_DATA_PARAMS were not included in the Mechanism enum.
Using other implementation codebase, i managed to include it.
I tested it using SoftHSM2.

Copy link
Collaborator

@wiktor-k wiktor-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if SoftHSMv2 supports this mechanism but if it does it'd be good if we had tests for it. Otherwise this looks good 👍

@@ -0,0 +1,51 @@
// Copyright 2021 Contributors to the Parsec project.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Copyright 2021 Contributors to the Parsec project.
// Copyright 2023 Contributors to the Parsec project.

///
/// # Panics
///
/// This function panics if the lenght of `data` does not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This function panics if the lenght of `data` does not
/// This function panics if the length of `data` does not

pub fn data(&self) -> &[u8] {
unsafe { std::slice::from_raw_parts(self.inner.pData, self.inner.length as _) }
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a newline here would be nice.

inner: CK_AES_CBC_ENCRYPT_DATA_PARAMS,
_marker: PhantomData<&'a [u8]>,
}
impl<'a> AesCBCEncryptDataParams<'a> {
Copy link
Contributor

@gowthamsk-arm gowthamsk-arm Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: line spacing may be good :)

@wiktor-k
Copy link
Collaborator

Apparently this is already implemented through #178. Closing...

@wiktor-k wiktor-k closed this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants