crypto/aesni_mb: support DES
[dpdk.git] / test / test / test_cryptodev.c
index 745f261..aa0ca51 100644 (file)
@@ -404,7 +404,7 @@ testsuite_setup(void)
                        "session mempool allocation failed");
 
        TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,
-                       &ts_params->conf, ts_params->session_mpool),
+                       &ts_params->conf),
                        "Failed to configure cryptodev %u with %u qps",
                        dev_id, ts_params->conf.nb_queue_pairs);
 
@@ -413,7 +413,8 @@ testsuite_setup(void)
        for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {
                TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
                        dev_id, qp_id, &ts_params->qp_conf,
-                       rte_cryptodev_socket_id(dev_id)),
+                       rte_cryptodev_socket_id(dev_id),
+                       ts_params->session_mpool),
                        "Failed to setup queue pair %u on cryptodev %u",
                        qp_id, dev_id);
        }
@@ -458,7 +459,7 @@ ut_setup(void)
        ts_params->conf.socket_id = SOCKET_ID_ANY;
 
        TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
-                       &ts_params->conf, ts_params->session_mpool),
+                       &ts_params->conf),
                        "Failed to configure cryptodev %u",
                        ts_params->valid_devs[0]);
 
@@ -466,7 +467,8 @@ ut_setup(void)
                TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
                        ts_params->valid_devs[0], qp_id,
                        &ts_params->qp_conf,
-                       rte_cryptodev_socket_id(ts_params->valid_devs[0])),
+                       rte_cryptodev_socket_id(ts_params->valid_devs[0]),
+                       ts_params->session_mpool),
                        "Failed to setup queue pair %u on cryptodev %u",
                        qp_id, ts_params->valid_devs[0]);
        }
@@ -542,23 +544,20 @@ test_device_configure_invalid_dev_id(void)
        /* Stop the device in case it's started so it can be configured */
        rte_cryptodev_stop(ts_params->valid_devs[dev_id]);
 
-       TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, &ts_params->conf,
-                               ts_params->session_mpool),
+       TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, &ts_params->conf),
                        "Failed test for rte_cryptodev_configure: "
                        "invalid dev_num %u", dev_id);
 
        /* invalid dev_id values */
        dev_id = num_devs;
 
-       TEST_ASSERT_FAIL(rte_cryptodev_configure(dev_id, &ts_params->conf,
-                               ts_params->session_mpool),
+       TEST_ASSERT_FAIL(rte_cryptodev_configure(dev_id, &ts_params->conf),
                        "Failed test for rte_cryptodev_configure: "
                        "invalid dev_num %u", dev_id);
 
        dev_id = 0xff;
 
-       TEST_ASSERT_FAIL(rte_cryptodev_configure(dev_id, &ts_params->conf,
-                               ts_params->session_mpool),
+       TEST_ASSERT_FAIL(rte_cryptodev_configure(dev_id, &ts_params->conf),
                        "Failed test for rte_cryptodev_configure:"
                        "invalid dev_num %u", dev_id);
 
@@ -578,7 +577,7 @@ test_device_configure_invalid_queue_pair_ids(void)
        ts_params->conf.nb_queue_pairs = 1;
 
        TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
-                       &ts_params->conf, ts_params->session_mpool),
+                       &ts_params->conf),
                        "Failed to configure cryptodev: dev_id %u, qp_id %u",
                        ts_params->valid_devs[0], ts_params->conf.nb_queue_pairs);
 
@@ -587,7 +586,7 @@ test_device_configure_invalid_queue_pair_ids(void)
        ts_params->conf.nb_queue_pairs = MAX_NUM_QPS_PER_QAT_DEVICE;
 
        TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
-                       &ts_params->conf, ts_params->session_mpool),
+                       &ts_params->conf),
                        "Failed to configure cryptodev: dev_id %u, qp_id %u",
                        ts_params->valid_devs[0],
                        ts_params->conf.nb_queue_pairs);
