Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions example/sysinfo/odp_sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ static const char *cipher_alg_name(odp_cipher_alg_t cipher)
return "aes_eea2";
case ODP_CIPHER_ALG_ZUC_EEA3:
return "zuc_eea3";
case ODP_CIPHER_ALG_ZUC_NEA6:
return "zuc_nea6";
case ODP_CIPHER_ALG_SNOW_V:
return "snow_v";
case ODP_CIPHER_ALG_SNOW_V_GCM:
Expand Down Expand Up @@ -263,6 +265,8 @@ static const char *auth_alg_name(odp_auth_alg_t auth)
return "aes_eia2";
case ODP_AUTH_ALG_ZUC_EIA3:
return "zuc_eia3";
case ODP_AUTH_ALG_ZUC_NIA6:
return "zuc_nia6";
case ODP_AUTH_ALG_SNOW_V_GCM:
return "snow_v_gcm";
case ODP_AUTH_ALG_SNOW_V_GMAC:
Expand Down Expand Up @@ -341,6 +345,8 @@ static void foreach_cipher(odp_crypto_cipher_algos_t ciphers, cipher_op_t op)
op(ODP_CIPHER_ALG_AES_EEA2);
if (ciphers.bit.zuc_eea3)
op(ODP_CIPHER_ALG_ZUC_EEA3);
if (ciphers.bit.zuc_nea6)
op(ODP_CIPHER_ALG_ZUC_NEA6);
if (ciphers.bit.snow_v)
op(ODP_CIPHER_ALG_SNOW_V);
if (ciphers.bit.snow_v_gcm)
Expand Down Expand Up @@ -403,6 +409,8 @@ static void foreach_auth(odp_crypto_auth_algos_t auths, auth_op_t op)
op(ODP_AUTH_ALG_AES_EIA2);
if (auths.bit.zuc_eia3)
op(ODP_AUTH_ALG_ZUC_EIA3);
if (auths.bit.zuc_nia6)
op(ODP_AUTH_ALG_ZUC_NIA6);
if (auths.bit.snow_v_gcm)
op(ODP_AUTH_ALG_SNOW_V_GCM);
if (auths.bit.snow_v_gmac)
Expand Down
22 changes: 22 additions & 0 deletions include/odp/api/spec/crypto_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ typedef enum {
*/
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

*
* 256-NEA6 algorithm.
*
* Key length is 256 bits. IV size is 16 bytes.
*/
ODP_CIPHER_ALG_ZUC_NEA6,
Comment thread
JannePeltonen marked this conversation as resolved.

/** SNOW-V stream cipher */
ODP_CIPHER_ALG_SNOW_V,

Expand Down Expand Up @@ -387,6 +395,14 @@ typedef enum {
*/
ODP_AUTH_ALG_ZUC_EIA3,

/** NIA6 integrity algorithm
*
* 256-NIA6 algorithm.
*
* Key length is 256 bits. IV size is 16 bytes.
*/
ODP_AUTH_ALG_ZUC_NIA6,

/** SNOW-V-GCM AEAD algorithm
*
* SNOW-V-GCM provides both authentication and encryption. This auth
Expand Down Expand Up @@ -536,6 +552,9 @@ typedef union odp_crypto_cipher_algos_t {
/** ODP_CIPHER_ALG_ZUC_EEA3 */
uint32_t zuc_eea3 : 1;

/** ODP_CIPHER_ALG_ZUC_NEA6 */
uint32_t zuc_nea6 : 1;

/** ODP_CIPHER_ALG_SNOW_V */
uint32_t snow_v : 1;

Expand Down Expand Up @@ -638,6 +657,9 @@ typedef union odp_crypto_auth_algos_t {
/** ODP_AUTH_ALG_ZUC_EIA3 */
uint32_t zuc_eia3 : 1;

/** ODP_AUTH_ALG_ZUC_NIA6 */
uint32_t zuc_nia6 : 1;

/** ODP_AUTH_ALG_SNOW_V_GCM */
uint32_t snow_v_gcm : 1;

Expand Down