From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5BC9EA055E; Wed, 26 Feb 2020 10:04:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A0D981BFB4; Wed, 26 Feb 2020 10:04:21 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DD83A1BFB1 for ; Wed, 26 Feb 2020 10:04:19 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 01:04:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,487,1574150400"; d="scan'208";a="256249353" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 26 Feb 2020 01:04:17 -0800 Received: from sivswdev08.ir.intel.com (sivswdev08.ir.intel.com [10.237.217.47]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 01Q94GMV019330; Wed, 26 Feb 2020 09:04:16 GMT Received: from sivswdev08.ir.intel.com (localhost [127.0.0.1]) by sivswdev08.ir.intel.com with ESMTP id 01Q94GC0032231; Wed, 26 Feb 2020 09:04:16 GMT Received: (from moloings@localhost) by sivswdev08.ir.intel.com with LOCAL id 01Q94GZW032227; Wed, 26 Feb 2020 09:04:16 GMT From: Mairtin o Loingsigh To: fiona.trahe@intel.com, akhil.goyal@nxp.com Cc: dev@dpdk.org, Mairtin o Loingsigh Date: Wed, 26 Feb 2020 09:04:11 +0000 Message-Id: <1582707851-32026-2-git-send-email-mairtin.oloingsigh@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1582707851-32026-1-git-send-email-mairtin.oloingsigh@intel.com> References: <1582707851-32026-1-git-send-email-mairtin.oloingsigh@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] test/crypto: Add AES-256 DOCSIS test vectors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds test vectors for AES-256 and sets QAT as the target PMD. Signed-off-by: Mairtin o Loingsigh --- app/test/test_cryptodev_aes_test_vectors.h | 176 +++++++++++++++++++++ 1 file changed, 176 insertions(+) diff --git a/app/test/test_cryptodev_aes_test_vectors.h b/app/test/test_cryptodev_aes_test_vectors.h index 8307fcf9a..08ae09390 100644 --- a/app/test/test_cryptodev_aes_test_vectors.h +++ b/app/test/test_cryptodev_aes_test_vectors.h @@ -47,6 +47,10 @@ static const uint8_t ciphertext_aes_docsis_bpi_cfb[] = { 0xFC, 0x68, 0xA3, 0x55, 0x60, 0x37, 0xDC }; +static const uint8_t ciphertext_aes256_docsis_bpi_cfb[] = { + 0xE3, 0x75, 0xF2, 0x30, 0x1F, 0x75, 0x9A +}; + static const uint8_t plaintext_aes_docsis_bpi_cbc_cfb[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x91, @@ -59,6 +63,12 @@ static const uint8_t ciphertext_aes_docsis_bpi_cbc_cfb[] = { 0x44, 0xD4, 0x73 }; +static const uint8_t ciphertext_aes256_docsis_bpi_cbc_cfb[] = { + 0xD1, 0x28, 0x73, 0x1F, 0xB5, 0x28, 0xB5, 0x18, + 0xAB, 0x51, 0xAB, 0xC8, 0x98, 0x3D, 0xD1, 0xEE, + 0xE4, 0x43, 0x59 +}; + static const uint8_t plaintext_aes192ctr[] = { 0x01, 0x0F, 0x10, 0x1F, 0x20, 0x1C, 0x0E, 0xB8, 0xFB, 0x5C, 0xCD, 0xCC, 0x1F, 0xF9, 0xAF, 0x0B, @@ -1535,6 +1545,93 @@ static const struct blockcipher_test_data aes_test_data_docsis_3 = { } }; +/* Multiple of AES 256 block size */ +static const struct blockcipher_test_data aes_test_data_docsis_4 = { + .crypto_algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI, + .cipher_key = { + .data = { + 0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2, + 0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A, + 0xD4, 0xC3, 0xA3, 0xAA, 0x33, 0x62, 0x61, 0xE0, + 0x37, 0x07, 0xB8, 0x23, 0xA2, 0xA3, 0xB5, 0x8D + }, + .len = 32 + }, + .iv = { + .data = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F + }, + .len = 16 + }, + .plaintext = { + .data = plaintext_aes_common, + .len = 512 + }, + .ciphertext = { + .data = ciphertext512_aes256cbc, + .len = 512 + } +}; + +/* Less than AES 256 block size */ +static const struct blockcipher_test_data aes_test_data_docsis_5 = { + .crypto_algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI, + .cipher_key = { + .data = { + 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, + 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, + 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, + 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB + }, + .len = 32 + }, + .iv = { + .data = { + 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A, + 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A + }, + .len = 16 + }, + .plaintext = { + .data = plaintext_aes_docsis_bpi_cfb, + .len = 7 + }, + .ciphertext = { + .data = ciphertext_aes256_docsis_bpi_cfb, + .len = 7 + } +}; + +/* Not multiple of AES 256 block size */ +static const struct blockcipher_test_data aes_test_data_docsis_6 = { + .crypto_algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI, + .cipher_key = { + .data = { + 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, + 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, + 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, + 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB + }, + .len = 32 + }, + .iv = { + .data = { + 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A, + 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A + }, + .len = 16 + }, + .plaintext = { + .data = plaintext_aes_docsis_bpi_cbc_cfb, + .len = 19 + }, + .ciphertext = { + .data = ciphertext_aes256_docsis_bpi_cbc_cfb, + .len = 19 + } +}; + static const uint8_t cipher_aescbc_offset_16[] = { 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6C, @@ -2637,5 +2734,84 @@ static const struct blockcipher_test_case aes_docsis_test_cases[] = { .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_MB }, + /* AES 256 */ + { + .test_descr = "AES-256-DOCSIS-BPI Full Block Encryption", + .test_data = &aes_test_data_docsis_4, + .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI Runt Block Encryption", + .test_data = &aes_test_data_docsis_5, + .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI Uneven Encryption", + .test_data = &aes_test_data_docsis_6, + .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI Full Block Decryption", + .test_data = &aes_test_data_docsis_4, + .op_mask = BLOCKCIPHER_TEST_OP_DECRYPT, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI Runt Block Decryption", + .test_data = &aes_test_data_docsis_5, + .op_mask = BLOCKCIPHER_TEST_OP_DECRYPT, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI Uneven Decryption", + .test_data = &aes_test_data_docsis_6, + .op_mask = BLOCKCIPHER_TEST_OP_DECRYPT, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI OOP Full Block Encryption", + .test_data = &aes_test_data_docsis_4, + .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT, + .feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI OOP Runt Block Encryption", + .test_data = &aes_test_data_docsis_5, + .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT, + .feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI OOP Uneven Block Encryption", + .test_data = &aes_test_data_docsis_6, + .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT, + .feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI OOP Full Block Decryption", + .test_data = &aes_test_data_docsis_4, + .op_mask = BLOCKCIPHER_TEST_OP_DECRYPT, + .feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI OOP Runt Block Decryption", + .test_data = &aes_test_data_docsis_5, + .op_mask = BLOCKCIPHER_TEST_OP_DECRYPT, + .feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, + { + .test_descr = "AES-256-DOCSIS-BPI OOP Uneven Block Decryption", + .test_data = &aes_test_data_docsis_6, + .op_mask = BLOCKCIPHER_TEST_OP_DECRYPT, + .feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP, + .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT + }, }; #endif /* TEST_CRYPTODEV_AES_TEST_VECTORS_H_ */ -- 2.17.1