@@ -597,7 +596,7 @@ test_device_configure_invalid_queue_pair_ids(void)
        ts_params->conf.nb_queue_pairs = 0;
 
        TEST_ASSERT_FAIL(rte_cryptodev_configure(ts_params->valid_devs[0],
-                       &ts_params->conf, ts_params->session_mpool),
+                       &ts_params->conf),
                        "Failed test for rte_cryptodev_configure, dev_id %u,"
                        " invalid qps: %u",
                        ts_params->valid_devs[0],
@@ -608,7 +607,7 @@ test_device_configure_invalid_queue_pair_ids(void)
        ts_params->conf.nb_queue_pairs = UINT16_MAX;
 
        TEST_ASSERT_FAIL(rte_cryptodev_configure(ts_params->valid_devs[0],
-                       &ts_params->conf, ts_params->session_mpool),
+                       &ts_params->conf),
                        "Failed test for rte_cryptodev_configure, dev_id %u,"
                        " invalid qps: %u",
                        ts_params->valid_devs[0],
@@ -619,7 +618,7 @@ test_device_configure_invalid_queue_pair_ids(void)
        ts_params->conf.nb_queue_pairs = MAX_NUM_QPS_PER_QAT_DEVICE + 1;
 
        TEST_ASSERT_FAIL(rte_cryptodev_configure(ts_params->valid_devs[0],
-                       &ts_params->conf, ts_params->session_mpool),
+                       &ts_params->conf),
                        "Failed test for rte_cryptodev_configure, dev_id %u,"
                        " invalid qps: %u",
                        ts_params->valid_devs[0],
@@ -649,7 +648,7 @@ test_queue_pair_descriptor_setup(void)
        rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
        TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
-                       &ts_params->conf, ts_params->session_mpool),
+                       &ts_params->conf),
                        "Failed to configure cryptodev %u",
                        ts_params->valid_devs[0]);
 
@@ -663,7 +662,8 @@ test_queue_pair_descriptor_setup(void)
                TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
                                ts_params->valid_devs[0], qp_id, &qp_conf,
                                rte_cryptodev_socket_id(
-                                               ts_params->valid_devs[0])),
+                                               ts_params->valid_devs[0]),
+                               ts_params->session_mpool),
                                "Failed test for "
                                "rte_cryptodev_queue_pair_setup: num_inflights "
                                "%u on qp %u on cryptodev %u",
@@ -677,7 +677,8 @@ test_queue_pair_descriptor_setup(void)
                TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
                                ts_params->valid_devs[0], qp_id, &qp_conf,
                                rte_cryptodev_socket_id(
-                                               ts_params->valid_devs[0])),
+                                               ts_params->valid_devs[0]),
+                               ts_params->session_mpool),
                                "Failed test for"
                                " rte_cryptodev_queue_pair_setup: num_inflights"
                                " %u on qp %u on cryptodev %u",
@@ -691,7 +692,8 @@ test_queue_pair_descriptor_setup(void)
                TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
                                ts_params->valid_devs[0], qp_id, &qp_conf,
                                rte_cryptodev_socket_id(
-                                               ts_params->valid_devs[0])),
+                                               ts_params->valid_devs[0]),
+                               ts_params->session_mpool),
                                "Failed test for "
                                "rte_cryptodev_queue_pair_setup: num_inflights"
                                " %u on qp %u on cryptodev %u",
@@ -706,7 +708,8 @@ test_queue_pair_descriptor_setup(void)
                TEST_ASSERT_FAIL(rte_cryptodev_queue_pair_setup(
                                ts_params->valid_devs[0], qp_id, &qp_conf,
                                rte_cryptodev_socket_id(
-                                               ts_params->valid_devs[0])),
+                                               ts_params->valid_devs[0]),
+                               ts_params->session_mpool),
                                "Unexpectedly passed test for "
                                "rte_cryptodev_queue_pair_setup:"
                                "num_inflights %u on qp %u on cryptodev %u",
