-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add CAAM AEAD support #7116
base: master
Are you sure you want to change the base?
Add CAAM AEAD support #7116
Conversation
Introduce Sequence Fifo load command Signed-off-by: Olivier Masse <olivier.masse@nxp.com>
Introduce more CCB CLR WR register Signed-off-by: Olivier Masse <olivier.masse@nxp.com>
Add caam_cpy_buf_src() function that copy a data buffer into a caam buffer. Signed-off-by: Olivier Masse <olivier.masse@nxp.com>
CI reported some issues, I will update the pull request. |
Implement CAAM AES GCM CAAM Errata: When running GCM (not GMAC) when the IV is not 12 bytes (96 bits), it is possible to "roll over" the 32-bit counter value. When this occurs (unless counter starts at -1), the AES operation will generate an incorrect MAC. This occurs even when -1 is used as the counter for the last block. The problem is that the 32-bit counter will overflow into the h value, thus corrupting the MAC. In order to reliably work around this (unlikely) issue, the AES operation must be stopped after initialization to determine the counter value to see whether/when it will roll over. Then, before the offending block is processed, the context needs to be saved. The one block gets processed twice : GCM, restore MAC, GMAC over its ciphertext, then patch up the message and AAD lengths, and carry on as normal. Signed-off-by: Olivier Masse <olivier.masse@nxp.com> Signed-off-by: Sahil Malhotra <sahil.malhotra@nxp.com>
Implement CAAM AES CCM Signed-off-by: Olivier Masse <olivier.masse@nxp.com>
imx6dl-sabresd, imx6q-sabresd, imx6sx-sdb does not support AES GCM Signed-off-by: Olivier Masse <olivier.masse@nxp.com> Signed-off-by: Sahil Malhotra <sahil.malhotra@nxp.com>
04f50ab
to
2db2095
Compare
There has been an addition of CAAM AEAD driver, to include that need to update imx-mx8mmevk compilation command in case of se050 enabled Signed-off-by: Sahil Malhotra <sahil.malhotra@nxp.com>
2db2095
to
d05d2ef
Compare
CI reported issues taken case. |
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.
Comments for the commit "drivers: caam: Add caam_cpy_buf_src()"
* @src_data Source to copy | ||
* @src_length Length to copy | ||
*/ | ||
enum caam_status caam_cpy_buf_src(struct caambuf *dst, uint8_t *src_data, |
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.
The _src
suffix isn't needed in the function name.
@@ -104,6 +104,17 @@ void caam_free_buf(struct caambuf *buf); | |||
enum caam_status caam_cpy_block_src(struct caamblock *block, | |||
struct caambuf *src, size_t offset); | |||
|
|||
/* | |||
* Copy source data into the buffer. Allocate buffer if |
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.
Copy data?
} | ||
|
||
/* Do the copy */ | ||
memcpy(dst->data, src_data, dst->length); |
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.
What if dst->length
!= src_length
?
@sahilnxp, please add your |
This pull request add support for CAAM AEAD support.
@omasse-linaro