-
Notifications
You must be signed in to change notification settings - Fork 61
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
Include AES_CBC_ENCRYPT_DATA mechanism #149
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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 _) } | ||
} | ||
} |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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 :)
Apparently this is already implemented through #178. Closing... |
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.