@@ -721,7 +724,8 @@ test_queue_pair_descriptor_setup(void)
                TEST_ASSERT_FAIL(rte_cryptodev_queue_pair_setup(
                                ts_params->valid_devs[0], qp_id, &qp_conf,
                                rte_cryptodev_socket_id(
-                                               ts_params->valid_devs[0])),
+                                               ts_params->valid_devs[0]),
+                               ts_params->session_mpool),
                                "Unexpectedly passed test for "
                                "rte_cryptodev_queue_pair_setup:"
                                "num_inflights %u on qp %u on cryptodev %u",
@@ -735,7 +739,8 @@ test_queue_pair_descriptor_setup(void)
                TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
                                ts_params->valid_devs[0], qp_id, &qp_conf,
                                rte_cryptodev_socket_id(
-                                               ts_params->valid_devs[0])),
+                                               ts_params->valid_devs[0]),
+                               ts_params->session_mpool),
                                "Failed test for"
                                " rte_cryptodev_queue_pair_setup:"
                                "num_inflights %u on qp %u on cryptodev %u",
@@ -750,7 +755,8 @@ test_queue_pair_descriptor_setup(void)
                TEST_ASSERT_FAIL(rte_cryptodev_queue_pair_setup(
                                ts_params->valid_devs[0], qp_id, &qp_conf,
                                rte_cryptodev_socket_id(
-                                               ts_params->valid_devs[0])),
+                                               ts_params->valid_devs[0]),
+                               ts_params->session_mpool),
                                "Unexpectedly passed test for "
                                "rte_cryptodev_queue_pair_setup:"
                                "num_inflights %u on qp %u on cryptodev %u",
@@ -766,7 +772,8 @@ test_queue_pair_descriptor_setup(void)
        TEST_ASSERT_FAIL(rte_cryptodev_queue_pair_setup(
                        ts_params->valid_devs[0],
                        qp_id, &qp_conf,
-                       rte_cryptodev_socket_id(ts_params->valid_devs[0])),
+                       rte_cryptodev_socket_id(ts_params->valid_devs[0]),
+                       ts_params->session_mpool),
                        "Failed test for rte_cryptodev_queue_pair_setup:"
                        "invalid qp %u on cryptodev %u",
                        qp_id, ts_params->valid_devs[0]);
@@ -776,7 +783,8 @@ test_queue_pair_descriptor_setup(void)
        TEST_ASSERT_FAIL(rte_cryptodev_queue_pair_setup(
                        ts_params->valid_devs[0],
                        qp_id, &qp_conf,
-                       rte_cryptodev_socket_id(ts_params->valid_devs[0])),
+                       rte_cryptodev_socket_id(ts_params->valid_devs[0]),
+                       ts_params->session_mpool),
                        "Failed test for rte_cryptodev_queue_pair_setup:"
                        "invalid qp %u on cryptodev %u",
                        qp_id, ts_params->valid_devs[0]);
@@ -1585,6 +1593,24 @@ test_authonly_mb_all(void)
        return TEST_SUCCESS;
 }
 
+static int
+test_authonly_qat_all(void)
+{
+       struct crypto_testsuite_params *ts_params = &testsuite_params;
+       int status;
+
+       status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+               ts_params->op_mpool,
+               ts_params->session_mpool,
+               ts_params->valid_devs[0],
+               rte_cryptodev_driver_id_get(
+               RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)),
+               BLKCIPHER_AUTHONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
 static int
 test_AES_chain_mb_all(void)
 {
@@ -1790,7 +1816,7 @@ test_authonly_dpaa2_sec_all(void)
                ts_params->session_mpool,
                ts_params->valid_devs[0],
                rte_cryptodev_driver_id_get(
-               RTE_STR(RTE_CRYPTODEV_DPAA2_SEC_PMD)),
+               RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD)),
                BLKCIPHER_AUTHONLY_TYPE);
 
        TEST_ASSERT_EQUAL(status, 0, "Test failed");
