From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4809DA0A0A; Tue, 23 Mar 2021 20:47:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AB114014F; Tue, 23 Mar 2021 20:47:35 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id D47BE4014D for ; Tue, 23 Mar 2021 20:47:33 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12NJjolr017512; Tue, 23 Mar 2021 12:47:32 -0700 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by mx0a-0016f401.pphosted.com with ESMTP id 37dedrjehu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Mar 2021 12:47:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DaTiWqjCpnvCrXWSPjO38HfT5fKoxxD3GSoQ2gX6JBdKQgE2dKAYacC6wdH8XxzxQmM6srdwT2p0UWoSbbj2aNDmGzGFHAJPZeL1GxbEyjuJ7hapdl8u1G/B9gY13lV+b0TXxRXjhWZ3Lh1NS/T+/0krq3ZYk3gVUcaICdToIBQJQUqiJPL6FEitKE46KFu9mBMja5bLMHk1BXWWQqop5eKAs4BubP1aoO3SvAj8zfNvN2IZejtJm8ZWxRMibNyINltIHaDJq2cM5iPP4o4Z6nxqqX1cPIFtdoUARHshGSX6OxW+rBRrYFu9xY7TGLOO816Mqt3uxIulCr73TEzU6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bysmOpR79QToi/DT4KIz0g7JpBIB5VTNKk4rHIeb9pM=; b=bV9vJBAzz6kxs+1ZNdl5X0Pi91JFWXIrgBCb0goKHThZQ78ILzir/bQaLvjIzg7R4CDTX3Rl4260ZB+5YeD4H19fQhz6Pi2DcqpCPlSf/BkOTUClKu9VLR/XzRpCBFq7qQTkom1UxAXGK/M9fljUKv8QoLYTTsHfFXY6JAfRCb6GFGym3ExubLJErOTV/iWsvwcExPiybHtRPAspgXTeDv8mqTDRQJdYrTAGDkdTFIljyHsx6aoCOSl4Qpfr4yaouoyHVMJqftfq0pYu1MKJMjpRMNmJr5a5HRYLVgtWLBIbDFXfXGykrR0c+23RTUaRT86d5r6RiPLFbWni0jiNuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bysmOpR79QToi/DT4KIz0g7JpBIB5VTNKk4rHIeb9pM=; b=F3DNcbRkcWNNOkIFMbB5yF7Kj7663p0M0lcXMxl8CbAAbiHGNQsF/2pZCfgBt3lGiWC7R6ZvuF20/twLjiu+Aoj72AkhgNzy+l/8a1RNgIelOoy19g9+hGSWCfCoasqEch2N72Zz46vkYSMjSDiwRhP9dioi6ojF5P7GrCwK+MU= Received: from MW2PR18MB2284.namprd18.prod.outlook.com (2603:10b6:907:10::16) by CO6PR18MB3972.namprd18.prod.outlook.com (2603:10b6:5:340::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Tue, 23 Mar 2021 19:47:31 +0000 Received: from MW2PR18MB2284.namprd18.prod.outlook.com ([fe80::b40a:1145:2f52:123a]) by MW2PR18MB2284.namprd18.prod.outlook.com ([fe80::b40a:1145:2f52:123a%7]) with mapi id 15.20.3955.027; Tue, 23 Mar 2021 19:47:31 +0000 From: Akhil Goyal To: Tejasree Kondoj , Radu Nicolau , Fiona Trahe , Fan Zhang , Arek Kusztal CC: Anoob Joseph , Ankur Dwivedi , Jerin Jacob Kollanukkaran , "dev@dpdk.org" Thread-Topic: [PATCH 2/2] test/crypto: support block cipher DIGEST_ENCRYPTED mode Thread-Index: AQHXGX5PD9xksAmX+0GfWLLA4B5Fx6qSBCvA Date: Tue, 23 Mar 2021 19:47:30 +0000 Message-ID: References: <20210315102950.30781-1-ktejasree@marvell.com> <20210315102950.30781-3-ktejasree@marvell.com> In-Reply-To: <20210315102950.30781-3-ktejasree@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.162.28.216] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 37fdab5a-fa3a-494d-9a0e-08d8ee347f0d x-ms-traffictypediagnostic: CO6PR18MB3972: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1443; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: t8fBiNXj4pXBBpB+Jvnn2CiwIZYaoRFDyX5EoPK1QkPowUwtAuJfhgdVrdE0nn288yiZ2rOZ14d6OFSSMkNhfnI7r9goE9iyfBwjUPp1Vkah85OkhxtNz1OMLoEHsRhCj3IT5PSOqSq1hQfUeS7A6CN6nZmlVkjXIeVMdiIsn2DBKyr9+CrYOZLtTZCO6odCSbYs/YnhYi+5v06JeZkLGZl7jv8hzMIatCRuS2IZaEPA4/rgP2gLDMtBA1hCj3a8bXAUxhIgV4QHTAFIob6pvOPsoghB1WNfOCDUBazCC6eaerLwsHIAqNYHniHWX6owrjyu0ioC/ov+ICK6GI6//SLndt0S82UzT1WUg/INJrOGSfRqs1sQ6/c2f9Ng0rPasq3WVWX6VH1eQVnRgWaGN4TmsqyFOaHt2fTwEAnqyJ0n69JmYEo40G5zaw/wKhhxnvNjvQ9DSldknJgT0tDwWxyExXVXku9p9VgzWvedO4GsiMR9MeA27eurhDPxefKO9NwHQhm5EHA/e3Yi5wr1QHe/DhFZyg+7MghCzxttLDrABctD0WF/8FClY8NqvKI1KEOIQCnpFZKaId+afpmhcco3YB2SVNAigcK+N6qAP8k+HkoTD1JMbEmDFtPcucVw6SR7xgfRJGe9/n8GZzktzUny80DaN/KHvYeO82G0NfE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR18MB2284.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39850400004)(376002)(366004)(396003)(346002)(478600001)(54906003)(110136005)(8676002)(316002)(9686003)(55016002)(26005)(76116006)(5660300002)(186003)(6506007)(66446008)(4326008)(7696005)(86362001)(66556008)(64756008)(66476007)(52536014)(83380400001)(2906002)(66946007)(33656002)(38100700001)(8936002)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?jWJin5hbNVV6TWpmJoSM+9Y9F3eWeQx9VfLPw3V3/t7ZWmfJMQG5JcnZTHr4?= =?us-ascii?Q?+EyW/sYI/H0Wu2EFEisvg9NRdKgdfAErNd6v46bBjUweFTKHr4aKMtZ+avon?= =?us-ascii?Q?FRsIrKKY64W9rHjngBWWoN3dtHv/j/yK/7b03Ezk4iN2JMRqLirrIloeOgmS?= =?us-ascii?Q?a3OmY4tFD8khUhe2YrPGelUydGQqNlfTvH+hq3HdVr/hXjOj4MxQicPeXJqk?= =?us-ascii?Q?x1Lbw10ASsVpD1oz3MSlhRkshv6q4T6psbYb9jkFyV0gVMb4cthnapAboueR?= =?us-ascii?Q?WsBbxdkhZoEWsuRwMHyaDdAqj4jICv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nvFvwmrRh3qjLXz0D3ceB5Yvqy95gDsQlvK0ke/StYItAFohhJA7F?= =?us-ascii?Q?wFguNR5kcchCR79InAp+O9n+TSLv9KpCd+vD1ev/4waMp1Gymq4TKen/3d6e?= =?us-ascii?Q?cPVxc7v853axTNFGCuugwI5L?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR18MB2284.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37fdab5a-fa3a-494d-9a0e-08d8ee347f0d X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Mar 2021 19:47:30.9133 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tVi876hRRUTloO1bVcgFYsgoFRJqTs4BlZS7LLwi4t2NMlNhzTMxg5kcgHgBRikq6zvejT8/SJJZ7oywfSvm3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB3972 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-23_09:2021-03-23, 2021-03-23 signatures=0 Subject: Re: [dpdk-dev] [PATCH 2/2] test/crypto: support block cipher DIGEST_ENCRYPTED mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > @@ -2565,6 +3052,108 @@ static const struct blockcipher_test_case > aes_chain_test_cases[] =3D { > .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SESSIONLESS, > }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Encryption Digest" > + "(Encrypted Digest mode)", > + .test_data =3D &aes_test_data_4_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN_ENC, > + .feature_mask =3D > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Encryption Digest " > + "Scatter Gather (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_4_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN_ENC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SG | > + > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Encryption Digest " > + "(short buffers) (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_13_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN_ENC, > + .feature_mask =3D > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Encryption Digest " > + "Scatter Gather (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_4_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN_ENC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SG | > + > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, I believe this is getting repeated with the 2nd case. > + { > + .test_descr =3D "AES-192-CBC HMAC-SHA1 Encryption Digest " > + "Sessionless (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_10_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN_ENC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SESSIONLESS > | > + > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-256-CBC HMAC-SHA1 Encryption Digest " > + "Scatter Gather Sessionless (Encrypted Digest > mode)", > + .test_data =3D &aes_test_data_11_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN_ENC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SG | > + BLOCKCIPHER_TEST_FEATURE_SESSIONLESS | > + BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Decryption Digest " > + "Verify (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_4_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DEC_AUTH_VERIFY, > + .feature_mask =3D > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Decryption Digest " > + "Verify Scatter Gather (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_4_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DEC_AUTH_VERIFY, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SG | > + > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Decryption Digest " > + "Verify (short buffers) (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_13_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DEC_AUTH_VERIFY, > + .feature_mask =3D > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Decryption Digest " > + "Verify Scatter Gather (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_4_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DEC_AUTH_VERIFY, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SG | > + > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, The above one is also duplicate. Please check. > + { > + .test_descr =3D "AES-256-CBC HMAC-SHA1 Decryption Digest " > + "Verify Sessionless (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_11_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DEC_AUTH_VERIFY, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SESSIONLESS > | > + > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-192-CBC HMAC-SHA1 Decryption Digest " > + "Verify Scatter Gather Sessionless (Encrypted Digest > mode)", > + .test_data =3D &aes_test_data_10_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DEC_AUTH_VERIFY, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SESSIONLESS > | > + BLOCKCIPHER_TEST_FEATURE_SG | > + > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > + { > + .test_descr =3D "AES-128-CBC HMAC-SHA1 Decryption Digest " > + "Verify Sessionless (Encrypted Digest mode)", > + .test_data =3D &aes_test_data_4_digest_enc, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DEC_AUTH_VERIFY, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_SESSIONLESS > | > + > BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED, > + }, > { > .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen > x8byte", > .test_data =3D &null_test_data_chain_x8_multiple, [snip] > @@ -558,18 +620,20 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > } > } >=20 > - if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_GEN) { > - uint8_t *auth_res =3D pktmbuf_mtod_offset(iobuf, > - tdata->ciphertext.len); > + /* Check digest data only in enc-then-auth_gen case */ Why? The test vector should have an encrypted digest value to check. Otherwise how can we validate that the authentication SHA and encryption On that SHA is correct or not? > + if (!(t->op_mask & BLOCKCIPHER_TEST_OP_DIGEST_ENCRYPTED)) > + if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_GEN) { > + uint8_t *auth_res =3D pktmbuf_mtod_offset(iobuf, > + tdata->ciphertext.len); >=20 > - if (memcmp(auth_res, tdata->digest.data, digest_len)) { > - snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, > "line %u " > - "FAILED: %s", __LINE__, "Generated " > - "digest data not as expected"); > - status =3D TEST_FAILED; > - goto error_exit; > + if (memcmp(auth_res, tdata->digest.data, > digest_len)) { > + snprintf(test_msg, > BLOCKCIPHER_TEST_MSG_LEN, "line %u " > + "FAILED: %s", __LINE__, "Generated " > + "digest data not as expected"); > + status =3D TEST_FAILED; > + goto error_exit; > + } > } > - } >=20