From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id D7F271B134 for ; Wed, 13 Feb 2019 07:02:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2019 22:02:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,364,1544515200"; d="scan'208";a="117493344" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga008.jf.intel.com with ESMTP; 12 Feb 2019 22:02:37 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 12 Feb 2019 22:02:26 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 12 Feb 2019 22:02:25 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.207]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.253]) with mapi id 14.03.0415.000; Wed, 13 Feb 2019 14:02:23 +0800 From: "Zhao, XinfengX" To: "dts@dpdk.org" Thread-Topic: [dts][PATCH V1] tests: add the cryptodev l2fwd test Thread-Index: AQHUwzLVmb1x5DxUok67KRdh2YSdCqXdPNAA Date: Wed, 13 Feb 2019 06:02:23 +0000 Message-ID: <44051B25D8C8784BB77FFB604D6A70CA12027B83@shsmsx102.ccr.corp.intel.com> References: <1550017844-2904-1-git-send-email-xinfengx.zhao@intel.com> In-Reply-To: <1550017844-2904-1-git-send-email-xinfengx.zhao@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests: add the cryptodev l2fwd test X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2019 06:02:42 -0000 Tested-by : Xinfeng Zhao -----Original Message----- From: Zhao, XinfengX=20 Sent: Wednesday, February 13, 2019 8:31 AM To: dts@dpdk.org Cc: Zhao, XinfengX Subject: [dts][PATCH V1] tests: add the cryptodev l2fwd test add tests/TestSuite_l2fwd_cryptodev_func.py Signed-off-by: Xinfeng Zhao --- tests/TestSuite_l2fwd_crypto.py | 2020 ----------------------- tests/TestSuite_l2fwd_cryptodev_func.py | 2682 +++++++++++++++++++++++++++= ++++ 2 files changed, 2682 insertions(+), 2020 deletions(-) delete mode 100644 tests/TestSuite_l2fwd_crypto.py create mode 100644 tests/TestSuite_l2fwd_cryptodev_func.py diff --git a/tests/TestSuite_l2fwd_crypto.py b/tests/TestSuite_l2fwd_crypto= .py deleted file mode 100644 index ea35a29..0000000 --- a/tests/TestSuite_l2fwd_crypto.py +++ /dev/null @@ -1,2020 +0,0 @@ -# BSD LICENSE -# -# Copyright(c) 2016-2017 Intel Corporation. All rights reserved. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import hmac -import hashlib -import binascii -import time -import os -import sys -import utils -import commands -from test_case import TestCase -from packet import Packet, save_packets - -from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, mod= es -from cryptography.hazmat.backends import default_backend - -# Manually Install the CryptoMobile Python Library, -# Before running this test suite -# Web link : https://github.com/mitshell/CryptoMobile -import CryptoMobile.CM as cm - - -class TestL2fwdCrypto(TestCase): - - def set_up_all(self): - - self.core_config =3D "1S/2C/1T" - self.number_of_ports =3D 1 - self.dut_ports =3D self.dut.get_ports(self.nic) - self.verify(len(self.dut_ports) >=3D self.number_of_ports, - "Not enough ports for " + self.nic) - self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) - - self.logger.info("core config =3D " + self.core_config) - self.logger.info("number of ports =3D " + str(self.number_of_ports= )) - self.logger.info("dut ports =3D " + str(self.dut_ports)) - self.logger.info("ports_socket =3D " + str(self.ports_socket)) - - self.core_mask =3D utils.create_mask(self.dut.get_core_list( - self.core_config, - socket=3Dself.ports_socket)) - self.port_mask =3D utils.create_mask([self.dut_ports[0]]) - - self.tx_port =3D self.tester.get_local_port(self.dut_ports[0]) - self.rx_port =3D self.tester.get_local_port(self.dut_ports[0]) - - self.tx_interface =3D self.tester.get_interface(self.tx_port) - self.rx_interface =3D self.tester.get_interface(self.rx_port) - - self.logger.info("core mask =3D " + self.core_mask) - self.logger.info("port mask =3D " + self.port_mask) - self.logger.info("tx interface =3D " + self.tx_interface) - self.logger.info("rx interface =3D " + self.rx_interface) - - # Rebuild the dpdk with cryptodev pmds - self.dut.send_expect("export AESNI_MULTI_BUFFER_LIB_PATH=3D/root/i= psec_043/code/", "#") - self.dut.send_expect("export LIBSSO_SNOW3G_PATH=3D/root/libsso_sno= w3g/snow3g/", "#") - self.dut.send_expect("export LIBSSO_ZUC_PATH=3D/root/libsso_zuc.1.= 0.1.1-8/zuc", "#") - self.dut.send_expect("export LIBSSO_KASUMI_PATH=3D/root/LibSSO_0_3= _1/isg_cid-wireless_libs/ciphers/kasumi/", "#") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_QAT=3Dn$/CON= FIG_RTE_LIBRTE_PMD_QAT=3Dy/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=3D= n$/CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=3Dy/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO= =3Dn$/CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=3Dy/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dn$/= CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dy/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dn$/= CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dy/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dn$= /CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dy/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=3Dn= $/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=3Dy/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dn$/CON= FIG_RTE_LIBRTE_PMD_ZUC=3Dy/' config/common_base", "# ") - self.dut.skip_setup =3D False - self.dut.build_install_dpdk(self.dut.target) - - # l2fwd-crypto compile - out =3D self.dut.build_dpdk_apps("./examples/l2fwd-crypto") - self.verify("Error" not in out, "Compilation error") - self.verify("No such" not in out, "Compilation error") - - # Bind QAT VF devices - out =3D self.dut.send_expect("lspci -d:443|awk '{print $1}'", "# "= , 10) - self.dut.send_expect('echo "8086 0443" > /sys/bus/pci/drivers/igb_= uio/new_id', "# ", 10) - for line in out.replace("\r", "\n").replace("\n\n", "\n").split("\= n"): - cmd =3D "echo 0000:{} > /sys/bus/pci/devices/0000\:{}/driver/u= nbind".format(line, line.replace(":", "\:")) - self.dut.send_expect(cmd, "# ", 10) - cmd =3D "echo 0000:{} > /sys/bus/pci/drivers/igb_uio/bind".for= mat(line) - self.dut.send_expect(cmd, "# ", 10) - - def set_up(self): - pass - - def test_qat_AES_CBC_auto(self): - result =3D True - self.logger.info("Test qat_c_AES_CBC_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_c_AES_CBC_00"): - result =3D False - - def test_qat_AES_CTR_auto(self): - result =3D True - self.logger.info("Test qat_c_AES_CTR_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_c_AES_CTR_00"): - result =3D False - - def test_qat_AES_GCM_auto(self): - result =3D True - self.logger.info("Test qat_c_AES_GCM_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_c_AES_GCM_00"): - result =3D False - - def test_qat_h_MD_SHA_auto(self): - result =3D True - self.logger.info("Test qat_h_MD_SHA_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_h_MD_SHA_00"): - result =3D False - - def test_qat_h_AES_XCBC_MAC_auto(self): - result =3D True - self.logger.info("Test qat_h_AES_XCBC_MAC_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_h_AES_XCBC_MAC_01"): - result =3D False - - def test_qat_3DES_CBC_auto(self): - result =3D True - self.logger.info("Test qat_c_3DES_CBC_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_c_3DES_CBC_00"): - result =3D False - - def test_qat_3DES_CTR_auto(self): - result =3D True - self.logger.info("Test qat_c_3DES_CTR_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_c_3DES_CTR_00"): - result =3D False - - def test_qat_AES_GCM_AES_GCM(self): - - result =3D True - - self.logger.info("Test qat_ch_AES_GCM_AES_GCM_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_ch_AES_GCM_AES_GCM_01"): - result =3D False - - def test_qat_AES_DOCSISBPI_auto(self): - result =3D True - self.logger.info("Test qat_ch_AES_DOCSISBPI") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_ch_AES_DOCSISBPI"): - result =3D False - - def test_qat_c_DES_DOCSISBPI_auto(self): - result =3D True - self.logger.info("Test qat_c_DES_DOCSISBPI") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_c_DES_DOCSISBPI"): - result =3D False - - def test_qat_SNOW3G_auto(self): - - result =3D True - - self.logger.info("Test qat_c_UEA2_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_c_UEA2_01"): - result =3D False - - self.logger.info("Test qat_h_UIA2_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_h_UIA2_01"): - result =3D False - - self.verify(result, True) - - def test_qat_KASUMI_auto(self): - - result =3D True - self.logger.info("Test qat_kasumi_c_F8_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_kasumi_c_F8_01"): - result =3D False - - self.logger.info("Test qat_kasumi_h_F9_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_kasumi_h_F9_01"): - result =3D False - - self.verify(result, True) - - def test_qat_ZUC_auto(self): - - result =3D True - self.logger.info("Test qat_c_EEA3_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_c_EEA3_01"): - result =3D False - - self.logger.info("Test qat_h_EIA3_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_h_EIA3_01"): - result =3D False - - def test_qat_c_NULL_auto(self): - - result =3D True - - self.logger.info("Test qat_c_NULL_auto") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "null_c_NULL_auto"): - result =3D False - - self.verify(result, True) - - def test_qat_h_NULL_auto(self): - - result =3D True - - self.logger.info("Test qat_h_NULL_auto") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "qat_h_NULL_auto"): - result =3D False - - self.verify(result, True) - - def test_aesni_mb_AES_CBC_auto(self): - result =3D True - self.logger.info("Test aesni_mb_c_AES_CBC_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "aesni_mb_c_AES_CBC_00"): - result =3D False - - def test_aesni_mb_AES_CTR_auto(self): - result =3D True - self.logger.info("Test aesni_mb_c_AES_CTR_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "aesni_mb_c_AES_CTR_00"): - result =3D False - - def test_aesni_mb_AES_DOCSISBPI_auto(self): - result =3D True - self.logger.info("Test aesni_mb_c_AES_DOCSISBPI") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "aesni_mb_c_AES_DOCSISBPI"): - result =3D False - - def test_aesni_AES_GCM_AES_GCM(self): - - result =3D True - - self.logger.info("Test aesni_gcm_ch_AES_GCM_AES_GCM_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "aesni_gcm_ch_AES_GCM_AES_GCM_01"): - result =3D False - - self.verify(result, True) - - def test_kasumi_KASUMI_auto(self): - - result =3D True - self.logger.info("Test kasumi_c_F8_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "kasumi_c_F8_01"): - result =3D False - - self.logger.info("Test kasumi_h_F9_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "kasumi_h_F9_01"): - result =3D False - - self.verify(result, True) - - def test_null_NULL_CIPHER(self): - - result =3D True - self.logger.info("Test null_c_NULL_auto") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "null_c_NULL_auto"): - result =3D False - - self.verify(result, True) - - def test_null_NULL_HASH(self): - - result =3D True - - self.logger.info("Test null_h_NULL_auto") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "null_h_NULL_auto"): - result =3D False - - self.verify(result, True) - - def test_null_c_NULL_auto(self): - - result =3D True - - self.logger.info("Test null_c_NULL_auto") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "null_c_NULL_auto"): - result =3D False - - self.verify(result, True) - - def test_null_h_NULL_auto(self): - - result =3D True - - self.logger.info("Test null_h_NULL_auto") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "null_h_NULL_auto"): - result =3D False - - self.verify(result, True) - - def test_snow3g_SNOW3G(self): - - result =3D True - - self.logger.info("Test snow3g_c_UEA2_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "snow3g_c_UEA2_01"): - result =3D False - - self.logger.info("Test snow3g_h_UIA2_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "snow3g_h_UIA2_01"): - result =3D False - - self.verify(result, True) - - def test_zun_ZUC_auto(self): - - result =3D True - self.logger.info("Test zuc_c_EEA3_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "zuc_c_EEA3_01"): - result =3D False - - self.logger.info("Test zuc_h_EIA3_01") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "zuc_h_EIA3_01"): - result =3D False - - # openssl pmd cases - def test_openssl_3DES_CBC_auto(self): - result =3D True - self.logger.info("Test openssl_c_3DES_CBC_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "openssl_c_3DES_CBC_00"): - result =3D False - - def test_openssl_3DES_CTR_auto(self): - result =3D True - self.logger.info("Test openssl_c_3DES_CTR_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "openssl_c_3DES_CTR_00"): - result =3D False - - def test_openssl_AES_CBC_auto(self): - result =3D True - self.logger.info("Test openssl_c_AES_CBC_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "openssl_c_AES_CBC_00"): - result =3D False - - def test_openssl_AES_CTR_auto(self): - result =3D True - self.logger.info("Test openssl_c_AES_CTR_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "openssl_c_AES_CTR_00"): - result =3D False - - def test_openssl_AES_GCM_auto(self): - result =3D True - self.logger.info("Test openssl_c_AES_GCM_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "openssl_c_AES_GCM_00"): - result =3D False - - def test_openssl_h_MD_SHA_auto(self): - result =3D True - self.logger.info("Test openssl_h_MD_SHA_00") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "openssl_h_MD_SHA_00"): - result =3D False - - def test_openssl_c_DES_DOCSISBPI_auto(self): - result =3D True - self.logger.info("Test openssl_c_DES_DOCSISBPI") - if not self.__execute_l2fwd_crypto_test( - test_vectors, "openssl_c_DES_DOCSISBPI"): - result =3D False - - def __calculate_totall_cases_numb(self): - alg_map =3D {} - pmd_map =3D {} - map_combine =3D {} - count =3D 0 - alg =3D "" - pmd =3D "" - alg_list =3D ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_CBC", - "3DES_CTR", "SNOW3G", "KASUMI", "ZUC", "NULL", "MD_SHA= "] - pmd_list =3D ["qat", "aesni_mb", "aesni_gcm", "snow3g", - "kasumi", "zuc", "openssl", "null"] - valid_map =3D { - "qat": ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_CBC", - "3DES_CTR", "SNOW3G", "KASUMI", "NULL", "MD_SH= A"], - "aesni_mb": ["AES_CBC", "AES_CTR"], - "aesni_gcm": ["AES_GCM"], - "snow3g": ["SNOW3G"], - "kasumi": ["KASUMI"], - "zuc": ["ZUC"], - "openssl": ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_CBC= ", - "3DES_CTR", "MD_SHA"], - "null": ["NULL"] - } - - for index, value in test_vectors.iteritems(): - test_vector_list =3D self.__test_vector_to_vector_list(value, - core_mask=3D"-1", port_mask=3Dself.port_mask) - count =3D count + len(test_vector_list) - for i in alg_list: - if (index.upper()).find(i) !=3D -1: - alg =3D i - if i in alg_map: - alg_map[i] +=3D len(test_vector_list) - else: - alg_map[i] =3D len(test_vector_list) - for j in pmd_list: - if (index).find(j) !=3D -1: - pmd =3D j if j !=3D "" else "qat" - if i in pmd_map: - pmd_map[j] +=3D len(test_vector_list) - else: - pmd_map[j] =3D len(test_vector_list) - if alg in valid_map[pmd]: - temp_str =3D pmd + "_" + alg - if temp_str in map_combine: - map_combine[temp_str] +=3D len(test_vector_list) - else: - map_combine[temp_str] =3D len(test_vector_list) - for k, v in alg_map.iteritems(): - self.logger.info("Total {name} cases:\t\t\t{number}".format(na= me=3Dk, number=3Dv)) - for k, v in pmd_map.iteritems(): - self.logger.info("Total {name} cases:\t\t\t{number}".format(na= me=3Dk, number=3Dv)) - for k, v in map_combine.iteritems(): - self.logger.info("Total {name} cases:\t\t\t{number}".format(na= me=3Dk, number=3Dv)) - self.logger.info("Total cases:\t\t\t {0}".format(count)) - - def __execute_l2fwd_crypto_test(self, test_vectors, test_vector_name): - - if test_vector_name not in test_vectors: - self.logger.warn("SKIP : " + test_vector_name) - return True - - test_vector =3D test_vectors[test_vector_name] - - test_vector_list =3D self.__test_vector_to_vector_list(test_vector= , - core_mask=3Dself.core_mask, - port_mask=3Dself.port_mask) - - result =3D True - self.logger.info("Total Generated {0} Tests".format(len(test_vecto= r_list))) - for test_vector in test_vector_list: - self.logger.debug(test_vector) - cmd_str =3D self.__test_vector_to_cmd(test_vector, - core_mask=3Dself.core_mask= , - port_mask=3Dself.port_mask= ) - self.dut.send_expect(cmd_str, "=3D=3D", 30) - time.sleep(5) - - payload =3D self.__format_hex_to_list(test_vector["input"]) - - inst =3D self.tester.tcpdump_sniff_packets(self.rx_interface, = timeout=3D5) - - PACKET_COUNT =3D 65 - pkt =3D Packet() - pkt.assign_layers(["ether", "ipv4", "raw"]) - pkt.config_layer("ether", {"src": "52:00:00:00:00:00"}) - pkt.config_layer("ipv4", {"src": "192.168.1.1", "dst": "192.16= 8.1.2"}) - pkt.config_layer("raw", {"payload": payload}) - pkt.send_pkt(tx_port=3Dself.tx_interface, count=3DPACKET_COUNT= ) - pkt.pktgen.pkt.show() - - pkt_rec =3D self.tester.load_tcpdump_sniff_packets(inst) - - for pkt_r in pkt_rec: - packet_hex =3D pkt_r.strip_element_layer4("load") - cipher_text =3D binascii.b2a_hex(packet_hex) - if str.lower(cipher_text) =3D=3D str.lower(test_vector["ou= tput_cipher"]): - self.logger.info(cipher_text) - self.logger.info("Cipher Matched.") - else: - if test_vector["output_cipher"] !=3D "": - result =3D False - self.logger.info("Cipher NOT Matched.") - self.logger.info("Cipher text in packet =3D " + ci= pher_text) - self.logger.info("Ref Cipher text =3D " + te= st_vector["output_cipher"]) - else: - self.logger.info("Skip Cipher, Since no cipher tex= t set") - - hash_length =3D len(test_vector["output_hash"])/2 - if hash_length !=3D 0: - hash_text =3D binascii.b2a_hex(pkt_r.pktgen.pkt["Paddi= ng"].getfieldval("load")) - if str.lower(hash_text) =3D=3D str.lower(test_vector["= output_hash"]): - self.logger.info("Hash Matched") - else: - result =3D False - self.logger.info("Hash NOT Matched") - self.logger.info("Hash text in packet =3D " + hash= _text) - self.logger.info("Ref Hash text =3D " + test= _vector["output_hash"]) - else: - self.logger.info("Skip Hash, Since no hash text set") - - self.logger.info("Packet Size : %d " % (len(test_vector["in= put"]) / 2)) - - # Close l2fwd-crypto process - self.dut.send_excpet("^C", "#", 30) - - if result: - self.logger.info("PASSED") - else: - self.logger.info("FAILED") - - return result - - def tear_down(self): - self.dut.kill_all() - - def tear_down_all(self): - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_QAT=3Dy$/CON= FIG_RTE_LIBRTE_PMD_QAT=3Dn/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=3D= y$/CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=3Dn/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO= =3Dy$/CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=3Dn/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dy$/= CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dn/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dy$/= CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dn/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dy$= /CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dn/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=3Dy= $/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=3Dn/' config/common_base", "# ") - self.dut.send_expect("sed -i 's/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dy$/CON= FIG_RTE_LIBRTE_PMD_ZUC=3Dn/' config/common_base", "# ") - - def __test_vector_to_cmd(self, test_vector, core_mask=3D"", port_mask= =3D""): - L2FWD_CRYPTO_APP =3D "./examples/l2fwd-crypto/build/app/l2fwd-cryp= to" - EAL_CORE_MASK =3D " -cf" if core_mask =3D=3D "" else " -c" + core_= mask - EAL_MM_CHANNEL =3D " -n4" - EAL_SOCKET_MEM =3D " --socket-mem=3D512,512 " - EAL_SEP =3D " --" - PORT_MASK =3D "" if port_mask =3D=3D "" else " -p" + port_mask - QUEUE_NUM =3D "" - - vdev =3D "" - if self.__check_field_in_vector(test_vector, "vdev"): - vdev =3D " --vdev " + test_vector["vdev"] - - chain =3D "" - if self.__check_field_in_vector(test_vector, "chain"): - chain =3D " --chain " + test_vector["chain"] - - cdev_type =3D "" - if self.__check_field_in_vector(test_vector, "cdev_type"): - cdev_type =3D " --cdev_type " + test_vector["cdev_type"] - - cipher_algo =3D "" - if self.__check_field_in_vector(test_vector, "cipher_algo"): - cipher_algo =3D " --cipher_algo " + test_vector["cipher_algo"] - - cipher_op =3D "" - if self.__check_field_in_vector(test_vector, "cipher_op"): - cipher_op =3D " --cipher_op " + test_vector["cipher_op"] - - cipher_key =3D "" - if self.__check_field_in_vector(test_vector, "cipher_key"): - cipher_key =3D " --cipher_key " + self.__format_hex_to_param(t= est_vector["cipher_key"]) - - iv =3D "" - if self.__check_field_in_vector(test_vector, "iv"): - iv =3D " --iv " + self.__format_hex_to_param(test_vector["iv"]= ) - - auth_algo =3D "" - if self.__check_field_in_vector(test_vector, "auth_algo"): - auth_algo =3D " --auth_algo " + test_vector["auth_algo"] - - auth_op =3D "" - if self.__check_field_in_vector(test_vector, "auth_op"): - auth_op =3D " --auth_op " + test_vector["auth_op"] - - auth_key =3D "" - if self.__check_field_in_vector(test_vector, "auth_key"): - auth_key =3D " --auth_key " + self.__format_hex_to_param(test_= vector["auth_key"]) - - auth_key_random_size =3D "" - if self.__check_field_in_vector(test_vector, "auth_key_random_size= "): - auth_key_random_size =3D " --auth_key_random_size " + test_vec= tor["auth_key_random_size"] - - aad =3D "" - if self.__check_field_in_vector(test_vector, "aad"): - aad =3D " --aad " + self.__format_hex_to_param(test_vector["aa= d"]) - - aad_random_size =3D "" - if self.__check_field_in_vector(test_vector, "aad_random_size"): - aad_random_size =3D " --aad_random_size " + test_vector["aad_r= andom_size"] - - cmd_str =3D "".join([L2FWD_CRYPTO_APP, EAL_CORE_MASK, EAL_MM_CHANN= EL, - EAL_SOCKET_MEM, vdev, vdev, EAL_SEP, PORT_MASK= , - QUEUE_NUM, chain, cdev_type, cipher_algo, - cipher_op, cipher_key, iv, auth_algo, auth_op, - auth_key, auth_key_random_size, aad, - aad_random_size]) - - return cmd_str - - def __check_field_in_vector(self, test_vector, field_name): - if field_name in test_vector and test_vector[field_name]: - return True - return False - - def __format_hex_to_param(self, hex_str, sep=3D":", prefix=3D""): - if not hex_str: - return "" - if len(hex_str) =3D=3D 1: - return prefix + "0" + hex_str - - result =3D prefix + hex_str[0:2] - for i in range(2, len(hex_str), 2): - if len(hex_str) < i + 2: - result =3D result + sep + "0" + hex_str[i:] - else: - result =3D result + sep + hex_str[i:i+2] - - return result - - def __format_hex_to_list(self, hex_str): - if not hex_str: - return [] - if len(hex_str) =3D=3D 1: - return [hex_str] - - result =3D [] - result.append(hex_str[0:2]) - for i in range(2, len(hex_str), 2): - if len(hex_str) < i + 2: - result.append(hex_str[i:]) - else: - result.append(hex_str[i:i+2]) - return result - - def __gen_input(self, length, pattern=3DNone): - pattern =3D "11" - input_str =3D "" - for i in range(length): - input_str +=3D pattern - return input_str - - def __gen_key(self, length, pattern=3DNone, mask=3D"000000"): - base_key =3D "000102030405060708090a0b0c0d0e0f" - key =3D "" - n =3D length // 16 - for i in range(n): - key =3D key + base_key - base_key =3D base_key[2:] + base_key[0:2] - m =3D length % 16 - key =3D key + base_key[0:2*m] - return key - - def __cryptography_cipher(self, vector): - key =3D binascii.a2b_hex(vector["cipher_key"]) - iv =3D binascii.a2b_hex(vector["iv"]) - cipher_algo_str =3D vector["cipher_algo"] - if vector["cipher_algo"] =3D=3D "aes-cbc": - cipher_algo =3D algorithms.AES(key) - cipher_mode =3D modes.CBC(iv) - elif vector["cipher_algo"] =3D=3D "aes-ctr": - cipher_algo =3D algorithms.AES(key) - cipher_mode =3D modes.CTR(iv) - elif vector["cipher_algo"] =3D=3D "3des-cbc": - cipher_algo =3D algorithms.TripleDES(key) - cipher_mode =3D modes.CBC(iv) - elif vector["cipher_algo"] =3D=3D "aes-gcm": - cipher_algo =3D algorithms.AES(key) - cipher_mode =3D modes.GCM(iv) - else: - cipher_algo =3D algorithms.AES(key) - cipher_mode =3D modes.CBC(iv) - - cipher =3D Cipher(cipher_algo, cipher_mode, backend=3Ddefault_back= end()) - encryptor =3D cipher.encryptor() - cipher_str =3D encryptor.update(binascii.a2b_hex(vector["input"]))= + encryptor.finalize() - - return binascii.b2a_hex(cipher_str) - - def __CryptoMoble_cipher(self, vector): - cipher_str =3D "" - out_str =3D "" - cipher_algo =3D vector['cipher_algo'] - - mBitlen =3D 8 * (len(vector['input']) / 2) - bin_input =3D bytearray.fromhex(vector["input"]) - str_input =3D str(bin_input) - bin_key =3D binascii.a2b_hex(vector["cipher_key"]) - if ((cipher_algo.upper()).find("KASUMI") !=3D -1): - vector["iv"] =3D vector["iv"][:10] + "000000" - out_str =3D cm.UEA1(key=3Dbin_key, count=3D66051, bearer=3D0, - dir=3D1, data=3Dstr_input, bitlen=3DmBitlen) - - elif ((cipher_algo.upper()).find("SNOW3G") !=3D -1): - vector["iv"] =3D "00000000000000000000000000000000" - out_str =3D cm.UEA2(key=3Dbin_key, count=3D0, bearer=3D0, dir= =3D0, - data=3Dstr_input, bitlen=3DmBitlen) - elif ((cipher_algo.upper()).find("ZUC") !=3D -1): - vector["iv"] =3D "00010203040000000001020304000000" - out_str =3D cm.EEA3(key=3Dbin_key, count=3D0x10203, bearer=3D0= , dir=3D1, - data=3Dstr_input, bitlen=3DmBitlen) - - cipher_str =3D out_str.encode("hex").upper() - - return cipher_str - - def __gen_null_cipher_out(self, vector): - cipher_str =3D "" - if (vector['chain'] =3D=3D "CIPHER_ONLY") or (vector['chain'] =3D= =3D "CIPHER_HASH"): - cipher_str =3D vector['input'] - elif (vector['chain'] =3D=3D "HASH_CIPHER"): - cipher_str =3D vector['output_hash'] - return cipher_str - - def __gen_cipher_output(self, vector): - if vector["chain"] =3D=3D "HASH_ONLY": - vector["output_cipher"] =3D=3D "" - return - - if vector["output_cipher"] !=3D "*": - return - - cipher_str =3D "" - - if(((vector['cipher_algo']).upper()).find("KASUMI") !=3D -1) or \ - (((vector['cipher_algo']).upper()).find("SNOW3G") !=3D -1)= or \ - (((vector['cipher_algo']).upper()).find("ZUC") !=3D -1): - cipher_str =3D self.__CryptoMoble_cipher(vector) - elif (vector['cipher_algo'] =3D=3D "NULL"): - cipher_str =3D self.__gen_null_cipher_out(vector) - else: - cipher_str =3D self.__cryptography_cipher(vector) - vector["output_cipher"] =3D cipher_str.upper() - - def __gen_kasumi_hash(self, vector): - auth_str =3D "" - auth_algo =3D vector['auth_algo'] - mBitlen =3D 8 * (len(vector['input']) / 2) - bin_input =3D bytearray.fromhex(vector["input"]) - str_input =3D str(bin_input) - bin_key =3D binascii.a2b_hex(vector["auth_key"]) - - hash_out =3D cm.UIA1(key=3Dbin_key, count=3D0X10203, fresh=3D0X405= 0607, dir=3D0, - data=3Dstr_input) - auth_str =3D hash_out.encode("hex").upper() - - return auth_str - - def __gen_snow3g_hash(self, vector): - auth_str =3D "" - auth_algo =3D vector['auth_algo'] - mBitlen =3D 8 * (len(vector['input']) / 2) - bin_input =3D bytearray.fromhex(vector["input"]) - str_input =3D str(bin_input) - bin_key =3D binascii.a2b_hex(vector["auth_key"]) - vector["aad"] =3D "00000000000000000000000000000000" - - hash_out =3D cm.UIA2(key=3Dbin_key, count=3D0, fresh=3D0, dir=3D0, - data=3Dstr_input) - - auth_str =3D hash_out.encode("hex").upper() - - return auth_str - - def __gen_zuc_hash(self, vector): - auth_str =3D "" - auth_algo =3D vector['auth_algo'] - mBitlen =3D 8 * (len(vector['input']) / 2) - bin_input =3D bytearray.fromhex(vector["input"]) - str_input =3D str(bin_input) - bin_key =3D binascii.a2b_hex(vector["auth_key"]) - - vector["aad"] =3D "00000000000000000000000000000000" - hash_out =3D cm.EIA3(key=3Dbin_key, count=3D0, bearer=3D0, dir=3D0= , data=3Dstr_input, bitlen=3DmBitlen) - auth_str =3D hash_out.encode("hex").upper() - - return auth_str - - def __gen_null_hash(self, vector): - auth_str =3D "" - if (vector['chain'] =3D=3D "HASH_ONLY") or (vector['chain'] =3D=3D= "HASH_CIPHER"): - auth_str =3D vector['input'] - elif (vector['chain'] =3D=3D "CIPHER_HASH"): - auth_str =3D vector['output_cipher'] - return auth_str - - def __gen_hash_output(self, vector): - if vector["chain"] =3D=3D "CIPHER_ONLY": - vector["output_hash"] =3D=3D "" - return - - if vector["output_hash"] !=3D "*": - return - - if vector["chain"] =3D=3D "HASH_ONLY": - vector["output_cipher"] =3D "" - - hash_str =3D "" - - if vector["chain"] =3D=3D "CIPHER_HASH": - input_str =3D vector["output_cipher"] - else: - input_str =3D vector["input"] - - auth_algo =3D vector["auth_algo"] - if auth_algo =3D=3D "MD5_HMAC": - hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), - binascii.a2b_hex(input_str), hashlib.md5).hexdigest() - elif auth_algo =3D=3D "SHA1_HMAC": - hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), - binascii.a2b_hex(input_str), hashlib.sha1).hexdigest() - elif auth_algo =3D=3D "SH224_HMAC": - hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), - binascii.a2b_hex(input_str), hashlib.sha224).hexdigest= () - elif auth_algo =3D=3D "SH256_HMAC": - hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), - binascii.a2b_hex(input_str), hashlib.sha256).hexdigest= () - elif auth_algo =3D=3D "SHA384_HMAC": - hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), - binascii.a2b_hex(input_str), hashlib.sha384).hexdigest= () - elif auth_algo =3D=3D "SHA512_HMAC": - hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), - binascii.a2b_hex(input_str), hashlib.sha512).hexdigest= () - elif auth_algo =3D=3D "AES_XCBC_MAC": - pass - elif auth_algo =3D=3D "AES_GCM": - pass - elif auth_algo =3D=3D "AES_GMAC": - pass - elif auth_algo =3D=3D "SNOW3G_UIA2": - hash_str =3D self.__gen_snow3g_hash(vector) - elif auth_algo =3D=3D "ZUC_EIA3": - hash_str =3D self.__gen_zuc_hash(vector) - elif auth_algo =3D=3D "KASUMI_F9": - hash_str =3D self.__gen_kasumi_hash(vector) - elif auth_algo =3D=3D "NULL": - hash_str =3D self.__gen_null_hash(vector) - elif auth_algo =3D=3D "MD5": - hash_str =3D hashlib.md5(binascii.a2b_hex(vector["auth_key"])= ).hexdigest() - elif auth_algo =3D=3D "SHA1": - hash_str =3D hashlib.sha1(binascii.a2b_hex(vector["auth_key"])= ).hexdigest() - elif auth_algo =3D=3D "SHA224": - hash_str =3D hashlib.sha224(binascii.a2b_hex(vector["auth_key"= ])).hexdigest() - elif auth_algo =3D=3D "SHA256": - hash_str =3D hashlib.sha256(binascii.a2b_hex(vector["auth_key"= ])).hexdigest() - elif auth_algo =3D=3D "SHA384": - hash_str =3D hashlib.sha384(binascii.a2b_hex(vector["auth_key"= ])).hexdigest() - elif auth_algo =3D=3D "SHA512": - hash_str =3D hashlib.sha512(binascii.a2b_hex(vector["auth_key"= ])).hexdigest() - else: - pass - vector["output_hash"] =3D hash_str.upper() - self.__actually_aesni_mb_digest(vector) - - def __gen_output(self, vector, cmds, core_mask=3D"", port_mask=3D""): - if core_mask !=3D "-1": - self.__gen_cipher_output(vector) - self.__gen_hash_output(vector) - cmds.append(vector) - - def __var2list(self, var): - var_list =3D var if isinstance(var, list) else [var] - return var_list - - def __is_valid_op(self, chain, op): - chain_op_map =3D { - "CIPHER_ONLY": ["ENCRYPT", "DECRYPT"], - "HASH_ONLY": ["GENERATE", "VERIFY"], - "CIPHER_HASH": ["ENCRYPT", "GENERATE"], - "HASH_CIPHER": ["DECRYPT", "VERIFY"], - } - if op in chain_op_map[chain]: - return True - return False - - def __is_valid_size(self, key_type, algo, size): - algo_size_map =3D { - "aes-cbc": { - "cipher_key": [16, 24, 32], - "iv": [16], - }, - "aes-ctr": { - "cipher_key": [16, 24, 32], - "iv": [16] - }, - "3des-cbc": { - "cipher_key": [16, 24], - "iv": [8] - }, - "3des-ctr": { - "cipher_key": [16, 24], - "iv": [8] - }, - "aes-gcm": { - "cipher_key": [16, 24, 32], - "auth_key": [16, 24, 32], - "aad": [0, 1, 2, 3, 4, 5, 6, 8, 9, 12, 16, 24, 32, 64,= 128, 155, 256, 1024, 65535], - "iv": [12, 16] - }, - "aes-docsisbpi": { - "cipher_key": [16], - "iv": [16], - }, - "des-docsisbpi": { - "cipher_key": [8], - "iv": [8], - }, - "snow3g-uea2": { - "cipher_key": [16], - "iv": [16] - }, - "kasumi-f8": { - "cipher_key": [16], - "iv": [8] - }, - "zuc-eea3": { - "cipher_key": [16], - "iv": [16] - }, - "null": { - "cipher_key": [0], - "auth_key": [0], - "aad": [0], - "iv": [0] - }, - "md-hmac": { - "auth_key": [64], - "aad": [0], - }, - "sha1-hmac": { - "auth_key": [64], - "aad": [0] - }, - "sha2-224-hmac": { - "auth_key": [64], - "aad": [0] - }, - "sha2-256-hmac": { - "auth_key": [64], - "aad": [0] - }, - "sha2-384-hmac": { - "auth_key": [128], - "aad": [0] - }, - "sha2-512-hmac": { - "auth_key": [128], - "aad": [0] - }, - "AES_XCBC_MAC": { - "auth_key": [16], - "aad": [0] - }, - "aes-gmac": { - "auth_key": [16, 24, 32], - "aad": [1, 16, 64, 128, 256, 65535] - }, - "snow-uia2": { - "auth_key": [16], - "aad": [16] - }, - "kasumi-f9": { - "auth_key": [16], - "aad": [8] - }, - "zuc-eia3": { - "auth_key": [16], - "aad": [16] - }, - "md5": { - "auth_key": [0], - "aad": [0], - }, - "sha1": { - "auth_key": [0], - "aad": [0] - }, - "sha2-224": { - "auth_key": [0], - "aad": [0] - }, - "sha2-256": { - "auth_key": [0], - "aad": [0] - }, - "sha2-384": { - "auth_key": [0], - "aad": [0] - }, - "sha2-512": { - "auth_key": [0], - "aad": [0] - }, - } - result =3D False - if algo in algo_size_map: - if key_type in algo_size_map[algo]: - if size in algo_size_map[algo][key_type]: - result =3D True - return result - - def __actually_aesni_mb_digest(self, vector): - if ((vector["vdev"]).find("crypto_aesni_mb") =3D=3D -1): - return - - auth_algo_dgst_map =3D { - "md4-hmac": 12, - "sha1-hmac": 12, - "sha2-224-hamc": 14, - "sha2-256-hmac": 16, - "sha2-384-hamc": 24, - "sha2-512-hmac": 32, - "AES_XCBC_MAC": 12 - } - if vector["auth_algo"] in auth_algo_dgst_map: - digest =3D auth_algo_dgst_map[vector["auth_algo"]] - vector["output_hash"] =3D vector["output_hash"] if digest >=3D= (len(vector["output_hash"]) / 2) \ - else (vector["output_hash"])[0:2*digest] - - def __iter_cipher_algo(self, vector, vector_list, core_mask=3D"", port= _mask=3D""): - test_vector =3D vector.copy() - if test_vector["chain"] =3D=3D "HASH_ONLY": - test_vector["cipher_algo"] =3D "" - self.__iter_cipher_op(test_vector, vector_list, core_mask, por= t_mask) - else: - cipher_algo_list =3D self.__var2list(test_vector["cipher_algo"= ]) - for cipher_algo in cipher_algo_list: - test_vector =3D vector.copy() - test_vector["cipher_algo"] =3D cipher_algo - self.__iter_cipher_op(test_vector, vector_list, core_mask,= port_mask) - - def __iter_cipher_op(self, vector, vector_list, core_mask=3D"", port_m= ask=3D""): - test_vector =3D vector.copy() - if test_vector["chain"] =3D=3D "HASH_ONLY": - test_vector["cipher_op"] =3D "" - self.__iter_cipher_key(test_vector, vector_list, core_mask, po= rt_mask) - else: - cipher_op_list =3D self.__var2list(test_vector["cipher_op"]) - for cipher_op in cipher_op_list: - if self.__is_valid_op(test_vector["chain"], cipher_op): - test_vector =3D vector.copy() - test_vector["cipher_op"] =3D cipher_op - self.__iter_cipher_key(test_vector, vector_list, - core_mask, port_mask) - - def __iter_cipher_key(self, vector, vector_list, core_mask=3D"", port_= mask=3D""): - test_vector =3D vector.copy() - if test_vector["chain"] =3D=3D "HASH_ONLY": - test_vector["cipher_key"] =3D "" - self.__iter_iv(test_vector, vector_list, core_mask, port_mask) - else: - cipher_key_list =3D self.__var2list(test_vector["cipher_key"]) - for cipher_key in cipher_key_list: - test_vector =3D vector.copy() - if isinstance(cipher_key, int): - if self.__is_valid_size("cipher_key", - test_vector["cipher_algo"], - cipher_key): - test_vector["cipher_key"] =3D self.__gen_key(ciphe= r_key) - self.__iter_iv(test_vector, vector_list, core_mask= , port_mask) - else: - continue - else: - test_vector["cipher_key"] =3D cipher_key - self.__iter_iv(test_vector, vector_list, core_mask, po= rt_mask) - - def __iter_iv(self, vector, vector_list, core_mask=3D"", port_mask=3D"= "): - test_vector =3D vector.copy() - if test_vector["chain"] =3D=3D "HASH_ONLY": - test_vector["iv"] =3D "" - self.__iter_auth_algo(test_vector, vector_list, core_mask, por= t_mask) - else: - iv_list =3D self.__var2list(test_vector["iv"]) - for iv in iv_list: - test_vector =3D vector.copy() - if isinstance(iv, int): - if self.__is_valid_size("iv", - test_vector["cipher_algo"], - iv): - test_vector["iv"] =3D self.__gen_key(iv) - self.__iter_auth_algo(test_vector, vector_list, - core_mask, port_mask) - else: - continue - else: - test_vector["iv"] =3D iv - self.__iter_auth_algo(test_vector, vector_list, - core_mask, port_mask) - - def __iter_auth_algo(self, vector, vector_list, core_mask=3D"", port_m= ask=3D""): - test_vector =3D vector.copy() - if test_vector["chain"] =3D=3D "CIPHER_ONLY": - test_vector["auth_algo"] =3D "" - self.__iter_auth_op(test_vector, vector_list, core_mask, port_= mask) - else: - auth_algo_list =3D self.__var2list(test_vector["auth_algo"]) - for auth_algo in auth_algo_list: - test_vector =3D vector.copy() - test_vector["auth_algo"] =3D auth_algo - self.__iter_auth_op(test_vector, vector_list, core_mask, p= ort_mask) - - def __iter_auth_op(self, vector, vector_list, core_mask=3D"", port_mas= k=3D""): - test_vector =3D vector.copy() - if test_vector["chain"] =3D=3D "CIPHER_ONLY": - test_vector["auth_op"] =3D "" - self.__iter_auth_key(test_vector, vector_list, core_mask, port= _mask) - else: - auth_op_list =3D self.__var2list(test_vector["auth_op"]) - for auth_op in auth_op_list: - if self.__is_valid_op(test_vector["chain"], auth_op): - test_vector =3D vector.copy() - test_vector["auth_op"] =3D auth_op - self.__iter_auth_key(test_vector, vector_list, - core_mask, port_mask) - - def __iter_auth_key(self, vector, vector_list, core_mask=3D"", port_ma= sk=3D""): - test_vector =3D vector.copy() - if test_vector["chain"] =3D=3D "CIPHER_ONLY": - test_vector["auth_key"] =3D "" - self.__iter_aad(test_vector, vector_list, core_mask, port_mask= ) - else: - auth_key_list =3D self.__var2list(test_vector["auth_key"]) - for auth_key in auth_key_list: - test_vector =3D vector.copy() - if isinstance(auth_key, int): - if self.__is_valid_size("auth_key", - test_vector["auth_algo"], - auth_key): - test_vector["auth_key"] =3D self.__gen_key(auth_ke= y) - self.__iter_aad(test_vector, vector_list, core_mas= k, port_mask) - else: - continue - else: - test_vector["auth_key"] =3D auth_key - self.__iter_aad(test_vector, vector_list, core_mask, p= ort_mask) - - def __iter_aad(self, vector, vector_list, core_mask=3D"", port_mask=3D= ""): - test_vector =3D vector.copy() - if test_vector["chain"] =3D=3D "CIPHER_ONLY": - test_vector["aad"] =3D "" - self.__iter_input(test_vector, vector_list, core_mask, port_ma= sk) - else: - aad_list =3D self.__var2list(test_vector["aad"]) - for aad in aad_list: - test_vector =3D vector.copy() - if isinstance(aad, int): - if self.__is_valid_size("aad", - test_vector["auth_algo"], - aad): - test_vector["aad"] =3D self.__gen_key(aad) - self.__iter_input(test_vector, vector_list, - core_mask, port_mask) - else: - continue - else: - test_vector["aad"] =3D aad - self.__iter_input(test_vector, vector_list, - core_mask, port_mask) - - def __iter_input(self, vector, vector_list, core_mask=3D"", port_mask= =3D""): - input_list =3D self.__var2list(vector["input"]) - for input_data in input_list: - test_vector =3D vector.copy() - test_vector["input"] =3D self.__gen_input(input_data) \ - if isinstance(input_data, int) else input_data - - self.__gen_output(test_vector, vector_list, core_mask, port_ma= sk) - - def __test_vector_to_vector_list(self, test_vector, core_mask=3D"", po= rt_mask=3D""): - vector_list =3D [] - - chain_list =3D self.__var2list(test_vector["chain"]) - - for chain in chain_list: - test_vector["chain"] =3D chain - self.__iter_cipher_algo(test_vector, vector_list, core_mask, p= ort_mask) - return vector_list - - -test_vectors =3D { - "qat_c_AES_CBC_00": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-cbc"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24, 32], - "iv": [16], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_c_AES_CTR_00": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-ctr"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24, 32], - "iv": [16], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_c_AES_GCM_00": { - "vdev": "", - "chain": ["CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-gcm"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [12, 16], - "auth_algo": ["aes-gcm", "aes-gmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_h_MD_SHA_00": { - "vdev": "", - "chain": ["HASH_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_h_AES_XCBC_MAC_01": { - "vdev": "", - "chain": "HASH_ONLY", - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["AES_XCBC_MAC"], - "auth_op": "GENERATE", - "auth_key": [16], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_c_3DES_CBC_00": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["3des-cbc"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24], - "iv": [8], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_c_3DES_CTR_00": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["3des-ctr"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24], - "iv": [8], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_c_AES_GCM_01": { - "vdev": "", - "chain": ["CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-gcm"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [12, 16], - "auth_algo": ["aes-gcm"], - "auth_op": ["GENERATE"], - "auth_key": [16, 24, 32], - "auth_key_random_size": "", - "aad": [8, 12], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_ch_AES_GCM_AES_GCM_01": { - "vdev": "", - "chain": ["CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-gcm"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [12, 16], - "auth_algo": ["aes-gcm"], - "auth_op": ["GENERATE"], - "auth_key": [16, 24, 32], - "auth_key_random_size": "", - "aad": [8, 12], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_ch_AES_DOCSISBPI": { - "vdev": "", - "chain": ["CIPHER_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "aes-docsisbpi", - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [16], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [129, 256, 258, 515, 772, 1019, 1547, 2011, 2048], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_c_DES_DOCSISBPI": { - "vdev": "", - "chain": ["CIPHER_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "des-docsisbpi", - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [8], - "iv": [8], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": "", - "aad_random_size": "", - "input": [64, 127, 258, 506, 512, 521, 1020, 1022, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - "qat_c_UEA2_01": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["snow3g-uea2"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [16], - "auth_algo": ["snow3g-uia2"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [16], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_h_UIA2_01": { - "vdev": "", - "chain": ["HASH_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["snow3g-uia2"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [16], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_kasumi_c_F8_01": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["kasumi-f8"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [8], - "auth_algo": ["kasumi-f9"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [8], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_kasumi_h_F9_01": { - "vdev": "", - "chain": ["HASH_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["kasumi-f9"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [8], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_c_EEA3_01": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["zuc-eea3"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [16], - "auth_algo": ["zuc-eia3"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [16], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_h_EIA3_01": { - "vdev": "", - "chain": ["HASH_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["zuc-eia3"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [16], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_c_NULL_auto": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["null"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [0], - "iv": "", - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "digest": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "qat_h_NULL_auto": { - "vdev": "", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["null", "aes-cbc", "aes-ctr", "3des-ctr", "snow3g-= uea2", "kasumi-f8"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [8, 16, 24, 32, 40, 48, 56, 64], - "iv": "", - "auth_algo": ["null"], - "auth_op": ["GENERATE"], - "auth_key": [0], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "digest": "", - "input": [16, 48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "aesni_mb_c_AES_CBC_00": { - "vdev": "crypto_aesni_mb,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-cbc"], - "cipher_op": ["ENCRYPT"], - "cipher_key": [16, 24, 32], - "iv": [16], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "aesni_mb_c_AES_CTR_00": { - "vdev": "crypto_aesni_mb,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-ctr"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24, 32], - "iv": [16], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "aesni_mb_c_AES_DOCSISBPI": { - "vdev": "crypto_aesni_mb,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "aes-docsisbpi", - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [16], - "auth_algo": "", - "auth_op": "", - "auth_key": "", - "auth_key_random_size": "", - "aad": "", - "aad_random_size": "", - "input": [129, 256, 258, 515, 772, 1019, 1547, 2011, 2048], - "output_cipher": "*", - "output_hash": "*" - }, - - "null_c_NULL_01": { - "vdev": "crypto_null_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["null"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": ["0"], - "iv": "", - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "digest": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "null_h_NULL": { - "vdev": "crypto_null_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": "HASH_ONLY", - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": [0], - "iv": "", - "auth_algo": ["null"], - "auth_op": ["GENERATE"], - "auth_key": [0], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "digest": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "null_c_NULL_auto": { - "vdev": "crypto_null_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["null"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [0], - "iv": [0], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [0, 8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "digest": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "null_h_NULL_auto": { - "vdev": "crypto_null_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["null"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [0, 8, 16, 24, 32, 40, 48, 56, 64], - "iv": [0], - "auth_algo": ["null"], - "auth_op": ["GENERATE"], - "auth_key": [0], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "digest": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "aesni_gcm_ch_AES_GCM_AES_GCM_01": { - "vdev": "crypto_aesni_gcm_pmd,socket_id=3D1,max_nb_sessions=3D128"= , - "chain": ["CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-gcm"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [12, 16], - "auth_algo": ["aes-gcm"], - "auth_op": ["GENERATE"], - "auth_key": [16, 24, 32], - "auth_key_random_size": "", - "aad": [8, 12], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "kasumi_c_F8_01": { - "vdev": "crypto_kasumi_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["kasumi-f8"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [8], - "auth_algo": ["kasumi-f9"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [8], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "kasumi_h_F9_01": { - "vdev": "crypto_kasumi_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["HASH_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["kasumi-f9"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [8], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "snow3g_c_UEA2_01": { - "vdev": "crypto_snow3g_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["sno3g-uea2"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [16], - "auth_algo": ["snow3g-uia2"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [16], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "snow3g_h_UIA2_01": { - "vdev": "crypto_snow3g_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["HASH_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["snow3g-uia2"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [16], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "zuc_c_EEA3_01": { - "vdev": "crypto_zuc_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["zuc-eea3"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [16], - "auth_algo": ["zuc-eia3"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [16], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "zuc_h_EIA3_01": { - "vdev": "crypto_zuc_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["HASH_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["zuc-eia3"], - "auth_op": ["GENERATE"], - "auth_key": [16], - "auth_key_random_size": "", - "aad": [16], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "openssl_c_3DES_CBC_00": { - "vdev": "crypto_openssl_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["3des-cbc"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24], - "iv": [8], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "openssl_c_3DES_CTR_00": { - "vdev": "crypto_openssl_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["3des-ctr"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24], - "iv": [8], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "openssl_c_AES_CBC_00": { - "vdev": "crypto_openssl_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-cbc"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24, 32], - "iv": [16], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "openssl_c_AES_CTR_00": { - "vdev": "crypto_openssl_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY", "CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-ctr"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16, 24, 32], - "iv": [16], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "openssl_c_AES_GCM_00": { - "vdev": "crypto_openssl_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_HASH"], - "cdev_type": "ANY", - "cipher_algo": ["aes-gcm"], - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [16], - "iv": [12, 16], - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "openssl_h_MD_SHA_00": { - "vdev": "crypto_openssl_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["HASH_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "", - "cipher_op": "", - "cipher_key": "", - "iv": "", - "auth_algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384", "= sha2-512", - "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", - "sha2-384-hmac", "sha2-512-hmac"], - "auth_op": ["GENERATE"], - "auth_key": [8, 16, 24, 32, 40, 48, 56, 64, 128], - "auth_key_random_size": "", - "aad": [0], - "aad_random_size": "", - "input": [48, 64, 128, 129, 256, 512, 1024], - "output_cipher": "*", - "output_hash": "*" - }, - - "openssl_c_DES_DOCSISBPI": { - "vdev": "crypto_openssl_pmd,socket_id=3D1,max_nb_sessions=3D128", - "chain": ["CIPHER_ONLY"], - "cdev_type": "ANY", - "cipher_algo": "des-docsisbpi", - "cipher_op": ["ENCRYPT", "DECRYPT"], - "cipher_key": [8], - "iv": [8], - "auth_algo": "", - "auth_op": "", - "auth_key": "", - "auth_key_random_size": "", - "aad": "", - "aad_random_size": "", - "input": [64, 127, 258, 506, 512, 521, 1020, 1022, 1024], - "output_cipher": "*", - "output_hash": "*" - }, -} diff --git a/tests/TestSuite_l2fwd_cryptodev_func.py b/tests/TestSuite_l2fw= d_cryptodev_func.py new file mode 100644 index 0000000..546c010 --- /dev/null +++ b/tests/TestSuite_l2fwd_cryptodev_func.py @@ -0,0 +1,2682 @@ +# BSD LICENSE +# +# Copyright(c) 2016-2017 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import hmac +import hashlib +import binascii +import time +import utils +from test_case import TestCase +from packet import Packet + +from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, mod= es +from cryptography.hazmat.primitives.ciphers.aead import AESCCM, AESGCM +from cryptography.hazmat.backends import default_backend + +# Manually Install the CryptoMobile Python Library, +# Before running this test suite +# Web link : https://github.com/mitshell/CryptoMobile +import CryptoMobile.CM as cm +import pyDes + +import cryptodev_common as cc + +class TestL2fwdCrypto(TestCase): + + def set_up_all(self): + + self.core_config =3D "1S/2C/1T" + self.number_of_ports =3D 1 + self.dut_ports =3D self.dut.get_ports(self.nic) + self.verify(len(self.dut_ports) >=3D self.number_of_ports, + "Not enough ports for " + self.nic) + self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) + + self.logger.info("core config =3D " + self.core_config) + self.logger.info("number of ports =3D " + str(self.number_of_ports= )) + self.logger.info("dut ports =3D " + str(self.dut_ports)) + self.logger.info("ports_socket =3D " + str(self.ports_socket)) + + self.core_mask =3D utils.create_mask(self.dut.get_core_list( + self.core_config, + socket=3Dself.ports_socket)) + self.port_mask =3D utils.create_mask([self.dut_ports[0]]) + + self.tx_port =3D self.tester.get_local_port(self.dut_ports[0]) + self.rx_port =3D self.tester.get_local_port(self.dut_ports[0]) + + self.tx_interface =3D self.tester.get_interface(self.tx_port) + self.rx_interface =3D self.tester.get_interface(self.rx_port) + + self.logger.info("core mask =3D " + self.core_mask) + self.logger.info("port mask =3D " + self.port_mask) + self.logger.info("tx interface =3D " + self.tx_interface) + self.logger.info("rx interface =3D " + self.rx_interface) + + self._app_path =3D "./examples/l2fwd-crypto/build/l2fwd-crypto" + if not cc.is_build_skip(self): + cc.build_dpdk_with_cryptodev(self) + + self.vf_driver =3D self.get_suite_cfg()['vf_driver'] + cc.bind_qat_device(self, self.vf_driver) + + + def set_up(self): + pass + + def test_qat_AES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_AES_CBC_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_AES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_AES_CTR_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_AES_CTR_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_AES_CTR_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_AES_GCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_AES_GCM_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_AES_GCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_AES_CCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_AES_CCM_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_AES_CCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_h_MD_SHA_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_h_MD_SHA_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_h_MD_SHA_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_h_AES_XCBC_MAC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_h_AES_XCBC_MAC_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_h_AES_XCBC_MAC_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_3DES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_3DES_CBC_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_3DES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_3DES_CTR_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_3DES_CTR_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_3DES_CTR_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_AES_DOCSISBPI_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_AES_DOCSISBPI_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_AES_DOCSISBPI_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_DES_DOCSISBPI_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_DES_DOCSISBPI_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_DES_DOCSISBPI_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_SNOW3G_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_c_UEA2_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_c_UEA2_01"): + result =3D False + + self.logger.info("Test qat_h_UIA2_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_h_UIA2_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_KASUMI_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_kasumi_c_F8_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_kasumi_c_F8_01"): + result =3D False + + self.logger.info("Test qat_kasumi_h_F9_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_kasumi_h_F9_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_ZUC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_c_EEA3_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_c_EEA3_01"): + result =3D False + + self.logger.info("Test qat_h_EIA3_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_h_EIA3_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_qat_NULL_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test qat_NULL_auto") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "qat_NULL_auto"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_mb_AES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_mb_AES_CBC_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_mb_AES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_mb_AES_CTR_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_mb_AES_CTR_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_mb_AES_CTR_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_mb_AES_DOCSISBPI_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_mb_AES_DOCSISBPI_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_mb_AES_DOCSISBPI_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_mb_AES_CCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_mb_AES_CCM_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_mb_AES_CCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_gcm_AES_GCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_gcm_aead_AES_GCM_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_gcm_aead_AES_GCM_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_mb_h_MD_SHA_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_mb_h_MD_SHA_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_mb_h_MD_SHA_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_mb_3DES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_mb_3DES_CBC_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_mb_3DES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_kasumi_KASUMI_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test kasumi_c_F8_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "kasumi_c_F8_01"): + result =3D False + + self.logger.info("Test kasumi_h_F9_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "kasumi_h_F9_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_null_NULL_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test null_NULL_auto") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "null_NULL_auto"): + result =3D False + + self.verify(result, "Test failed") + + def test_snow3g_SNOW3G_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test snow3g_c_UEA2_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "snow3g_c_UEA2_01"): + result =3D False + + self.logger.info("Test snow3g_h_UIA2_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "snow3g_h_UIA2_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_zuc_ZUC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test zuc_c_EEA3_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "zuc_c_EEA3_01"): + result =3D False + + self.logger.info("Test zuc_h_EIA3_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "zuc_h_EIA3_01"): + result =3D False + + self.verify(result, "Test failed") + + # openssl pmd cases + def test_openssl_3DES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_3DES_CBC_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_3DES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_openssl_3DES_CTR_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_3DES_CTR_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_3DES_CTR_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_openssl_AES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_AES_CBC_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_AES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_openssl_AES_CTR_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_AES_CTR_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_AES_CTR_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_openssl_AES_GCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_AES_GCM_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_AES_GCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_openssl_AES_CCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_AES_CCM_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_AES_CCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_openssl_h_MD_SHA_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_h_MD_SHA_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_h_MD_SHA_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_openssl_DES_DOCSISBPI_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_DES_DOCSISBPI_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_DES_DOCSISBPI_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_mb_DES_DOCSISBPI_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_mb_DES_DOCSISBPI_01") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_mb_DES_DOCSISBPI_01"): + result =3D False + + self.verify(result, "Test failed") + + def test_aesni_mb_DES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test aesni_mb_DES_CBC_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "aesni_mb_DES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_openssl_DES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test openssl_DES_CBC_00") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "openssl_DES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_scheduler_rr_AES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test scheduler_rr_AES_CBC") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "scheduler_rr_AES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_scheduler_rr_AES_GCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test scheduler_rr_AES_GCM") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "scheduler_rr_AES_GCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_scheduler_psb_AES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test scheduler_psb_AES_CBC") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "scheduler_psb_AES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_scheduler_psb_AES_GCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test scheduler_psb_AES_GCM") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "scheduler_psb_AES_GCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_scheduler_fo_AES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test scheduler_fo_AES_CBC") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "scheduler_fo_AES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_scheduler_fo_AES_GCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test scheduler_fo_AES_GCM") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "scheduler_fo_AES_GCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_scheduler_mm_AES_CBC_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test scheduler_mm_AES_CBC") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "scheduler_mm_AES_CBC_00"): + result =3D False + + self.verify(result, "Test failed") + + def test_scheduler_mm_AES_GCM_auto(self): + if cc.is_test_skip(self): + return + + result =3D True + self.logger.info("Test scheduler_mm_AES_GCM") + if not self.__execute_l2fwd_crypto_test( + test_vectors, "scheduler_mm_AES_GCM_00"): + result =3D False + + self.verify(result, "Test failed") + + def __calculate_total_cases_numb(self): + alg_map =3D {} + pmd_map =3D {} + map_combine =3D {} + count =3D 0 + alg =3D "" + pmd =3D "" + alg_list =3D ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_CBC", + "3DES_CTR", "SNOW3G", "KASUMI", "ZUC", "NULL", "MD_SHA= "] + pmd_list =3D ["qat", "aesni_mb", "aesni_gcm", "snow3g", + "kasumi", "zuc", "openssl", "null"] + valid_map =3D { + "qat": ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_CBC", + "3DES_CTR", "SNOW3G", "KASUMI", "NULL", "MD_SH= A"], + "aesni_mb": ["AES_CBC", "AES_CTR"], + "aesni_gcm": ["AES_GCM"], + "snow3g": ["SNOW3G"], + "kasumi": ["KASUMI"], + "zuc": ["ZUC"], + "openssl": ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_CBC= ", + "3DES_CTR", "MD_SHA"], + "null": ["NULL"] + } + + for index, value in test_vectors.iteritems(): + test_vector_list =3D self.__test_vector_to_vector_list(value, + core_mask=3D"-1", port_mask=3Dself.port_mask) + count =3D count + len(test_vector_list) + for i in alg_list: + if (index.upper()).find(i) !=3D -1: + alg =3D i + if i in alg_map: + alg_map[i] +=3D len(test_vector_list) + else: + alg_map[i] =3D len(test_vector_list) + for j in pmd_list: + if (index).find(j) !=3D -1: + pmd =3D j if j !=3D "" else "qat" + if i in pmd_map: + pmd_map[j] +=3D len(test_vector_list) + else: + pmd_map[j] =3D len(test_vector_list) + if alg in valid_map[pmd]: + temp_str =3D pmd + "_" + alg + if temp_str in map_combine: + map_combine[temp_str] +=3D len(test_vector_list) + else: + map_combine[temp_str] =3D len(test_vector_list) + for k, v in alg_map.iteritems(): + self.logger.info("Total {name} cases:\t\t\t{number}".format(na= me=3Dk, number=3Dv)) + for k, v in pmd_map.iteritems(): + self.logger.info("Total {name} cases:\t\t\t{number}".format(na= me=3Dk, number=3Dv)) + for k, v in map_combine.iteritems(): + self.logger.info("Total {name} cases:\t\t\t{number}".format(na= me=3Dk, number=3Dv)) + self.logger.info("Total cases:\t\t\t {0}".format(count)) + + def __execute_l2fwd_crypto_test(self, test_vectors, test_vector_name): + + if test_vector_name not in test_vectors: + self.logger.warning("SKIP : " + test_vector_name) + return True + + test_vector =3D test_vectors[test_vector_name] + + test_vector_list =3D self.__test_vector_to_vector_list(test_vector= , + core_mask=3Dself.core_mask, + port_mask=3Dself.port_mask) + + result =3D True + self.logger.info("Total Generated {0} Tests".format(len(test_vecto= r_list))) + for test_vector in test_vector_list: + self.logger.debug(test_vector) + cmd_str =3D self.__test_vector_to_cmd(test_vector, + core_mask=3Dself.core_mask= , + port_mask=3Dself.port_mask= ) + self.dut.send_expect(cmd_str, "=3D=3D", 40) + time.sleep(5) + + payload =3D self.__format_hex_to_list(test_vector["input"]) + + inst =3D self.tester.tcpdump_sniff_packets(self.rx_interface, + timeout=3D5, + filters=3D[{'layer': = 'ether', + 'config': {'dst': '52= :00:00:00:00:01'}}]) + + PACKET_COUNT =3D 65 + pkt =3D Packet() + pkt.assign_layers(["ether", "ipv4", "raw"]) + pkt.config_layer("ether", {"src": "52:00:00:00:00:00", "dst":"= 52:00:00:00:00:01"}) + pkt.config_layer("ipv4", {"src": "192.168.1.1", "dst": "192.16= 8.1.2"}) + pkt.config_layer("raw", {"payload": payload}) + pkt.send_pkt(tx_port=3Dself.tx_interface, count=3DPACKET_COUNT= ) + + pkt_rec =3D self.tester.load_tcpdump_sniff_packets(inst) + + for pkt_r in pkt_rec: + packet_hex =3D pkt_r.pktgen.pkt["Raw"].getfieldval("load") + if packet_hex =3D=3D None: + result =3D False + self.logger.info("no payload !") + continue + cipher_text =3D binascii.b2a_hex(packet_hex) + if str.lower(cipher_text) =3D=3D str.lower(test_vector["ou= tput_cipher"]): + self.logger.debug(cipher_text) + self.logger.info("Cipher Matched.") + else: + if test_vector["output_cipher"] !=3D "": + result =3D False + self.logger.info("Cipher NOT Matched.") + self.logger.info("Cipher text in packet =3D " + ci= pher_text) + self.logger.info("Ref Cipher text =3D " + te= st_vector["output_cipher"]) + else: + self.logger.info("Skip Cipher, Since no cipher tex= t set") + + hash_length =3D len(test_vector["output_hash"])/2 + if hash_length !=3D 0: + if test_vector["auth_algo"] =3D=3D "null": + hash_text =3D binascii.b2a_hex(pkt_r.pktgen.pkt["R= aw"].getfieldval("load")) + else: + hash_text =3D binascii.b2a_hex(pkt_r.pktgen.pkt["P= adding"].getfieldval("load")) + if str.lower(hash_text) =3D=3D str.lower(test_vector["= output_hash"]): + self.logger.info("Hash Matched") + else: + result =3D False + self.logger.info("Hash NOT Matched") + self.logger.info("Hash text in packet =3D " + hash= _text) + self.logger.info("Ref Hash text =3D " + test= _vector["output_hash"]) + else: + self.logger.info("Skip Hash, Since no hash text set") + + self.logger.info("Packet Size : %d " % (len(test_vector["in= put"]) / 2)) + + # Close l2fwd-crypto process + self.dut.kill_all() + + if result: + self.logger.info("PASSED") + else: + self.logger.info("FAILED") + + return result + + def tear_down(self): + self.dut.kill_all() + + def tear_down_all(self): + cc.clear_dpdk_config(self) + + def __test_vector_to_cmd(self, test_vector, core_mask=3D"", port_mask= =3D""): + + eal_opt_str =3D cc.get_eal_opt_str(self) + + EAL_SEP =3D " --" + PORT_MASK =3D "" if port_mask =3D=3D "" else " -p " + port_mask + QUEUE_NUM =3D "" + + vdev =3D "" + if self.__check_field_in_vector(test_vector, "vdev"): + vdev =3D " --vdev " + test_vector["vdev"] + + chain =3D "" + if self.__check_field_in_vector(test_vector, "chain"): + chain =3D " --chain " + test_vector["chain"] + + cdev_type =3D "" + if self.__check_field_in_vector(test_vector, "cdev_type"): + cdev_type =3D " --cdev_type " + test_vector["cdev_type"] + + aad_random_size =3D "" + cipher_algo =3D "" + cipher_key =3D "" + cipher_op =3D "" + auth_algo =3D "" + auth_key =3D "" + auth_op =3D "" + auth_key_random_size =3D "" + aad =3D "" + iv =3D "" + digest_size =3D "" + if test_vector["chain"].upper() =3D=3D "AEAD": + if self.__check_field_in_vector(test_vector, "cipher_algo"): + cipher_algo =3D " --aead_algo " + test_vector["cipher_algo= "] + + if self.__check_field_in_vector(test_vector, "cipher_op"): + cipher_op =3D " --aead_op " + test_vector["cipher_op"] + + if self.__check_field_in_vector(test_vector, "cipher_key"): + cipher_key =3D " --aead_key " + self.__format_hex_to_param= (test_vector["cipher_key"]) + + if self.__check_field_in_vector(test_vector, "iv"): + iv =3D " --aead_iv " + self.__format_hex_to_param(test_vec= tor["iv"]) + if self.__check_field_in_vector(test_vector, "aad"): + aad =3D " --aad " + self.__format_hex_to_param(test_vector= ["aad"]) + + if self.__check_field_in_vector(test_vector, "digest_size"): + digest_size =3D " --digest " + str(test_vector["digest_siz= e"]) + + else: + if self.__check_field_in_vector(test_vector, "cipher_algo"): + cipher_algo =3D " --cipher_algo " + test_vector["cipher_al= go"] + + if self.__check_field_in_vector(test_vector, "cipher_op"): + cipher_op =3D " --cipher_op " + test_vector["cipher_op"] + + if self.__check_field_in_vector(test_vector, "cipher_key"): + cipher_key =3D " --cipher_key " + self.__format_hex_to_par= am(test_vector["cipher_key"]) + + if self.__check_field_in_vector(test_vector, "iv"): + iv =3D " --cipher_iv " + self.__format_hex_to_param(test_v= ector["iv"]) + + if self.__check_field_in_vector(test_vector, "auth_algo"): + auth_algo =3D " --auth_algo " + test_vector["auth_algo"] + + if self.__check_field_in_vector(test_vector, "auth_op"): + auth_op =3D " --auth_op " + test_vector["auth_op"] + + if self.__check_field_in_vector(test_vector, "auth_key"): + auth_key =3D " --auth_key " + self.__format_hex_to_param(t= est_vector["auth_key"]) + + if self.__check_field_in_vector(test_vector, "auth_key_random_= size"): + auth_key_random_size =3D " --auth_key_random_size " + test= _vector["auth_key_random_size"] + + if self.__check_field_in_vector(test_vector, "aad"): + aad =3D " --auth_iv " + self.__format_hex_to_param(test_ve= ctor["aad"]) + + if self.__check_field_in_vector(test_vector, "aad_random_size"= ): + aad_random_size =3D " --aad_random_size " + test_vector["a= ad_random_size"] + + if self.__check_field_in_vector(test_vector, "digest_size"): + digest_size =3D " --digest " + str(test_vector["digest_siz= e"]) + + cmd_str =3D " ".join([self._app_path, eal_opt_str, vdev, vdev, EAL= _SEP, PORT_MASK, + QUEUE_NUM, chain, cdev_type, cipher_algo, + cipher_op, cipher_key, iv, auth_algo, auth_op, + auth_key, auth_key_random_size, aad, + aad_random_size, digest_size, "--no-mac-updati= ng"]) + + return cmd_str + + def __check_field_in_vector(self, test_vector, field_name): + if field_name in test_vector and test_vector[field_name]: + return True + return False + + def __format_hex_to_param(self, hex_str, sep=3D":", prefix=3D""): + if not hex_str: + return "" + if len(hex_str) =3D=3D 1: + return prefix + "0" + hex_str + + result =3D prefix + hex_str[0:2] + for i in range(2, len(hex_str), 2): + if len(hex_str) < i + 2: + result =3D result + sep + "0" + hex_str[i:] + else: + result =3D result + sep + hex_str[i:i+2] + + return result + + def __format_hex_to_list(self, hex_str): + if not hex_str: + return [] + if len(hex_str) =3D=3D 1: + return [hex_str] + + result =3D [] + result.append(hex_str[0:2]) + for i in range(2, len(hex_str), 2): + if len(hex_str) < i + 2: + result.append(hex_str[i:]) + else: + result.append(hex_str[i:i+2]) + return result + + def __gen_input(self, length, pattern=3DNone): + pattern =3D "11" + input_str =3D "" + for i in range(length): + input_str +=3D pattern + return input_str + + def __gen_key(self, length, pattern=3DNone, mask=3D"000000"): + base_key =3D "000102030405060708090a0b0c0d0e0f" + key =3D "" + n =3D length // 16 + for i in range(n): + key =3D key + base_key + base_key =3D base_key[2:] + base_key[0:2] + m =3D length % 16 + key =3D key + base_key[0:2*m] + return key + + def __cipher_algorithm_for_cryptography_block_size_check(self, algo): + block_size =3D 8 + algo_block_map =3D { + "aes-cbc": 16, + "aes-ctr": 16, + "aes-gcm": 16, + "3des-cbc": 8, + "3des-ctr": 8, + "des-cbc": 8 + } + if algo in algo_block_map: + block_size =3D algo_block_map[algo] + + return block_size + + def __cryptography_cipher(self, vector): + key =3D binascii.a2b_hex(vector["cipher_key"]) + iv =3D binascii.a2b_hex(vector["iv"]) + cipher_str =3D "" + if vector["chain"].upper() !=3D "AEAD": + if vector["cipher_algo"] =3D=3D "aes-cbc": + cipher_algo =3D algorithms.AES(key) + cipher_mode =3D modes.CBC(iv) + elif vector["cipher_algo"] =3D=3D "aes-ctr": + cipher_algo =3D algorithms.AES(key) + cipher_mode =3D modes.CTR(iv) + elif vector["cipher_algo"] =3D=3D "3des-cbc": + cipher_algo =3D algorithms.TripleDES(key) + cipher_mode =3D modes.CBC(iv) + elif vector["cipher_algo"] =3D=3D "3des-ctr": + cipher_algo =3D algorithms.TripleDES(key) + cipher_mode =3D modes.CTR(iv) + + elif vector["cipher_algo"] =3D=3D "des-cbc": + cipher =3D pyDes.des(key, pyDes.CBC, iv) + if vector["cipher_op"] =3D=3D "DECRYPT": + cipher_str =3D cipher.decrypt(binascii.a2b_hex(vector[= "input"])) + else: + cipher_str =3D cipher.encrypt(binascii.a2b_hex(vector[= "input"])) + else: + cipher_algo =3D algorithms.AES(key) + cipher_mode =3D modes.CBC(iv) + + # this is workaround, need to refact to calculate method by di= ff lib + if cipher_str =3D=3D "": + cipher =3D Cipher(cipher_algo, cipher_mode, backend=3Ddefa= ult_backend()) + if vector["cipher_op"] =3D=3D "DECRYPT": + encryptor =3D cipher.decryptor() + else: + encryptor =3D cipher.encryptor() + cipher_str =3D encryptor.update(binascii.a2b_hex(vector["i= nput"])) + encryptor.finalize() + else: + if vector["cipher_algo"] =3D=3D "aes-gcm": + aesgcm =3D AESGCM(key) + cipher_str =3D aesgcm.encrypt(iv, + binascii.a2b_hex(vector["input= "]), + binascii.a2b_hex(vector["aad"]= )) + cipher_str =3D cipher_str[0:-16] + elif vector["cipher_algo"] =3D=3D "aes-ccm": + aesccm =3D AESCCM(key) + cipher_str =3D aesccm.encrypt(iv, + binascii.a2b_hex(vector["input= "]), + binascii.a2b_hex(vector["aad"]= )) + cipher_str =3D cipher_str[0:-16] + + return binascii.b2a_hex(cipher_str) + + def __CryptoMoble_cipher(self, vector): + cipher_str =3D "" + out_str =3D "" + cipher_algo =3D vector['cipher_algo'] + + mBitlen =3D 8 * (len(vector['input']) / 2) + bin_input =3D bytearray.fromhex(vector["input"]) + str_input =3D str(bin_input) + bin_key =3D binascii.a2b_hex(vector["cipher_key"]) + + if ((cipher_algo.upper()).find("KASUMI") !=3D -1): + vector["iv"] =3D vector["iv"][:10] + "000000" + out_str =3D cm.UEA1(key=3Dbin_key, count=3D66051, bearer=3D0, + dir=3D1, data=3Dstr_input, bitlen=3DmBitlen) + + elif ((cipher_algo.upper()).find("SNOW3G") !=3D -1): + vector["iv"] =3D "00000000000000000000000000000000" + out_str =3D cm.UEA2(key=3Dbin_key, count=3D0, bearer=3D0, dir= =3D0, + data=3Dstr_input, bitlen=3DmBitlen) + elif ((cipher_algo.upper()).find("ZUC") !=3D -1): + vector["iv"] =3D "00010203040000000001020304000000" + out_str =3D cm.EEA3(key=3Dbin_key, count=3D0x10203, bearer=3D0= , dir=3D1, + data=3Dstr_input, bitlen=3DmBitlen) + + cipher_str =3D out_str.encode("hex").upper() + + return cipher_str + + def __gen_null_cipher_out(self, vector): + cipher_str =3D "" + if (vector['chain'] =3D=3D "CIPHER_ONLY") or (vector['chain'] =3D= =3D "CIPHER_HASH"): + cipher_str =3D vector['input'] + elif (vector['chain'] =3D=3D "HASH_CIPHER"): + cipher_str =3D vector['output_hash'] + return cipher_str + + def __gen_cipher_output(self, vector): + if vector["chain"] =3D=3D "HASH_ONLY": + vector["output_cipher"] =3D "" + return + + if vector["output_cipher"] !=3D "*": + return + + cipher_str =3D "" + + if(((vector['cipher_algo']).upper()).find("KASUMI") !=3D -1) or \ + (((vector['cipher_algo']).upper()).find("SNOW3G") !=3D -1)= or \ + (((vector['cipher_algo']).upper()).find("ZUC") !=3D -1): + cipher_str =3D self.__CryptoMoble_cipher(vector) + elif (vector['cipher_algo'] =3D=3D "NULL"): + cipher_str =3D self.__gen_null_cipher_out(vector) + elif ((vector['cipher_algo']).upper()).find("DOCSISBPI") !=3D -1: + cipher_str =3D len(vector["input"]) * "a" + elif (vector['cipher_algo']).upper() =3D=3D "NULL": + cipher_str =3D vector["input"] if vector["chain"].upper().find= ("HASH_") =3D=3D -1 else vector["output_hash"] + else: + cipher_str =3D self.__cryptography_cipher(vector) + vector["output_cipher"] =3D cipher_str.lower() + + def __gen_kasumi_hash(self, vector): + auth_str =3D "" + auth_algo =3D vector['auth_algo'] + mBitlen =3D 8 * (len(vector['input']) / 2) + bin_input =3D bytearray.fromhex(vector["input"]) + str_input =3D str(bin_input) + bin_key =3D binascii.a2b_hex(vector["auth_key"]) + + hash_out =3D cm.UIA1(key=3Dbin_key, count=3D0X10203, fresh=3D0X405= 0607, dir=3D0, + data=3Dstr_input) + auth_str =3D hash_out.encode("hex").lower() + + vector["input"] =3D '0001020304050607' + vector["input"] + '40' + return auth_str + + def __gen_snow3g_hash(self, vector): + auth_str =3D "" + auth_algo =3D vector['auth_algo'] + mBitlen =3D 8 * (len(vector['input']) / 2) + bin_input =3D bytearray.fromhex(vector["input"]) + str_input =3D str(bin_input) + bin_key =3D binascii.a2b_hex(vector["auth_key"]) + vector["aad"] =3D "00000000000000000000000000000000" + + hash_out =3D cm.UIA2(key=3Dbin_key, count=3D0, fresh=3D0, dir=3D0, + data=3Dstr_input) + + auth_str =3D hash_out.encode("hex").lower() + + return auth_str + + def __gen_zuc_hash(self, vector): + auth_str =3D "" + auth_algo =3D vector['auth_algo'] + mBitlen =3D 8 * (len(vector['input']) / 2) + bin_input =3D bytearray.fromhex(vector["input"]) + str_input =3D str(bin_input) + bin_key =3D binascii.a2b_hex(vector["auth_key"]) + + vector["aad"] =3D "00000000000000000000000000000000" + + hash_out =3D cm.EIA3(key=3Dbin_key, count=3D0, bearer=3D0, dir=3D0= , data=3Dstr_input, bitlen=3DmBitlen) + auth_str =3D hash_out.encode("hex").lower() + + return auth_str + + def __gen_null_hash(self, vector): + auth_str =3D "" + if (vector['chain'] =3D=3D "HASH_ONLY") or (vector['chain'] =3D=3D= "HASH_CIPHER"): + auth_str =3D vector['input'] + elif (vector['chain'] =3D=3D "CIPHER_HASH"): + auth_str =3D vector['output_cipher'] + return auth_str + + def __gen_hash_output(self, vector): + if vector["chain"] =3D=3D "CIPHER_ONLY": + vector["output_hash"] =3D=3D "" + return + + if vector["output_hash"] !=3D "*": + return + + if vector["chain"] =3D=3D "HASH_ONLY": + vector["output_cipher"] =3D "" + + hash_str =3D "" + + if vector["chain"] =3D=3D "CIPHER_HASH": + input_str =3D vector["output_cipher"] + else: + input_str =3D vector["input"] + + auth_algo =3D vector["auth_algo"] + if auth_algo =3D=3D "md5-hmac": + hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), + binascii.a2b_hex(input_str), hashlib.md5).hexdigest() + elif auth_algo =3D=3D "sha1-hmac": + hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), + binascii.a2b_hex(input_str), hashlib.sha1).hexdigest() + elif auth_algo =3D=3D "sha2-224-hmac": + hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), + binascii.a2b_hex(input_str), hashlib.sha224).hexdigest= () + elif auth_algo =3D=3D "sha2-256-hmac": + hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), + binascii.a2b_hex(input_str), hashlib.sha256).hexdigest= () + elif auth_algo =3D=3D "sha2-384-hmac": + hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), + binascii.a2b_hex(input_str), hashlib.sha384).hexdigest= () + elif auth_algo =3D=3D "sha2-512-hmac": + hash_str =3D hmac.new(binascii.a2b_hex(vector["auth_key"]), + binascii.a2b_hex(input_str), hashlib.sha512).hexdigest= () + elif auth_algo =3D=3D "aes-xcbc-mac": + pass + elif auth_algo =3D=3D "aes-gcm": + key =3D binascii.a2b_hex(vector["cipher_key"]) + iv =3D binascii.a2b_hex(vector["iv"]) + aesgcm =3D AESGCM(key) + hash_str =3D aesgcm.encrypt(iv, + binascii.a2b_hex(vector["input"]), + binascii.a2b_hex(vector["aad"])) + hash_str =3D hash_str[-16:] + hash_str =3D binascii.b2a_hex(hash_str) + elif auth_algo =3D=3D "aes-ccm": + key =3D binascii.a2b_hex(vector["cipher_key"]) + iv =3D binascii.a2b_hex(vector["iv"]) + aesccm =3D AESCCM(key) + hash_str =3D aesccm.encrypt(iv, + binascii.a2b_hex(vector["input"]), + binascii.a2b_hex(vector["aad"])) + hash_str =3D hash_str[-16:] + hash_str =3D binascii.b2a_hex(hash_str) + elif auth_algo =3D=3D "aes-gmac": + pass + elif auth_algo =3D=3D "snow3g-uia2": + hash_str =3D self.__gen_snow3g_hash(vector) + elif auth_algo =3D=3D "zuc-eia3": + hash_str =3D self.__gen_zuc_hash(vector) + elif auth_algo =3D=3D "kasumi-f9": + hash_str =3D self.__gen_kasumi_hash(vector) + elif auth_algo =3D=3D "null": + hash_str =3D self.__gen_null_hash(vector) + elif auth_algo =3D=3D "md5": + hash_str =3D hashlib.md5(binascii.a2b_hex(vector["auth_key"])= ).hexdigest() + elif auth_algo =3D=3D "sha1": + hash_str =3D hashlib.sha1(binascii.a2b_hex(vector["auth_key"])= ).hexdigest() + elif auth_algo =3D=3D "sha2-224": + hash_str =3D hashlib.sha224(binascii.a2b_hex(vector["auth_key"= ])).hexdigest() + elif auth_algo =3D=3D "sha2-256": + hash_str =3D hashlib.sha256(binascii.a2b_hex(vector["auth_key"= ])).hexdigest() + elif auth_algo =3D=3D "sha2-384": + hash_str =3D hashlib.sha384(binascii.a2b_hex(vector["auth_key"= ])).hexdigest() + elif auth_algo =3D=3D "sha2-512": + hash_str =3D hashlib.sha512(binascii.a2b_hex(vector["auth_key"= ])).hexdigest() + else: + pass + vector["output_hash"] =3D hash_str.lower() + self.__actually_pmd_hash(vector) + + def __gen_output(self, vector, cmds, core_mask=3D"", port_mask=3D""): + if core_mask !=3D "-1": + self.__gen_cipher_output(vector) + self.__gen_hash_output(vector) + cmds.append(vector) + + def __var2list(self, var): + var_list =3D var if isinstance(var, list) else [var] + return var_list + + def __is_valid_op(self, chain, op): + chain_op_map =3D { + "AEAD": ["ENCRYPT", "GENERATE"], + "CIPHER_ONLY": ["ENCRYPT", "DECRYPT"], + "HASH_ONLY": ["GENERATE", "VERIFY"], + "CIPHER_HASH": ["ENCRYPT", "GENERATE"], + "HASH_CIPHER": ["DECRYPT", "VERIFY"], + } + if op in chain_op_map[chain]: + return True + return False + + def __is_valid_size(self, key_type, algo, size): + algo_size_map =3D { + "aes-cbc": { + "cipher_key": [16, 24, 32], + "iv": [16], + }, + "aes-ctr": { + "cipher_key": [16, 24, 32], + "iv": [12, 16] + }, + "3des-cbc": { + "cipher_key": [8, 16, 24], + "iv": [8] + }, + "3des-ctr": { + "cipher_key": [16, 24], + "iv": [8] + }, + "aes-gcm": { + "cipher_key": [16, 24, 32], + "auth_key": [16, 24, 32], + "aad": [0, 1, 2, 3, 4, 5, 6, 8, 9, 12, 16, 24, 32, 64,= 128, 155, 256, 1024, 65535], + "iv": [12, 16], + "digest_size": [8,12,16] + }, + "aes-ccm": { + "cipher_key": [16, 24, 32], + "auth_key": [16, 24, 32], + "aad": [0, 1, 2, 3, 4, 5, 6, 8, 9, 12, 16, 24, 32, 64,= 128, 155, 256, 1024, 65535], + "iv": [7, 8, 9, 10, 11, 12, 13], + "digest_size": [4, 6, 8, 10, 12, 14, 16] + }, + "aes-docsisbpi": { + "cipher_key": [16], + "iv": [16], + }, + "des-docsisbpi": { + "cipher_key": [8], + "iv": [8], + }, + "des-cbc": { + "cipher_key": [8], + "iv": [8], + }, + "snow3g-uea2": { + "cipher_key": [16], + "iv": [16] + }, + "kasumi-f8": { + "cipher_key": [16], + "iv": [8] + }, + "zuc-eea3": { + "cipher_key": [16], + "iv": [16] + }, + "null": { + "cipher_key": [0], + "auth_key": [0], + "aad": [0], + "iv": [0] + }, + "md5-hmac": { + "auth_key": [64], + "aad": [0], + "digest_size": [12, 16] + }, + "sha1-hmac": { + "auth_key": [64], + "aad": [0], + "digest_size": [12, 20] + }, + "sha2-224-hmac": { + "auth_key": [64], + "aad": [0], + "digest_size": [14, 28] + }, + "sha2-256-hmac": { + "auth_key": [64], + "aad": [0], + "digest_size": [16, 32] + }, + "sha2-384-hmac": { + "auth_key": [128], + "aad": [0], + "digest_size": [24, 48] + }, + "sha2-512-hmac": { + "auth_key": [128], + "aad": [0], + "digest_size": [32, 64] + }, + "aes-xcbc-mac": { + "auth_key": [16], + "aad": [0], + "digest_size": [12, 16] + }, + "aes-gmac": { + "auth_key": [16, 24, 32], + "aad": [1, 12, 16, 64, 128, 256, 65535], + "digest_size": [8, 12, 16] + }, + "snow3g-uia2": { + "auth_key": [16], + "aad": [16], + "digest_size": [4] + }, + "kasumi-f9": { + "auth_key": [16], + "aad": [8], + "digest_size": [4] + }, + "zuc-eia3": { + "auth_key": [16], + "aad": [16], + "digest_size": [4] + }, + "md5": { + "auth_key": [0], + "aad": [0], + "digest_size": [16] + }, + "sha1": { + "auth_key": [0], + "aad": [0], + "digest_size": [20] + }, + "sha2-224": { + "auth_key": [0], + "aad": [0], + "digest_size": [28] + }, + "sha2-256": { + "auth_key": [0], + "aad": [0], + "digest_size": [32] + }, + "sha2-384": { + "auth_key": [0], + "aad": [0], + "digest_size": [48] + }, + "sha2-512": { + "auth_key": [0], + "aad": [0], + "digest_size": [64] + }, + } + result =3D False + if algo in algo_size_map: + if key_type in algo_size_map[algo]: + if size in algo_size_map[algo][key_type]: + result =3D True + return result + + def __actually_pmd_hash(self, vector): + auth_algo_dgst_map =3D [ + "md5-hmac", + "sha1-hmac", + "sha2-224-hmac", + "sha2-256-hmac", + "sha2-384-hmac", + "sha2-512-hmac", + "aes-xcbc-mac" + ] + if vector["auth_algo"] in auth_algo_dgst_map: + digest =3D vector["digest_size"] + if digest >=3D (len(vector["output_hash"]) / 2): + vector["output_hash"] =3D vector["output_hash"] + else: + vector["output_hash"] =3D (vector["output_hash"])[0:2*dige= st] + + def __iter_cipher_algo(self, vector, vector_list, core_mask=3D"", port= _mask=3D""): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "HASH_ONLY": + test_vector["cipher_algo"] =3D "" + self.__iter_cipher_op(test_vector, vector_list, core_mask, por= t_mask) + else: + cipher_algo_list =3D self.__var2list(test_vector["cipher_algo"= ]) + for cipher_algo in cipher_algo_list: + test_vector =3D vector.copy() + test_vector["cipher_algo"] =3D cipher_algo + self.__iter_cipher_op(test_vector, vector_list, core_mask,= port_mask) + + def __iter_cipher_op(self, vector, vector_list, core_mask=3D"", port_m= ask=3D""): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "HASH_ONLY": + test_vector["cipher_op"] =3D "" + self.__iter_cipher_key(test_vector, vector_list, core_mask, po= rt_mask) + else: + cipher_op_list =3D self.__var2list(test_vector["cipher_op"]) + for cipher_op in cipher_op_list: + if self.__is_valid_op(test_vector["chain"], cipher_op): + test_vector =3D vector.copy() + test_vector["cipher_op"] =3D cipher_op + self.__iter_cipher_key(test_vector, vector_list, + core_mask, port_mask) + + def __iter_cipher_key(self, vector, vector_list, core_mask=3D"", port_= mask=3D""): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "HASH_ONLY": + test_vector["cipher_key"] =3D "" + self.__iter_iv(test_vector, vector_list, core_mask, port_mask) + else: + cipher_key_list =3D self.__var2list(test_vector["cipher_key"]) + for cipher_key in cipher_key_list: + test_vector =3D vector.copy() + if isinstance(cipher_key, int): + if self.__is_valid_size("cipher_key", + test_vector["cipher_algo"], + cipher_key): + test_vector["cipher_key"] =3D self.__gen_key(ciphe= r_key) + self.__iter_iv(test_vector, vector_list, core_mask= , port_mask) + else: + continue + else: + test_vector["cipher_key"] =3D cipher_key + self.__iter_iv(test_vector, vector_list, core_mask, po= rt_mask) + + def __iter_iv(self, vector, vector_list, core_mask=3D"", port_mask=3D"= "): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "HASH_ONLY": + test_vector["iv"] =3D "" + self.__iter_auth_algo(test_vector, vector_list, core_mask, por= t_mask) + else: + iv_list =3D self.__var2list(test_vector["iv"]) + for iv in iv_list: + test_vector =3D vector.copy() + if isinstance(iv, int): + if self.__is_valid_size("iv", + test_vector["cipher_algo"], + iv): + test_vector["iv"] =3D self.__gen_key(iv) + self.__iter_auth_algo(test_vector, vector_list, + core_mask, port_mask) + else: + continue + else: + test_vector["iv"] =3D iv + self.__iter_auth_algo(test_vector, vector_list, + core_mask, port_mask) + + def __iter_auth_algo(self, vector, vector_list, core_mask=3D"", port_m= ask=3D""): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "CIPHER_ONLY": + test_vector["auth_algo"] =3D "" + self.__iter_auth_op(test_vector, vector_list, core_mask, port_= mask) + else: + auth_algo_list =3D self.__var2list(test_vector["auth_algo"]) + for auth_algo in auth_algo_list: + test_vector =3D vector.copy() + test_vector["auth_algo"] =3D auth_algo + self.__iter_auth_op(test_vector, vector_list, core_mask, p= ort_mask) + + def __iter_auth_op(self, vector, vector_list, core_mask=3D"", port_mas= k=3D""): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "CIPHER_ONLY": + test_vector["auth_op"] =3D "" + self.__iter_auth_key(test_vector, vector_list, core_mask, port= _mask) + else: + auth_op_list =3D self.__var2list(test_vector["auth_op"]) + for auth_op in auth_op_list: + if self.__is_valid_op(test_vector["chain"], auth_op): + test_vector =3D vector.copy() + test_vector["auth_op"] =3D auth_op + self.__iter_auth_key(test_vector, vector_list, + core_mask, port_mask) + + def __iter_auth_key(self, vector, vector_list, core_mask=3D"", port_ma= sk=3D""): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "CIPHER_ONLY": + test_vector["auth_key"] =3D "" + self.__iter_aad(test_vector, vector_list, core_mask, port_mask= ) + else: + auth_key_list =3D self.__var2list(test_vector["auth_key"]) + for auth_key in auth_key_list: + test_vector =3D vector.copy() + if isinstance(auth_key, int): + if self.__is_valid_size("auth_key", + test_vector["auth_algo"], + auth_key): + test_vector["auth_key"] =3D self.__gen_key(auth_ke= y) + self.__iter_aad(test_vector, vector_list, core_mas= k, port_mask) + else: + continue + else: + test_vector["auth_key"] =3D auth_key + self.__iter_aad(test_vector, vector_list, core_mask, p= ort_mask) + + def __iter_aad(self, vector, vector_list, core_mask=3D"", port_mask=3D= ""): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "CIPHER_ONLY": + test_vector["aad"] =3D "" + self.__digest_size(test_vector, vector_list, core_mask, port_m= ask) + else: + aad_list =3D self.__var2list(test_vector["aad"]) + for aad in aad_list: + test_vector =3D vector.copy() + if isinstance(aad, int): + if self.__is_valid_size("aad", + test_vector["auth_algo"], + aad): + test_vector["aad"] =3D self.__gen_key(aad) + self.__digest_size(test_vector, vector_list, + core_mask, port_mask) + else: + continue + else: + test_vector["aad"] =3D aad + self.__digest_size(test_vector, vector_list, + core_mask, port_mask) + + def __digest_size(self, vector, vector_list, core_mask =3D "", port_ma= sk =3D ""): + test_vector =3D vector.copy() + if test_vector["chain"] =3D=3D "CIPHER_ONLY": + test_vector["digest_size"] =3D "" + self.__iter_input(test_vector, vector_list, core_mask, port_ma= sk) + else: + digest_list =3D self.__var2list(test_vector["digest_size"]) + for digest in digest_list: + test_vector =3D vector.copy() + if isinstance(digest, int): + if self.__is_valid_size("digest_size", + test_vector["auth_algo"], + digest): + test_vector["digest_size"] =3D digest + self.__iter_input(test_vector, vector_list, + core_mask, port_mask) + else: + continue + else: + test_vector["digest_size"] =3D digest + self.__iter_input(test_vector, vector_list, + core_mask, port_mask) + + def __iter_input(self, vector, vector_list, core_mask=3D"", port_mask= =3D""): + input_list =3D self.__var2list(vector["input"]) + for input_data in input_list: + test_vector =3D vector.copy() + if isinstance(input_data, int): + test_vector["input"] =3D self.__gen_input(input_data) + else: + test_vector["input"] =3D input_data + + self.__gen_output(test_vector, vector_list, core_mask, port_ma= sk) + + def __test_vector_to_vector_list(self, test_vector, core_mask=3D"", po= rt_mask=3D""): + vector_list =3D [] + + chain_list =3D self.__var2list(test_vector["chain"]) + + for chain in chain_list: + test_vector["chain"] =3D chain + self.__iter_cipher_algo(test_vector, vector_list, core_mask, p= ort_mask) + return vector_list + + +test_vectors =3D { + "qat_AES_CBC_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["aes-cbc"], + "cipher_op": ["ENCRYPT", "DECRYPT"], + "cipher_key": [16, 24, 32], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_AES_CTR_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["aes-ctr"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_AES_GCM_00": { + "vdev": "", + "chain": ["AEAD"], + "cdev_type": "HW", + "cipher_algo": ["aes-gcm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [12], + "auth_algo": ["aes-gcm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_AES_CCM_00": { + "vdev": "", + "chain": ["AEAD"], + "cdev_type": "HW", + "cipher_algo": ["aes-ccm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [7, 8, 9, 10, 11, 12, 13], + "auth_algo": ["aes-ccm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [8], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_h_MD_SHA_00": { + "vdev": "", + "chain": ["HASH_ONLY"], + "cdev_type": "HW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256= -hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 16, 20, 28, 48, 64], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_h_AES_XCBC_MAC_01": { + "vdev": "", + "chain": "HASH_ONLY", + "cdev_type": "HW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["aes-xcbc-mac"], + "auth_op": "GENERATE", + "auth_key": [16], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_DES_CBC_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["des-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [8], + "iv": [8], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_3DES_CBC_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["3des-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [8, 16, 24], + "iv": [8], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_3DES_CTR_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["3des-ctr"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [24], + "iv": [8], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "470c43ce135176ff34300c11b8a5dc463be774851c405eb6= 7a3c54e\ +30707b6ac47b1dca58d5a2dab1dee452f7712f1803709d100608f8df9786156e4656ff60cb= 6a2f722\ +e6a96932fa0dbba8c4941e61b8ca2b5903bc724d5f68856b9e6f66d7b4e42cc49b44bb85b7= ce2f1c5\ +21e1a2719a47097922e0b627bbee2918ac5c5caf84d9e62d772fc676d3bce0bb17b95cb5e1= 477da05\ +1aebbdbbf2a7037237a3537c738aadbfff3d3f2b3be5ddbcc7213e265705224961adf48f8d= f3ba8a8\ +fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f= 830b16a\ +7a452e75e15894bf869fc585090c8c4bfbdb9f2a6246f4308300", + "output_hash": "*" + }, + + "qat_c_UEA2_01": { + "vdev": "", + "chain": ["CIPHER_ONLY"], + "cdev_type": "HW", + "cipher_algo": ["snow3g-uea2"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["snow3g-uia2"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": "", + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_h_UIA2_01": { + "vdev": "", + "chain": ["HASH_ONLY"], + "cdev_type": "HW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["snow3g-uia2"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [4], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_kasumi_c_F8_01": { + "vdev": "", + "chain": ["CIPHER_ONLY"], + "cdev_type": "HW", + "cipher_algo": ["kasumi-f8"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [8], + "auth_algo": ["kasumi-f9"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [8], + "aad_random_size": "", + "input": [256], + "digest_size": "", + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_kasumi_h_F9_01": { + "vdev": "", + "chain": ["HASH_ONLY"], + "cdev_type": "HW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["kasumi-f9"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": "", + "aad_random_size": "", + "input": [256], + "digest_size": [4], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_c_EEA3_01": { + "vdev": "", + "chain": ["CIPHER_ONLY"], + "cdev_type": "HW", + "cipher_algo": ["zuc-eea3"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["zuc-eia3"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": "", + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_h_EIA3_01": { + "vdev": "", + "chain": ["HASH_ONLY"], + "cdev_type": "HW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["zuc-eia3"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [4], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_NULL_auto": { + "vdev": "", + "chain": ["CIPHER_ONLY", "HASH_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["null"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [0], + "iv": "", + "auth_algo": ["null"], + "auth_op": "", + "auth_key": [0], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "digest": "", + "input": [256], + "digest_size": "", + "output_cipher": "*", + "output_hash": "*" + }, + + "aesni_mb_AES_CBC_00": { + "vdev": "crypto_aesni_mb", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["aes-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 14, 16, 24, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "aesni_mb_AES_CTR_00": { + "vdev": "crypto_aesni_mb", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["aes-ctr"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 14, 16, 24, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "aesni_mb_hash_00": { + "vdev": "crypto_aesni_mb", + "chain": ["HASH_ONLY"], + "cdev_type": "SW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 14, 16, 24, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "aesni_mb_AES_CCM_00": { + "vdev": "crypto_aesni_mb", + "chain": ["AEAD"], + "cdev_type": "SW", + "cipher_algo": ["aes-ccm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [7, 8, 9, 10 ,11, 12, 13], + "auth_algo": ["aes-ccm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [8], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "aesni_mb_3DES_CBC_00": { + "vdev": "crypto_aesni_mb", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["3des-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [8, 16, 24], + "iv": [8], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [0, 64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 14, 16, 24, 32], + "output_cipher": "*", + "output_hash": "*" + }, + "aesni_mb_h_MD_SHA_00": { + "vdev": "crypto_aesni_mb_pmd", + "chain": ["HASH_ONLY"], + "cdev_type": "SW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [0, 64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 16, 20, 28, 48, 64], + "output_cipher": "*", + "output_hash": "*" + }, + + "null_NULL_auto": { + "vdev": "crypto_null_pmd", + "chain": ["CIPHER_ONLY", "HASH_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["null"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [0], + "iv": [0], + "auth_algo": ["null"], + "auth_op": ["GENERATE"], + "auth_key": [0], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "digest": "", + "input": [256], + "digest_size": "", + "output_cipher": "*", + "output_hash": "*" + }, + + "aesni_gcm_aead_AES_GCM_01": { + "vdev": "crypto_aesni_gcm_pmd", + "chain": ["AEAD"], + "cdev_type": "SW", + "cipher_algo": ["aes-gcm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [12], + "auth_algo": ["aes-gcm", "aes-gmac"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "aesni_gcm_aead_AES_CCM_01": { + "vdev": "crypto_aesni_gcm_pmd", + "chain": ["AEAD"], + "cdev_type": "SW", + "cipher_algo": ["aes-ccm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [12], + "auth_algo": ["aes-ccm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "kasumi_c_F8_01": { + "vdev": "crypto_kasumi_pmd", + "chain": ["CIPHER_ONLY"], + "cdev_type": "SW", + "cipher_algo": ["kasumi-f8"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [8], + "auth_algo": ["kasumi-f9"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [8], + "aad_random_size": "", + "input": [256], + "digest_size": "", + "output_cipher": "*", + "output_hash": "*" + }, + + "kasumi_h_F9_01": { + "vdev": "crypto_kasumi_pmd", + "chain": ["HASH_ONLY"], + "cdev_type": "SW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["kasumi-f9"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": "", + "aad_random_size": "", + "input": [256], + "digest_size": [4], + "output_cipher": "*", + "output_hash": "*" + }, + + "snow3g_c_UEA2_01": { + "vdev": "crypto_snow3g_pmd", + "chain": ["CIPHER_ONLY"], + "cdev_type": "SW", + "cipher_algo": ["snow3g-uea2"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["snow3g-uia2"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": "", + "output_cipher": "*", + "output_hash": "*" + }, + + "snow3g_h_UIA2_01": { + "vdev": "crypto_snow3g_pmd", + "chain": ["HASH_ONLY"], + "cdev_type": "SW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["snow3g-uia2"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [4], + "output_cipher": "*", + "output_hash": "*" + }, + + "zuc_c_EEA3_01": { + "vdev": "crypto_zuc_pmd", + "chain": ["CIPHER_ONLY"], + "cdev_type": "SW", + "cipher_algo": ["zuc-eea3"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["zuc-eia3"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": "", + "output_cipher": "*", + "output_hash": "*" + }, + + "zuc_h_EIA3_01": { + "vdev": "crypto_zuc_pmd", + "chain": ["HASH_ONLY"], + "cdev_type": "SW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["zuc-eia3"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [4], + "output_cipher": "*", + "output_hash": "*" + }, + + "openssl_3DES_CBC_00": { + "vdev": "crypto_openssl_pmd", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["3des-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [8, 16, 24], + "iv": [8], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [0, 64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "*", + "output_hash": "*" + }, + + "openssl_3DES_CTR_00": { + "vdev": "crypto_openssl_pmd", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["3des-ctr"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [24], + "iv": [8], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [0, 64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "470c43ce135176ff34300c11b8a5dc463be774851c405eb6= 7a3c54e\ +30707b6ac47b1dca58d5a2dab1dee452f7712f1803709d100608f8df9786156e4656ff60cb= 6a2f722\ +e6a96932fa0dbba8c4941e61b8ca2b5903bc724d5f68856b9e6f66d7b4e42cc49b44bb85b7= ce2f1c5\ +21e1a2719a47097922e0b627bbee2918ac5c5caf84d9e62d772fc676d3bce0bb17b95cb5e1= 477da05\ +1aebbdbbf2a7037237a3537c738aadbfff3d3f2b3be5ddbcc7213e265705224961adf48f8d= f3ba8a8\ +fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f= 830b16a\ +7a452e75e15894bf869fc585090c8c4bfbdb9f2a6246f4308300", + "output_hash": "*" + }, + + "openssl_AES_CBC_00": { + "vdev": "crypto_openssl_pmd", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["aes-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "*", + "output_hash": "*" + }, + + "openssl_AES_CTR_00": { + "vdev": "crypto_openssl_pmd", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["aes-ctr"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 28, 32, 48], + "output_cipher": "*", + "output_hash": "*" + }, + + "openssl_AES_GCM_00": { + "vdev": "crypto_openssl_pmd", + "chain": ["AEAD"], + "cdev_type": "SW", + "cipher_algo": ["aes-gcm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [12], + "auth_algo": ["aes-gcm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "openssl_AES_CCM_00": { + "vdev": "crypto_openssl_pmd", + "chain": ["AEAD"], + "cdev_type": "SW", + "cipher_algo": ["aes-ccm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [12], + "auth_algo": ["aes-ccm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "openssl_h_MD_SHA_00": { + "vdev": "crypto_openssl_pmd", + "chain": ["HASH_ONLY"], + "cdev_type": "SW", + "cipher_algo": "", + "cipher_op": "", + "cipher_key": "", + "iv": "", + "auth_algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-256-= hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [0, 64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 16, 20, 28, 48, 64], + "output_cipher": "*", + "output_hash": "*" + }, + + "qat_AES_DOCSISBPI_01": { + "vdev": "", + "chain": ["CIPHER_ONLY"], + "cdev_type": "HW", + "cipher_algo": "aes-docsisbpi", + "cipher_op": ["ENCRYPT"], + "cipher_key": "e6600fd8852ef5abe6600fd8852ef5ab", + "iv": "810e528e1c5fda1a810e528e1c5fda1a", + "auth_algo": "", + "auth_op": "", + "auth_key": "", + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": "000102030405060708090a0b0c0d0e91d2d19f", + "digest_size": "", + "output_cipher": "9dd1674bba61101b56756474364f101d44d473", + "output_hash": "*" + }, + + "qat_DES_DOCSISBPI_01": { + "vdev": "", + "chain": ["CIPHER_ONLY"], + "cdev_type": "HW", + "cipher_algo": "des-docsisbpi", + "cipher_op": ["ENCRYPT"], + "cipher_key": "e6600fd8852ef5ab", + "iv": "810e528e1c5fda1a", + "auth_algo": "", + "auth_op": "", + "auth_key": "", + "auth_key_random_size": "", + "aad": "", + "aad_random_size": "", + "input": "000102030405060708090a0b0c0d0e910001020304050607d2d19f", + "digest_size": "", + "output_cipher": "0dda5acbd05e5567514746868a71e577bdb2125f9f72be23= 0e9fb2", + "output_hash": "*" + }, + + "aesni_mb_AES_DOCSISBPI_01": { + "vdev": "crypto_aesni_mb", + "chain": ["CIPHER_ONLY"], + "cdev_type": "SW", + "cipher_algo": "aes-docsisbpi", + "cipher_op": ["ENCRYPT"], + "cipher_key": "e6600fd8852ef5abe6600fd8852ef5ab", + "iv": "810e528e1c5fda1a810e528e1c5fda1a", + "auth_algo": "", + "auth_op": "", + "auth_key": "", + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": "000102030405060708090a0b0c0d0e91d2d19f", + "digest_size": "", + "output_cipher": "9dd1674bba61101b56756474364f101d44d473", + "output_hash": "*" + }, + + "openssl_DES_DOCSISBPI_01": { + "vdev": "crypto_openssl_pmd", + "chain": ["CIPHER_ONLY"], + "cdev_type": "SW", + "cipher_algo": "des-docsisbpi", + "cipher_op": ["ENCRYPT"], + "cipher_key": "e6600fd8852ef5ab", + "iv": "810e528e1c5fda1a", + "auth_algo": "", + "auth_op": "", + "auth_key": "", + "auth_key_random_size": "", + "aad": "", + "aad_random_size": "", + "input": "000102030405060708090a0b0c0d0e910001020304050607d2d19f", + "digest_size": "", + "output_cipher": "0dda5acbd05e5567514746868a71e577bdb2125f9f72be23= 0e9fb2", + "output_hash": "*" + }, + + "aesni_mb_DES_DOCSISBPI_01": { + "vdev": "crypto_aesni_mb", + "chain": ["CIPHER_ONLY"], + "cdev_type": "SW", + "cipher_algo": "des-docsisbpi", + "cipher_op": ["ENCRYPT"], + "cipher_key": "e6600fd8852ef5ab", + "iv": "810e528e1c5fda1a", + "auth_algo": "", + "auth_op": "", + "auth_key": "", + "auth_key_random_size": "", + "aad": "", + "aad_random_size": "", + "input": "000102030405060708090a0b0c0d0e910001020304050607d2d19f", + "digest_size": "", + "output_cipher": "0dda5acbd05e5567514746868a71e577bdb2125f9f72be23= 0e9fb2", + "output_hash": "*" + }, + + "aesni_mb_DES_CBC_00": { + "vdev": "crypto_aesni_mb", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["des-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [8], + "iv": [8], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 14, 16, 24, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "openssl_DES_CBC_00": { + "vdev": "crypto_openssl_pmd", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "SW", + "cipher_algo": ["des-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [8], + "iv": [8], + "auth_algo": ["sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", + "sha2-384-hmac", "sha2-512-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64, 128], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [12, 14, 16, 24, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "scheduler_rr_AES_CBC_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["aes-cbc"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-256-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "scheduler_rr_AES_GCM_00": { + "vdev": "", + "chain": ["AEAD"], + "cdev_type": "HW", + "cipher_algo": ["aes-gcm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [12], + "auth_algo": ["aes-gcm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "scheduler_psb_AES_CBC_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["aes-cbc"], + "cipher_op": ["ENCRYPT", "DECRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-256-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "scheduler_psb_AES_GCM_00": { + "vdev": "", + "chain": ["AEAD"], + "cdev_type": "HW", + "cipher_algo": ["aes-gcm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [12], + "auth_algo": ["aes-gcm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "scheduler_fo_AES_CBC_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["aes-cbc"], + "cipher_op": ["ENCRYPT", "DECRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-256-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "scheduler_fo_AES_GCM_00": { + "vdev": "", + "chain": ["AEAD"], + "cdev_type": "HW", + "cipher_algo": ["aes-gcm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [12], + "auth_algo": ["aes-gcm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, + + "scheduler_mm_AES_CBC_00": { + "vdev": "", + "chain": ["CIPHER_ONLY", "CIPHER_HASH"], + "cdev_type": "HW", + "cipher_algo": ["aes-cbc"], + "cipher_op": ["ENCRYPT", "DECRYPT"], + "cipher_key": [16], + "iv": [16], + "auth_algo": ["sha1-hmac", "sha2-256-hmac"], + "auth_op": ["GENERATE"], + "auth_key": [64], + "auth_key_random_size": "", + "aad": [0], + "aad_random_size": "", + "input": [256], + "digest_size": [20, 32], + "output_cipher": "*", + "output_hash": "*" + }, + + "scheduler_mm_AES_GCM_00": { + "vdev": "", + "chain": ["AEAD"], + "cdev_type": "HW", + "cipher_algo": ["aes-gcm"], + "cipher_op": ["ENCRYPT"], + "cipher_key": [16, 24, 32], + "iv": [12], + "auth_algo": ["aes-gcm"], + "auth_op": ["GENERATE"], + "auth_key": [16], + "auth_key_random_size": "", + "aad": [16], + "aad_random_size": "", + "input": [256], + "digest_size": [16], + "output_cipher": "*", + "output_hash": "*" + }, +} --=20 2.7.4