@@ -2327,9 +2353,9 @@ create_wireless_algo_cipher_hash_operation(const uint8_t *auth_tag,
        rte_memcpy(iv_ptr, auth_iv, auth_iv_len);
 
        sym_op->cipher.data.length = cipher_len;
-       sym_op->cipher.data.offset = cipher_offset + auth_offset;
+       sym_op->cipher.data.offset = cipher_offset;
        sym_op->auth.data.length = auth_len;
-       sym_op->auth.data.offset = auth_offset + cipher_offset;
+       sym_op->auth.data.offset = auth_offset;
 
        return 0;
 }
@@ -2383,10 +2409,10 @@ create_wireless_algo_auth_cipher_operation(unsigned int auth_tag_len,
        rte_memcpy(iv_ptr, auth_iv, auth_iv_len);
 
        sym_op->cipher.data.length = cipher_len;
-       sym_op->cipher.data.offset = auth_offset + cipher_offset;
+       sym_op->cipher.data.offset = cipher_offset;
 
        sym_op->auth.data.length = auth_len;
-       sym_op->auth.data.offset = auth_offset + cipher_offset;
+       sym_op->auth.data.offset = auth_offset;
 
        return 0;
 }
@@ -2525,7 +2551,7 @@ test_kasumi_authentication(const struct kasumi_hash_test_data *tdata)
        /* Create KASUMI session */
        retval = create_wireless_algo_hash_session(ts_params->valid_devs[0],
                        tdata->key.data, tdata->key.len,
-                       tdata->auth_iv.len, tdata->digest.len,
+                       0, tdata->digest.len,
                        RTE_CRYPTO_AUTH_OP_GENERATE,
                        RTE_CRYPTO_AUTH_KASUMI_F9);
        if (retval < 0)
@@ -2547,9 +2573,9 @@ test_kasumi_authentication(const struct kasumi_hash_test_data *tdata)
 
        /* Create KASUMI operation */
        retval = create_wireless_algo_hash_operation(NULL, tdata->digest.len,
-                       tdata->auth_iv.data, tdata->auth_iv.len,
+                       NULL, 0,
                        plaintext_pad_len, RTE_CRYPTO_AUTH_OP_GENERATE,
-                       tdata->validAuthLenInBits.len,
+                       tdata->plaintext.len,
                        0);
        if (retval < 0)
                return retval;
@@ -2585,7 +2611,7 @@ test_kasumi_authentication_verify(const struct kasumi_hash_test_data *tdata)
        /* Create KASUMI session */
        retval = create_wireless_algo_hash_session(ts_params->valid_devs[0],
                                tdata->key.data, tdata->key.len,
-                               tdata->auth_iv.len, tdata->digest.len,
+                               0, tdata->digest.len,
                                RTE_CRYPTO_AUTH_OP_VERIFY,
                                RTE_CRYPTO_AUTH_KASUMI_F9);
        if (retval < 0)
@@ -2607,10 +2633,10 @@ test_kasumi_authentication_verify(const struct kasumi_hash_test_data *tdata)
        /* Create KASUMI operation */
        retval = create_wireless_algo_hash_operation(tdata->digest.data,
                        tdata->digest.len,
-                       tdata->auth_iv.data, tdata->auth_iv.len,
+                       NULL, 0,
                        plaintext_pad_len,
                        RTE_CRYPTO_AUTH_OP_VERIFY,
-                       tdata->validAuthLenInBits.len,
+                       tdata->plaintext.len,
                        0);
        if (retval < 0)
                return retval;
@@ -2808,9 +2834,9 @@ test_kasumi_encryption(const struct kasumi_test_data *tdata)
 
        /* Create KASUMI operation */
        retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data,
-                                       tdata->cipher_iv.len,
-                                       tdata->plaintext.len,
-                                       0);
+                               tdata->cipher_iv.len,
+                               RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8),
+                               tdata->validCipherOffsetInBits.len);
        if (retval < 0)
                return retval;
 
@@ -2822,14 +2848,16 @@ test_kasumi_encryption(const struct kasumi_test_data *tdata)
        if (ut_params->obuf)
                ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
        else
-               ciphertext = plaintext;
+               ciphertext = plaintext + (tdata->validCipherOffsetInBits.len >> 3);
 
        TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, plaintext_len);
 
