-
Notifications
You must be signed in to change notification settings - Fork 1.6k
nrf_security: Add CCM* support to CRACEN #30789
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
Open
sigvartmh
wants to merge
6
commits into
nrfconnect:main
Choose a base branch
from
sigvartmh:feat/add-ccm-star-support-for-cracen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a040113
nrf_security: cracen_sw_aes: fix small input buffer issue
sigvartmh 515536a
nrf_security: psa_crypto: Add CCM_STAR_NO_TAG config
sigvartmh 57159ab
nrf_security: sxsymcrypt: Allow zero-length CCM tag for CCM*
sigvartmh 28ff387
nrf_security: cracen: Implement CCM* no-tag cipher
sigvartmh c18cebb
tests: tfm_psa_test: Enable CCM_STAR_NO_TAG
sigvartmh 69947b3
doc: crypto: Mark CCM* no tag as supported by CRACEN
sigvartmh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -392,6 +392,10 @@ psa_status_t cracen_sw_aes_ccm_update(cracen_aead_operation_t *operation, const | |||
| size_t processed = 0; | ||||
| size_t counter_size = CCM_Q_LEN_FROM_NONCE(operation->nonce_length); | ||||
|
|
||||
| if (output_size < input_length) { | ||||
| return PSA_ERROR_BUFFER_TOO_SMALL; | ||||
| } | ||||
|
|
||||
| operation->ad_finished = true; | ||||
| status = initialize_cbc_mac(operation, &cipher); | ||||
| if (status != PSA_SUCCESS) { | ||||
|
|
@@ -459,6 +463,12 @@ psa_status_t cracen_sw_aes_ccm_finish(cracen_aead_operation_t *operation, uint8_ | |||
| struct sxblkcipher cipher; | ||||
| psa_status_t status; | ||||
|
|
||||
| *ciphertext_length = 0; | ||||
|
|
||||
| if (tag_size < operation->tag_size) { | ||||
| return PSA_ERROR_BUFFER_TOO_SMALL; | ||||
| } | ||||
|
Comment on lines
+468
to
+470
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, it looks like a duplicate to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true |
||||
|
|
||||
| status = initialize_cbc_mac(operation, &cipher); | ||||
| if (status != PSA_SUCCESS) { | ||||
| return status; | ||||
|
|
||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please consider moving this check to
cracen_aead_update()instead.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.
oki