summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNithinsen Kaithakadan <nkaithakadan@marvell.com>2025-01-06 18:11:22 +0530
committerDamjan Marion <dmarion@0xa5.net>2025-01-21 13:03:27 +0000
commit9b58a8ec0c20e07778857ffc6173e0746dba3cc4 (patch)
tree93242cab04580cfbe656d054fb36d67b02f9d183
parentd3df84523b69241af5d55983065326497e733344 (diff)
crypto: add async algo macros for ctr sha2
Add async crypto algo macros for AES_CTR SHA256/384/512. Add support for these in dev octeon plugin. Type: feature Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com> Change-Id: I22e81c6ac5a549b2f12556b8c79257a20a5bd47d
-rw-r--r--src/plugins/dev_octeon/crypto.c21
-rw-r--r--src/plugins/dev_octeon/crypto.h11
-rw-r--r--src/vnet/crypto/crypto.h11
3 files changed, 41 insertions, 2 deletions
diff --git a/src/plugins/dev_octeon/crypto.c b/src/plugins/dev_octeon/crypto.c
index b6124206f75..800f24a008a 100644
--- a/src/plugins/dev_octeon/crypto.c
+++ b/src/plugins/dev_octeon/crypto.c
@@ -1250,6 +1250,27 @@ oct_crypto_link_session_update (vlib_main_t *vm, oct_crypto_sess_t *sess,
auth_type = ROC_SE_SHA1_TYPE;
digest_len = 12;
break;
+ case VNET_CRYPTO_ALG_AES_128_CTR_SHA256_TAG16:
+ case VNET_CRYPTO_ALG_AES_192_CTR_SHA256_TAG16:
+ case VNET_CRYPTO_ALG_AES_256_CTR_SHA256_TAG16:
+ enc_type = ROC_SE_AES_CTR;
+ auth_type = ROC_SE_SHA2_SHA256;
+ digest_len = 16;
+ break;
+ case VNET_CRYPTO_ALG_AES_128_CTR_SHA384_TAG24:
+ case VNET_CRYPTO_ALG_AES_192_CTR_SHA384_TAG24:
+ case VNET_CRYPTO_ALG_AES_256_CTR_SHA384_TAG24:
+ enc_type = ROC_SE_AES_CTR;
+ auth_type = ROC_SE_SHA2_SHA384;
+ digest_len = 24;
+ break;
+ case VNET_CRYPTO_ALG_AES_128_CTR_SHA512_TAG32:
+ case VNET_CRYPTO_ALG_AES_192_CTR_SHA512_TAG32:
+ case VNET_CRYPTO_ALG_AES_256_CTR_SHA512_TAG32:
+ enc_type = ROC_SE_AES_CTR;
+ auth_type = ROC_SE_SHA2_SHA512;
+ digest_len = 32;
+ break;
case VNET_CRYPTO_ALG_3DES_CBC_MD5_TAG12:
enc_type = ROC_SE_DES3_CBC;
auth_type = ROC_SE_MD5_TYPE;
diff --git a/src/plugins/dev_octeon/crypto.h b/src/plugins/dev_octeon/crypto.h
index b003a605e0c..5bd26f6b9be 100644
--- a/src/plugins/dev_octeon/crypto.h
+++ b/src/plugins/dev_octeon/crypto.h
@@ -49,7 +49,16 @@
_ (3DES_CBC, SHA512, 24, 32) \
_ (AES_128_CTR, SHA1, 16, 12) \
_ (AES_192_CTR, SHA1, 24, 12) \
- _ (AES_256_CTR, SHA1, 32, 12)
+ _ (AES_256_CTR, SHA1, 32, 12) \
+ _ (AES_128_CTR, SHA256, 16, 16) \
+ _ (AES_192_CTR, SHA256, 24, 16) \
+ _ (AES_256_CTR, SHA256, 32, 16) \
+ _ (AES_128_CTR, SHA384, 16, 24) \
+ _ (AES_192_CTR, SHA384, 24, 24) \
+ _ (AES_256_CTR, SHA384, 32, 24) \
+ _ (AES_128_CTR, SHA512, 16, 32) \
+ _ (AES_192_CTR, SHA512, 24, 32) \
+ _ (AES_256_CTR, SHA512, 32, 32)
#define OCT_MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++)
diff --git a/src/vnet/crypto/crypto.h b/src/vnet/crypto/crypto.h
index ae959251603..a4b6ab97620 100644
--- a/src/vnet/crypto/crypto.h
+++ b/src/vnet/crypto/crypto.h
@@ -121,7 +121,16 @@ typedef enum
_ (AES_256_CBC, SHA512, "aes-256-cbc-hmac-sha-512", 32, 32) \
_ (AES_128_CTR, SHA1, "aes-128-ctr-hmac-sha-1", 16, 12) \
_ (AES_192_CTR, SHA1, "aes-192-ctr-hmac-sha-1", 24, 12) \
- _ (AES_256_CTR, SHA1, "aes-256-ctr-hmac-sha-1", 32, 12)
+ _ (AES_256_CTR, SHA1, "aes-256-ctr-hmac-sha-1", 32, 12) \
+ _ (AES_128_CTR, SHA256, "aes-128-ctr-hmac-sha-256", 16, 16) \
+ _ (AES_192_CTR, SHA256, "aes-192-ctr-hmac-sha-256", 24, 16) \
+ _ (AES_256_CTR, SHA256, "aes-256-ctr-hmac-sha-256", 32, 16) \
+ _ (AES_128_CTR, SHA384, "aes-128-ctr-hmac-sha-384", 16, 24) \
+ _ (AES_192_CTR, SHA384, "aes-192-ctr-hmac-sha-384", 24, 24) \
+ _ (AES_256_CTR, SHA384, "aes-256-ctr-hmac-sha-384", 32, 24) \
+ _ (AES_128_CTR, SHA512, "aes-128-ctr-hmac-sha-512", 16, 32) \
+ _ (AES_192_CTR, SHA512, "aes-192-ctr-hmac-sha-512", 24, 32) \
+ _ (AES_256_CTR, SHA512, "aes-256-ctr-hmac-sha-512", 32, 32)
typedef enum
{