+       const uint8_t *reference_ciphertext = tdata->ciphertext.data +
+                               (tdata->validCipherOffsetInBits.len >> 3);
        /* Validate obuf */
        TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
                ciphertext,
-               tdata->ciphertext.data,
+               reference_ciphertext,
                tdata->validCipherLenInBits.len,
                "KASUMI Ciphertext data not as expected");
        return 0;
@@ -2881,9 +2909,9 @@ test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata)
 
        /* Create KASUMI operation */
        retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data,
-                                       tdata->cipher_iv.len,
-                                       tdata->plaintext.len,
-                                       0);
+                               tdata->cipher_iv.len,
+                               RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8),
+                               tdata->validCipherOffsetInBits.len);
        if (retval < 0)
                return retval;
 
@@ -2897,19 +2925,22 @@ test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata)
                ciphertext = rte_pktmbuf_read(ut_params->obuf, 0,
                                plaintext_len, buffer);
        else
-               ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0,
+               ciphertext = rte_pktmbuf_read(ut_params->ibuf,
+                               tdata->validCipherOffsetInBits.len >> 3,
                                plaintext_len, buffer);
 
        /* Validate obuf */
        TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, plaintext_len);
 
-               /* Validate obuf */
-               TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
-                       ciphertext,
-                       tdata->ciphertext.data,
-                       tdata->validCipherLenInBits.len,
-                       "KASUMI Ciphertext data not as expected");
-               return 0;
+       const uint8_t *reference_ciphertext = tdata->ciphertext.data +
+                               (tdata->validCipherOffsetInBits.len >> 3);
+       /* Validate obuf */
+       TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+               ciphertext,
+               reference_ciphertext,
+               tdata->validCipherLenInBits.len,
+               "KASUMI Ciphertext data not as expected");
+       return 0;
 }
 
 static int
@@ -2952,9 +2983,9 @@ test_kasumi_encryption_oop(const struct kasumi_test_data *tdata)
 
        /* Create KASUMI operation */
        retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data,
-                                       tdata->cipher_iv.len,
-                                       tdata->plaintext.len,
-                                       0);
+                               tdata->cipher_iv.len,
+                               RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8),
+                               tdata->validCipherOffsetInBits.len);
        if (retval < 0)
                return retval;
 
@@ -2966,14 +2997,16 @@ test_kasumi_encryption_oop(const struct kasumi_test_data *tdata)
        if (ut_params->obuf)
                ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
        else
-               ciphertext = plaintext;
+               ciphertext = plaintext + (tdata->validCipherOffsetInBits.len >> 3);
 
        TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, plaintext_len);
 
+       const uint8_t *reference_ciphertext = tdata->ciphertext.data +
+                               (tdata->validCipherOffsetInBits.len >> 3);
        /* Validate obuf */
        TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
                ciphertext,
-               tdata->ciphertext.data,
+               reference_ciphertext,
                tdata->validCipherLenInBits.len,
                "KASUMI Ciphertext data not as expected");
        return 0;
@@ -3026,9 +3059,9 @@ test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata)
 
        /* Create KASUMI operation */
        retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data,
-                                       tdata->cipher_iv.len,
-                                       tdata->plaintext.len,
-                                       0);
+                               tdata->cipher_iv.len,
+                               RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8),
+                               tdata->validCipherOffsetInBits.len);
        if (retval < 0)
                return retval;
 
@@ -3041,13 +3074,16 @@ test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata)
                ciphertext = rte_pktmbuf_read(ut_params->obuf, 0,
                                plaintext_pad_len, buffer);
        else
-               ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0,
+               ciphertext = rte_pktmbuf_read(ut_params->ibuf,
+                               tdata->validCipherOffsetInBits.len >> 3,
                                plaintext_pad_len, buffer);
 
+       const uint8_t *reference_ciphertext = tdata->ciphertext.data +
+                               (tdata->validCipherOffsetInBits.len >> 3);
        /* Validate obuf */
        TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
                ciphertext,
