aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2024-04-26 16:44:40 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2024-04-30 14:07:01 +0300
commit0606a3c165dc88cc807c9ee5029b7d12219f67c5 (patch)
tree936290e84cd1a643132bb43ab6789b9ed25a304b
parentfbd83dea71fc41e1673527d9325d7475827540fd (diff)
api: crypto: add SM3 hash algorithm and SM3 based HMAC
Add SM3 cryptographic hash function and a HMAC based on it. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Acked-by: Anoob Joseph <anoobj@marvell.com>
-rw-r--r--include/odp/api/spec/crypto_types.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h
index ceef7843e..42b2737c8 100644
--- a/include/odp/api/spec/crypto_types.h
+++ b/include/odp/api/spec/crypto_types.h
@@ -368,6 +368,9 @@ typedef enum {
*/
ODP_AUTH_ALG_SNOW_V_GMAC,
+ /** HMAC using SM3 */
+ ODP_AUTH_ALG_SM3_HMAC,
+
/** MD5 algorithm */
ODP_AUTH_ALG_MD5,
@@ -398,6 +401,9 @@ typedef enum {
/** SHA-3 hash function producing 512-bit digests */
ODP_AUTH_ALG_SHA3_512,
+ /** SM3 hash function */
+ ODP_AUTH_ALG_SM3,
+
} odp_auth_alg_t;
/**
@@ -543,6 +549,9 @@ typedef union odp_crypto_auth_algos_t {
/** ODP_AUTH_ALG_SNOW_V_GMAC */
uint32_t snow_v_gmac : 1;
+ /** ODP_AUTH_ALG_SM3_HMAC */
+ uint32_t sm3_hmac : 1;
+
/** ODP_AUTH_ALG_MD5 */
uint32_t md5 : 1;
@@ -572,6 +581,10 @@ typedef union odp_crypto_auth_algos_t {
/** ODP_AUTH_ALG_SHA3_512 */
uint32_t sha3_512 : 1;
+
+ /** ODP_AUTH_ALG_SM3 */
+ uint32_t sm3 : 1;
+
} bit;
/** All bits of the bit field structure