app/test: add ARMv8 crypto tests and test vectors
[dpdk.git] / app / test / test_cryptodev_aes_test_vectors.h
index e566548..f0f37ed 100644 (file)
@@ -825,6 +825,98 @@ static const struct blockcipher_test_data aes_test_data_11 = {
        }
 };
 
+/** AES-128-CBC SHA256 HMAC test vector (160 bytes) */
+static const struct blockcipher_test_data aes_test_data_12 = {
+       .crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,
+       .cipher_key = {
+               .data = {
+                       0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,
+                       0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A
+               },
+               .len = 16
+       },
+       .iv = {
+               .data = {
+                       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+                       0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
+               },
+               .len = 16
+       },
+       .plaintext = {
+               .data = plaintext_aes_common,
+               .len = 160
+       },
+       .ciphertext = {
+               .data = ciphertext512_aes128cbc,
+               .len = 160
+       },
+       .auth_algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
+       .auth_key = {
+               .data = {
+                       0x42, 0x1A, 0x7D, 0x3D, 0xF5, 0x82, 0x80, 0xF1,
+                       0xF1, 0x35, 0x5C, 0x3B, 0xDD, 0x9A, 0x65, 0xBA,
+                       0x58, 0x34, 0x85, 0x61, 0x1C, 0x42, 0x10, 0x76,
+                       0x9A, 0x4F, 0x88, 0x1B, 0xB6, 0x8F, 0xD8, 0x60
+               },
+               .len = 32
+       },
+       .digest = {
+               .data = {
+                       0x92, 0xEC, 0x65, 0x9A, 0x52, 0xCC, 0x50, 0xA5,
+                       0xEE, 0x0E, 0xDF, 0x1E, 0xA4, 0xC9, 0xC1, 0x04,
+                       0xD5, 0xDC, 0x78, 0x90, 0xF4, 0xE3, 0x35, 0x62,
+                       0xAD, 0x95, 0x45, 0x28, 0x5C, 0xF8, 0x8C, 0x0B
+               },
+               .len = 32,
+               .truncated_len = 16
+       }
+};
+
+/** AES-128-CBC SHA1 HMAC test vector (160 bytes) */
+static const struct blockcipher_test_data aes_test_data_13 = {
+       .crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,
+       .cipher_key = {
+               .data = {
+                       0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,
+                       0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A
+               },
+               .len = 16
+       },
+       .iv = {
+               .data = {
+                       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+                       0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
+               },
+               .len = 16
+       },
+       .plaintext = {
+               .data = plaintext_aes_common,
+               .len = 160
+       },
+       .ciphertext = {
+               .data = ciphertext512_aes128cbc,
+               .len = 160
+       },
+       .auth_algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
+       .auth_key = {
+               .data = {
+                       0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
+                       0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD,
+                       0xDE, 0xF4, 0xDE, 0xAD
+               },
+               .len = 20
+       },
+       .digest = {
+               .data = {
+                       0x4F, 0x16, 0xEA, 0xF7, 0x4A, 0x88, 0xD3, 0xE0,
+                       0x0E, 0x12, 0x8B, 0xE7, 0x05, 0xD0, 0x86, 0x48,
+                       0x22, 0x43, 0x30, 0xA7
+               },
+               .len = 20,
+               .truncated_len = 12
+       }
+};
+
 static const struct blockcipher_test_case aes_chain_test_cases[] = {
        {
                .test_descr = "AES-128-CTR HMAC-SHA1 Encryption Digest",
@@ -888,10 +980,18 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                .test_descr = "AES-128-CBC HMAC-SHA1 Encryption Digest",
                .test_data = &aes_test_data_4,
                .op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
-               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB |
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
+       {
+               .test_descr = "AES-128-CBC HMAC-SHA1 Encryption Digest "
+                       "(short buffers)",
+               .test_data = &aes_test_data_13,
+               .op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8
+       },
        {
                .test_descr = "AES-128-CBC HMAC-SHA1 Encryption Digest "
                                "Scatter Gather",
@@ -902,34 +1002,57 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
-
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA1 Decryption Digest "
                        "Verify",
                .test_data = &aes_test_data_4,
                .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
-               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB |
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
+       {
+               .test_descr = "AES-128-CBC HMAC-SHA1 Decryption Digest "
+                       "Verify (short buffers)",
+               .test_data = &aes_test_data_13,
+               .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8
+       },
        {
                .test_descr = "AES-128-CBC HMAC-SHA256 Encryption Digest",
                .test_data = &aes_test_data_5,
                .op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
-               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB |
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
+       {
+               .test_descr = "AES-128-CBC HMAC-SHA256 Encryption Digest "
+                       "(short buffers)",
+               .test_data = &aes_test_data_12,
+               .op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8
+       },
        {
                .test_descr = "AES-128-CBC HMAC-SHA256 Decryption Digest "
                        "Verify",
                .test_data = &aes_test_data_5,
                .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
-               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB |
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
+       {
+               .test_descr = "AES-128-CBC HMAC-SHA256 Decryption Digest "
+                       "Verify (short buffers)",
+               .test_data = &aes_test_data_12,
+               .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8
+       },
        {
                .test_descr = "AES-128-CBC HMAC-SHA512 Encryption Digest",
                .test_data = &aes_test_data_6,
@@ -998,7 +1121,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                .test_data = &aes_test_data_4,
                .op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
                .feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP,
-               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
        },
        {
@@ -1007,7 +1131,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                .test_data = &aes_test_data_4,
                .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
                .feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP,
-               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
        },
        {
@@ -1050,7 +1175,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                .test_data = &aes_test_data_4,
                .op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
                .feature_mask = BLOCKCIPHER_TEST_FEATURE_SESSIONLESS,
-               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
        },
        {
                .test_descr =
@@ -1059,7 +1185,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                .test_data = &aes_test_data_4,
                .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
                .feature_mask = BLOCKCIPHER_TEST_FEATURE_SESSIONLESS,
-               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+               .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
        },
 };