hash_one_block_t hash_oneblock_fn;
unsigned int key_larger_block_size = 0;
uint8_t hashed_key[HMAC_MAX_BLOCK_SIZE] = { 0 };
+ uint32_t auth_precompute = 1;
if (xform == NULL) {
sess->auth.algo = NULL_HASH;
key_larger_block_size = 1;
}
break;
+ case RTE_CRYPTO_AUTH_SHA1:
+ sess->auth.algo = PLAIN_SHA1;
+ auth_precompute = 0;
+ break;
case RTE_CRYPTO_AUTH_SHA224_HMAC:
sess->auth.algo = SHA_224;
hash_oneblock_fn = mb_mgr->sha224_one_block;
key_larger_block_size = 1;
}
break;
+ case RTE_CRYPTO_AUTH_SHA224:
+ sess->auth.algo = PLAIN_SHA_224;
+ auth_precompute = 0;
+ break;
case RTE_CRYPTO_AUTH_SHA256_HMAC:
sess->auth.algo = SHA_256;
hash_oneblock_fn = mb_mgr->sha256_one_block;
key_larger_block_size = 1;
}
break;
+ case RTE_CRYPTO_AUTH_SHA256:
+ sess->auth.algo = PLAIN_SHA_256;
+ auth_precompute = 0;
+ break;
case RTE_CRYPTO_AUTH_SHA384_HMAC:
sess->auth.algo = SHA_384;
hash_oneblock_fn = mb_mgr->sha384_one_block;
key_larger_block_size = 1;
}
break;
+ case RTE_CRYPTO_AUTH_SHA384:
+ sess->auth.algo = PLAIN_SHA_384;
+ auth_precompute = 0;
+ break;
case RTE_CRYPTO_AUTH_SHA512_HMAC:
sess->auth.algo = SHA_512;
hash_oneblock_fn = mb_mgr->sha512_one_block;
key_larger_block_size = 1;
}
break;
+ case RTE_CRYPTO_AUTH_SHA512:
+ sess->auth.algo = PLAIN_SHA_512;
+ auth_precompute = 0;
+ break;
default:
AESNI_MB_LOG(ERR, "Unsupported authentication algorithm selection");
return -ENOTSUP;
else
sess->auth.gen_digest_len = sess->auth.req_digest_len;
+ /* Plain SHA does not require precompute key */
+ if (auth_precompute == 0)
+ return 0;
+
/* Calculate Authentication precomputes */
if (key_larger_block_size) {
calculate_auth_precomputes(hash_oneblock_fn,
}, }
}, }
},
+ { /* SHA1 */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ {.auth = {
+ .algo = RTE_CRYPTO_AUTH_SHA1,
+ .block_size = 64,
+ .key_size = {
+ .min = 0,
+ .max = 0,
+ .increment = 0
+ },
+ .digest_size = {
+ .min = 1,
+ .max = 20,
+ .increment = 1
+ },
+ .iv_size = { 0 }
+ }, }
+ }, }
+ },
{ /* SHA224 HMAC */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
{.sym = {
}, }
}, }
},
+ { /* SHA224 */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ {.auth = {
+ .algo = RTE_CRYPTO_AUTH_SHA224,
+ .block_size = 64,
+ .key_size = {
+ .min = 0,
+ .max = 0,
+ .increment = 0
+ },
+ .digest_size = {
+ .min = 1,
+ .max = 28,
+ .increment = 1
+ },
+ .iv_size = { 0 }
+ }, }
+ }, }
+ },
{ /* SHA256 HMAC */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
{.sym = {
}, }
}, }
},
+ { /* SHA256 */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ {.auth = {
+ .algo = RTE_CRYPTO_AUTH_SHA256,
+ .block_size = 64,
+ .key_size = {
+ .min = 0,
+ .max = 0,
+ .increment = 0
+ },
+ .digest_size = {
+ .min = 1,
+ .max = 32,
+ .increment = 1
+ },
+ .iv_size = { 0 }
+ }, }
+ }, }
+ },
{ /* SHA384 HMAC */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
{.sym = {
}, }
}, }
},
+ { /* SHA384 */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ {.auth = {
+ .algo = RTE_CRYPTO_AUTH_SHA384,
+ .block_size = 128,
+ .key_size = {
+ .min = 0,
+ .max = 0,
+ .increment = 0
+ },
+ .digest_size = {
+ .min = 1,
+ .max = 48,
+ .increment = 1
+ },
+ .iv_size = { 0 }
+ }, }
+ }, }
+ },
{ /* SHA512 HMAC */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
{.sym = {
}, }
}, }
},
+ { /* SHA512 */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ {.auth = {
+ .algo = RTE_CRYPTO_AUTH_SHA512,
+ .block_size = 128,
+ .key_size = {
+ .min = 0,
+ .max = 0,
+ .increment = 0
+ },
+ .digest_size = {
+ .min = 1,
+ .max = 64,
+ .increment = 1
+ },
+ .iv_size = { 0 }
+ }, }
+ }, }
+ },
{ /* AES XCBC HMAC */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
{.sym = {
0x35, 0x62, 0xFB, 0xFA, 0x93, 0xFD, 0x7D, 0x70,
0xA6, 0x7D, 0x45, 0xCA
},
- .len = 20
+ .len = 20,
+ .truncated_len = 20
}
};
0x39, 0x26, 0xDF, 0xB5, 0x78, 0x62, 0xB2, 0x6E,
0x5E, 0x8F, 0x25, 0x84
},
- .len = 28
+ .len = 28,
+ .truncated_len = 28
}
};
0x1F, 0xC7, 0x84, 0xEE, 0x76, 0xA6, 0x39, 0x15,
0x76, 0x2F, 0x87, 0xF9, 0x01, 0x06, 0xF3, 0xB7
},
- .len = 32
+ .len = 32,
+ .truncated_len = 32
}
};
0xAD, 0x41, 0xAB, 0x15, 0xB0, 0x03, 0x15, 0xEC,
0x9E, 0x3D, 0xED, 0xCB, 0x80, 0x7B, 0xF4, 0xB6
},
- .len = 48
+ .len = 48,
+ .truncated_len = 48
}
};
0x64, 0x4E, 0x15, 0x68, 0x12, 0x67, 0x26, 0x0F,
0x2C, 0x3C, 0x83, 0x25, 0x27, 0x86, 0xF0, 0xDB
},
- .len = 64
+ .len = 64,
+ .truncated_len = 64
}
};
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
+ BLOCKCIPHER_TEST_TARGET_PMD_MB |
+#endif
BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
},
{