-               tdata->ciphertext.data,
+               reference_ciphertext,
                tdata->validCipherLenInBits.len,
                "KASUMI Ciphertext data not as expected");
        return 0;
@@ -3094,9 +3130,9 @@ test_kasumi_decryption_oop(const struct kasumi_test_data *tdata)
 
        /* Create KASUMI operation */
        retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data,
-                                       tdata->cipher_iv.len,
-                                       tdata->ciphertext.len,
-                                       0);
+                               tdata->cipher_iv.len,
+                               RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8),
+                               tdata->validCipherOffsetInBits.len);
        if (retval < 0)
                return retval;
 
@@ -3108,14 +3144,16 @@ test_kasumi_decryption_oop(const struct kasumi_test_data *tdata)
        if (ut_params->obuf)
                plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
        else
-               plaintext = ciphertext;
+               plaintext = ciphertext + (tdata->validCipherOffsetInBits.len >> 3);
 
        TEST_HEXDUMP(stdout, "plaintext:", plaintext, ciphertext_len);
 
+       const uint8_t *reference_plaintext = tdata->plaintext.data +
+                               (tdata->validCipherOffsetInBits.len >> 3);
        /* Validate obuf */
        TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
                plaintext,
-               tdata->plaintext.data,
+               reference_plaintext,
                tdata->validCipherLenInBits.len,
                "KASUMI Plaintext data not as expected");
        return 0;
@@ -3161,7 +3199,7 @@ test_kasumi_decryption(const struct kasumi_test_data *tdata)
        retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data,
                                        tdata->cipher_iv.len,
                                        tdata->ciphertext.len,
-                                       0);
+                                       tdata->validCipherOffsetInBits.len);
        if (retval < 0)
                return retval;
 
@@ -3173,14 +3211,16 @@ test_kasumi_decryption(const struct kasumi_test_data *tdata)
        if (ut_params->obuf)
                plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
        else
-               plaintext = ciphertext;
+               plaintext = ciphertext + (tdata->validCipherOffsetInBits.len >> 3);
 
        TEST_HEXDUMP(stdout, "plaintext:", plaintext, ciphertext_len);
 
+       const uint8_t *reference_plaintext = tdata->plaintext.data +
+                               (tdata->validCipherOffsetInBits.len >> 3);
        /* Validate obuf */
        TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
                plaintext,
-               tdata->plaintext.data,
+               reference_plaintext,
                tdata->validCipherLenInBits.len,
                "KASUMI Plaintext data not as expected");
        return 0;
@@ -3921,7 +3961,7 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata)
                        RTE_CRYPTO_AUTH_KASUMI_F9,
                        RTE_CRYPTO_CIPHER_KASUMI_F8,
                        tdata->key.data, tdata->key.len,
-                       tdata->auth_iv.len, tdata->digest.len,
+                       0, tdata->digest.len,
                        tdata->cipher_iv.len);
        if (retval < 0)
                return retval;
@@ -3944,10 +3984,10 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata)
        /* Create KASUMI operation */
        retval = create_wireless_algo_auth_cipher_operation(tdata->digest.len,
                                tdata->cipher_iv.data, tdata->cipher_iv.len,
-                               tdata->auth_iv.data, tdata->auth_iv.len,
+                               NULL, 0,
                                plaintext_pad_len,
                                tdata->validCipherLenInBits.len,
-                               0,
+                               tdata->validCipherOffsetInBits.len,
                                tdata->validAuthLenInBits.len,
                                0
                                );
@@ -3958,19 +3998,23 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata)
        ut_params->op = process_crypto_request(ts_params->valid_devs[0],
                        ut_params->op);
        TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
-       ut_params->obuf = ut_params->op->sym->m_src;
-       if (ut_params->obuf)
-               ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
+       if (ut_params->op->sym->m_dst)
+               ut_params->obuf = ut_params->op->sym->m_dst;
        else
-               ciphertext = plaintext;
+               ut_params->obuf = ut_params->op->sym->m_src;
 
