Skip to content

[PATCH v9] api: crypto: add ZUC 256 algorithm#2335

Open
nkaithakadan wants to merge 2 commits intoOpenDataPlane:masterfrom
nkaithakadan:zuc_v2_spec
Open

[PATCH v9] api: crypto: add ZUC 256 algorithm#2335
nkaithakadan wants to merge 2 commits intoOpenDataPlane:masterfrom
nkaithakadan:zuc_v2_spec

Conversation

@nkaithakadan
Copy link
Copy Markdown
Contributor

Add ZUC256 cipher and integrity algorithm.

@odpbuild odpbuild changed the title api: crypto: add ZUC 256 algorithm [PATCH v1] api: crypto: add ZUC 256 algorithm Apr 10, 2026
@odpbuild odpbuild changed the title [PATCH v1] api: crypto: add ZUC 256 algorithm [PATCH v2] api: crypto: add ZUC 256 algorithm Apr 13, 2026
@nkaithakadan
Copy link
Copy Markdown
Contributor Author

@JannePeltonen Could you review these changes

@MatiasElo MatiasElo added this to the v1.5X.X milestone Apr 14, 2026
Comment thread include/odp/api/spec/crypto_types.h
@odpbuild odpbuild changed the title [PATCH v2] api: crypto: add ZUC 256 algorithm [PATCH v3] api: crypto: add ZUC 256 algorithm Apr 15, 2026
@odpbuild odpbuild changed the title [PATCH v3] api: crypto: add ZUC 256 algorithm [PATCH v4] api: crypto: add ZUC 256 algorithm Apr 16, 2026
@odpbuild odpbuild changed the title [PATCH v4] api: crypto: add ZUC 256 algorithm [PATCH v5] api: crypto: add ZUC 256 algorithm Apr 16, 2026
Copy link
Copy Markdown
Collaborator

@JannePeltonen JannePeltonen left a comment

Choose a reason for hiding this comment

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

The new algorithms should be added to the sysinfo example app and to crypto validation tests (I do not mean actual test vectors, but inclusion of the algorithms in the combined test). You can add such commits in this PR, or if you prefer, I can make the changes in a different PR. Just let me know.

Comment thread include/odp/api/spec/crypto_types.h Outdated
* 256-NCA6 algorithm.
*
* Key length is 256 bits. IV size is 16 bytes.
* Integrity tag size is 16 bytes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I do not think there is a need to fix the tag size to 16 bytes in the API here (you do not have it in NIA6 either) as the 3GPP spec seems to allow other tag sizes too. The tag size is a parameter in session creation and auth capabilities indicate the supported tag size (so an implementation could support only 16 bytes).

Comment thread include/odp/api/spec/crypto_types.h Outdated
* Key length is 256 bits. IV size is 16 bytes.
* Integrity tag size is 16 bytes.
*/
ODP_CIPHER_ALG_ZUC_NCA6,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ODP API handles AEAD algorithms in a bit cumbersome way. For each AEAD algorithm (see e.g. AES-GCM for an example), ODP API defines a cipher algorithm name (e.g. ODP_CIPHER_ALG_AES_GCM) and an auth algorithm name (e.g. ODP_AUTH_ALG_AES_GCM) and requires that they are used together. For instance, if a crypto session is configured with the ODP_CIPHER_ALG_AES_GCM cipher algorithm, then the auth algorithm must be ODP_AUTH_ALG_AES_GCM, and vice versa.

So, to support NCA6, you need to add the corresponding auth algorithm name ODP_AUTH_ALG_ZUC_NCA6 and the API text that requires the "cipher" and "auth" algorithms to be used together.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would also be ok to leave NCA6 out of this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NCA6 is moved out from this PR

*/
ODP_CIPHER_ALG_ZUC_EEA3,

/** NEA6 confidentiality algorithm
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The commit message could be improved.

I am not sure what the word 'align' in the subject line tires to convey. I think the subject line could be e.g.:
"api: crypto: add ZUC-256 NEA6, NIA6 and NCA6 algorithm"

The I think the commit message body could simply say something like this:
"Add 3GPP defined ZUC based confidentiality, integrity and AEAD algorithms with 256 bit key."
Now the body text is weird since the current API already has a variant of ZUC-256 with 16 byte IV and this commit just introduces another, subtly different variant. Also, I do not think there is anything improper in the current API as the commit message might imply.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@nkaithakadan
Copy link
Copy Markdown
Contributor Author

The new algorithms should be added to the sysinfo example app and to crypto validation tests (I do not mean actual test vectors, but inclusion of the algorithms in the combined test). You can add such commits in this PR, or if you prefer, I can make the changes in a different PR. Just let me know.

Hi Janne, I’m currently on vacation. I’ll add the suggested changes by EOD, if possible.

@JannePeltonen
Copy link
Copy Markdown
Collaborator

Hi Janne, I’m currently on vacation. I’ll add the suggested changes by EOD, if possible.

There is no hurry, as merging this will anyway have to wait until the next API release.

@odpbuild odpbuild changed the title [PATCH v5] api: crypto: add ZUC 256 algorithm [PATCH v6] api: crypto: add ZUC 256 algorithm Apr 27, 2026
@odpbuild odpbuild changed the title [PATCH v6] api: crypto: add ZUC 256 algorithm [PATCH v7] api: crypto: add ZUC 256 algorithm Apr 27, 2026
@odpbuild odpbuild changed the title [PATCH v7] api: crypto: add ZUC 256 algorithm [PATCH v8] api: crypto: add ZUC 256 algorithm Apr 29, 2026
Add 3GPP defined ZUC based confidentiality and integrity
algorithms with 256 bit key.

Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com>
Print ZUC 256 based crypto algorithm capabilities.

Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com>
@odpbuild odpbuild changed the title [PATCH v8] api: crypto: add ZUC 256 algorithm [PATCH v9] api: crypto: add ZUC 256 algorithm Apr 30, 2026
@nkaithakadan
Copy link
Copy Markdown
Contributor Author

Hi Janne,
I believe all comments have been addressed. Could you please rereview ?

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