+       ciphertext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *,
+                               tdata->validCipherOffsetInBits.len >> 3);
+
+       const uint8_t *reference_ciphertext = tdata->ciphertext.data +
+                               (tdata->validCipherOffsetInBits.len >> 3);
        /* Validate obuf */
        TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
                        ciphertext,
-                       tdata->ciphertext.data,
+                       reference_ciphertext,
                        tdata->validCipherLenInBits.len,
                        "KASUMI Ciphertext data not as expected");
-       ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)
+       ut_params->digest = rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *)
            + plaintext_pad_len;
 
        /* Validate obuf */
@@ -4002,7 +4046,7 @@ test_kasumi_cipher_auth(const struct kasumi_test_data *tdata)
                        RTE_CRYPTO_AUTH_KASUMI_F9,
                        RTE_CRYPTO_CIPHER_KASUMI_F8,
                        tdata->key.data, tdata->key.len,
-                       tdata->auth_iv.len, tdata->digest.len,
+                       0, tdata->digest.len,
                        tdata->cipher_iv.len);
        if (retval < 0)
                return retval;
@@ -4025,12 +4069,11 @@ test_kasumi_cipher_auth(const struct kasumi_test_data *tdata)
 
        /* Create KASUMI operation */
        retval = create_wireless_algo_cipher_hash_operation(tdata->digest.data,
-                               tdata->digest.len, tdata->auth_iv.data,
-                               tdata->auth_iv.len,
+                               tdata->digest.len, NULL, 0,
                                plaintext_pad_len, RTE_CRYPTO_AUTH_OP_GENERATE,
                                tdata->cipher_iv.data, tdata->cipher_iv.len,
-                               tdata->validCipherLenInBits.len,
-                               0,
+                               RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8),
+                               tdata->validCipherOffsetInBits.len,
                                tdata->validAuthLenInBits.len,
                                0
                                );
@@ -4040,19 +4083,24 @@ test_kasumi_cipher_auth(const struct kasumi_test_data *tdata)
        ut_params->op = process_crypto_request(ts_params->valid_devs[0],
                        ut_params->op);
        TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
-       ut_params->obuf = ut_params->op->sym->m_src;
-       if (ut_params->obuf)
-               ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
+
+       if (ut_params->op->sym->m_dst)
+               ut_params->obuf = ut_params->op->sym->m_dst;
        else
-               ciphertext = plaintext;
+               ut_params->obuf = ut_params->op->sym->m_src;
+
+       ciphertext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *,
+                               tdata->validCipherOffsetInBits.len >> 3);
 
        ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)
                        + plaintext_pad_len;
 
+       const uint8_t *reference_ciphertext = tdata->ciphertext.data +
+                               (tdata->validCipherOffsetInBits.len >> 3);
        /* Validate obuf */
        TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
                ciphertext,
-               tdata->ciphertext.data,
+               reference_ciphertext,
                tdata->validCipherLenInBits.len,
                "KASUMI Ciphertext data not as expected");
 
@@ -4642,6 +4690,44 @@ test_DES_docsis_openssl_all(void)
        return TEST_SUCCESS;
 }
 
+static int
+test_DES_cipheronly_mb_all(void)
+{
+       struct crypto_testsuite_params *ts_params = &testsuite_params;
+       int status;
+
+       status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+               ts_params->op_mpool,
+               ts_params->session_mpool,
+               ts_params->valid_devs[0],
+               rte_cryptodev_driver_id_get(
+               RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)),
+               BLKCIPHER_DES_CIPHERONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
+static int
+test_DES_docsis_mb_all(void)
+{
+       struct crypto_testsuite_params *ts_params = &testsuite_params;
+       int status;
+
+       status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+               ts_params->op_mpool,
+               ts_params->session_mpool,
+               ts_params->valid_devs[0],
+               rte_cryptodev_driver_id_get(
+               RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)),
+               BLKCIPHER_DES_DOCSIS_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
 static int
 test_3DES_chain_dpaa2_sec_all(void)
 {
@@ -4762,7 +4848,7 @@ create_gcm_session(uint8_t dev_id, enum rte_crypto_aead_operation op,
        ut_params->aead_xform.aead.iv.offset = IV_OFFSET;
        ut_params->aead_xform.aead.iv.length = iv_len;
        ut_params->aead_xform.aead.digest_length = auth_len;
-       ut_params->aead_xform.aead.add_auth_data_length = aad_len;
+       ut_params->aead_xform.aead.aad_length = aad_len;
 
        TEST_HEXDUMP(stdout, "key:", key, key_len);
 
@@ -4800,7 +4886,7 @@ create_gcm_xforms(struct rte_crypto_op *op,
        sym_op->xform->aead.iv.offset = IV_OFFSET;
        sym_op->xform->aead.iv.length = iv_len;
        sym_op->xform->aead.digest_length = auth_len;
-       sym_op->xform->aead.add_auth_data_length = aad_len;
+       sym_op->xform->aead.aad_length = aad_len;
 
        TEST_HEXDUMP(stdout, "key:", key, key_len);
 
@@ -6367,7 +6453,7 @@ test_null_invalid_operation(void)
        ret = rte_cryptodev_sym_session_init(ts_params->valid_devs[0],
                        ut_params->sess, &ut_params->cipher_xform,
                        ts_params->session_mpool);
-       TEST_ASSERT(ret == -1,
+       TEST_ASSERT(ret < 0,
                        "Session creation succeeded unexpectedly");
 
 
@@ -6385,7 +6471,7 @@ test_null_invalid_operation(void)
        ret = rte_cryptodev_sym_session_init(ts_params->valid_devs[0],
                        ut_params->sess, &ut_params->auth_xform,
                        ts_params->session_mpool);
-       TEST_ASSERT(ret == -1,
+       TEST_ASSERT(ret < 0,
                        "Session creation succeeded unexpectedly");
 
        return TEST_SUCCESS;
@@ -7986,6 +8072,7 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {
                                                test_AES_docsis_qat_all),
                TEST_CASE_ST(ut_setup, ut_teardown,
                                                test_DES_docsis_qat_all),
+               TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_qat_all),
                TEST_CASE_ST(ut_setup, ut_teardown, test_stats),
 
                /** AES GCM Authenticated Encryption */
@@ -8179,10 +8266,31 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {
                TEST_CASE_ST(ut_setup, ut_teardown,
                        test_null_auth_cipher_operation),
 
+               /** KASUMI tests */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_generate_test_case_1),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_generate_test_case_2),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_generate_test_case_3),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_generate_test_case_4),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_generate_test_case_5),
                TEST_CASE_ST(ut_setup, ut_teardown,
                        test_kasumi_hash_generate_test_case_6),
 
-               /** KASUMI tests */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_verify_test_case_1),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_verify_test_case_2),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_verify_test_case_3),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_verify_test_case_4),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_kasumi_hash_verify_test_case_5),
+
                TEST_CASE_ST(ut_setup, ut_teardown,
                        test_kasumi_encryption_test_case_1),
                TEST_CASE_ST(ut_setup, ut_teardown,
@@ -8219,6 +8327,10 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite  = {
                TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_mb_all),
                TEST_CASE_ST(ut_setup, ut_teardown, test_AES_docsis_mb_all),
                TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_mb_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                                               test_DES_cipheronly_mb_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                                               test_DES_docsis_mb_all),
 
                TEST_CASES_END() /**< NULL terminate unit test array */
        }
@@ -8908,8 +9020,8 @@ test_cryptodev_openssl(void)
                        RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD));
 
        if (gbl_driver_id == -1) {
-               RTE_LOG(ERR, USER1, "AESNI MB PMD must be loaded. Check if "
-                               "CONFIG_RTE_LIBRTE_PMD_AESNI_MB is enabled "
+               RTE_LOG(ERR, USER1, "OPENSSL PMD must be loaded. Check if "
+                               "CONFIG_RTE_LIBRTE_PMD_OPENSSL is enabled "
                                "in config file to run this testsuite.\n");
                return TEST_FAILED;
        }