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 22AE3A0A02; Wed, 24 Mar 2021 10:18:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0523E140D0B; Wed, 24 Mar 2021 10:18:46 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C4DDB40683 for ; Wed, 24 Mar 2021 10:18:44 +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 12O902SL027824; Wed, 24 Mar 2021 02:18:44 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2046.outbound.protection.outlook.com [104.47.56.46]) by mx0a-0016f401.pphosted.com with ESMTP id 37ft17hdqs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Mar 2021 02:18:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VAsR/Faobs+23AiM1kQ9T2gw9yiSM9MYHcLA3Tc5/PEvCUT/7FcC+G+GhyvID3rSqqPQRUBip+Fu/S2Cu1tYZOgsx2xX+bQgN2XqSYwDEfAzWGlQbL2RqpdHVXRYEhHO7y+XziWtWNTghS9XUpMx9Op7/OqVrEODldt6VgevS9oCUlYwAqs5FoVhvP3TbX4JT9h/bBzeLP8SRhlbf7bsQc8lP8NWPof1XzvBk21HShoZv0wonuwgOP6bGs8JHF+Nk19csUTONlZy8Bzu0qSzMz2E5J9Of2PXI3jjxH8nAeQvpScBEYoemwga10tVN/cvFD8C8xBHaixCXKoQWMCLAA== 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=Sx4PbnhQ0NCLb+D3iHz0EwjnVXGGTUhB6wc2CS5VSjQ=; b=fxjjy+w0ZSb7EA/xpb+Dim3A+XhrZjp+jlBXzIXjlQYxFbN5z/T4xtkHIu475PAf7Rqz3RByF1thgBJWv8i5cCrfhluzQmeUhlhu5EyD+puHkDQWZ4TkUw/Tft53eW/O7gF1o7hhNFy8I9wNk50Er04MzUBIOOgBmKh51c7Gip700RwQ7VgKXfau+jsot5oMVD5ZgHEOZ6+DnhoIU6a464A3Qh/SkuE36umkm9YKchxP/dUN3+tEQWtORzXmYlRPP2IAIoPmQcK5f4/5Qc1PteYZJBk1533aqtZf/OXFXOnH3wtApUiSzFsyVce+petZ2O0IsmFoD5smI1+6a54UZw== 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=Sx4PbnhQ0NCLb+D3iHz0EwjnVXGGTUhB6wc2CS5VSjQ=; b=MKDPyHwb2NpLG57jyiDViXBWiUr+HSSMhTxcrbsYGbdryy3ES28TTqfhveUNRKRfaTpJwiCTUmmewHAF8/+0R4lk2RI9gDru6qoLzE5Tge39LvTZj+RpTQXisDFGqY6TiVorGOBtknyCsa0bUSDv7tKZQFkT45w7uEzAdSAKJOg= Received: from PH0PR18MB3864.namprd18.prod.outlook.com (2603:10b6:510:26::6) by PH0PR18MB3863.namprd18.prod.outlook.com (2603:10b6:510:49::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.24; Wed, 24 Mar 2021 09:18:40 +0000 Received: from PH0PR18MB3864.namprd18.prod.outlook.com ([fe80::ad37:a202:280:7732]) by PH0PR18MB3864.namprd18.prod.outlook.com ([fe80::ad37:a202:280:7732%7]) with mapi id 15.20.3955.027; Wed, 24 Mar 2021 09:18:40 +0000 From: Tejasree Kondoj To: Akhil Goyal , 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: AQHXGX5P0dvUgRV00kyqWDWaVFh7Q6qSB7sAgADhWIA= Date: Wed, 24 Mar 2021 09:18:39 +0000 Message-ID: References: <20210315102950.30781-1-ktejasree@marvell.com> <20210315102950.30781-3-ktejasree@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [49.206.33.187] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d6d89cb4-c2cb-48fb-6510-08d8eea5d02c x-ms-traffictypediagnostic: PH0PR18MB3863: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:849; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XuQlMPykpXzs155Hq20OJhJ2ugGGmI9dcbmz2VUaKEGIVum/hLTg78C+jbsfw2LfnmJNFfPkPf5sE+FURkln6aUcPCsHXCblm04UHW+mNo5YjUoHpdMCv34bbM8Siqu7fj09dJ3QqBiuPdwni+SrgmebTgMcUoX2ONJSbv3JXDfpIXblqCOpC6Zj9Hj8RTrO+XPn15qOVQQJast+Y2r+oslQiM73ipJ44/AezWc7T5gceeMGfwtFX+s/ODmZJJHt4ppppSQsgo595FQD64hVo8GZQYtSxj8Q6rMSZ2f5AArLgDclecRGCZm1JgudCJvhFxdEMLUybB3mxFrEapiKWQNSYPz5Ncf58h3NNF5P0n1WRkYqvIZAYWEgGgjyRiJbRaXvvuNl9y9/8SH53m8CDJYYG2HUHFj6Uie0cUSc70COEJkOlGOLH4JNokDnG86VOepFwRzdosUg6PnOv3ABVGGIvAf6ZK6byCaY9BhniT4L3fyB6v+MjPyEDZHzPuTAsLrC9/9TOI0FIFoGuebdmydYa7WJeadEX2q8Q4iotmjEqk13MZvYq04D0RCgQew0OvLzJ+T4cbyJ6qKt6FsHdQ85/GBdkzx2cwlFN5cjSkFfvC3ybz5s4boCR2vngT0yRV3221BjmHhZk2nLXDDGOQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB3864.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(376002)(346002)(136003)(396003)(83380400001)(2906002)(64756008)(26005)(66446008)(38100700001)(478600001)(66946007)(76116006)(66556008)(4326008)(186003)(66476007)(71200400001)(52536014)(53546011)(9686003)(5660300002)(8676002)(86362001)(7696005)(110136005)(33656002)(55016002)(55236004)(8936002)(54906003)(316002)(6506007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?XmDL9iuQrG02cVOlcEjin4pIl1mj+QFdOqVzNaRQ+dmUTr0d7dvGF+YnJ59h?= =?us-ascii?Q?/TwXTCMtIxi51/sOh6n8XPY6GGZxkx8ALMKlPVlPPYtwyJorU/8Gvv9yef8k?= =?us-ascii?Q?yiD3iZENTHQpDgTM61ByUTsD5HRDhsA9oVNN27e7+uuOGEQs3OTwhz9UOn75?= =?us-ascii?Q?j5/W2aOsxFo3gWtUOUh1yOeCLoIJjS9hhMZkVWyYoBFa5+JhNXLHhHPN2pC9?= =?us-ascii?Q?j6X/dx+wD56RWgl6hcatVruk37N8vUBd2O9WW7LdmfgWnKLB4wyGHq+uJa1X?= =?us-ascii?Q?SeljJyG3cIP/YJJm4gFiSpzcp3ABJTuhq+n6NfjrBU7EMxvRNK8DYeNb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SHehDf9H6y0mKaFGoYOVvl15Hj9Ef8u+mSnOzC8Tv9p6lBH?= =?us-ascii?Q?YiEvNBmIy3FDRhojZBGYK2CYPDDsNKsYKyGYsj60c1QQrrR53HXumlz9hWJA?= =?us-ascii?Q?HoA=3D?= 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: PH0PR18MB3864.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6d89cb4-c2cb-48fb-6510-08d8eea5d02c X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Mar 2021 09:18:40.0240 (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: BC8T7ZE4JjGFc14XGZFRicXsAm57wLzW3u/IUBfJI83fYgIA8Z2pFGu/QZgbVJvNnV+SoQSTjGGazUPTzKSG4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB3863 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-24_05:2021-03-24, 2021-03-24 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" Hi Akhil, Please see inline. Thanks Tejasree > -----Original Message----- > From: Akhil Goyal > Sent: Wednesday, March 24, 2021 1:18 AM > To: Tejasree Kondoj ; Radu Nicolau > ; Fiona Trahe ; Fan Zhang > ; Arek Kusztal > Cc: Anoob Joseph ; Ankur Dwivedi > ; Jerin Jacob Kollanukkaran ; > dev@dpdk.org > Subject: RE: [PATCH 2/2] test/crypto: support block cipher > DIGEST_ENCRYPTED mode >=20 > > @@ -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. [Tejasree] Yes. Will remove duplicate. >=20 > > + { > > + .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, > > + }, >=20 > The above one is also duplicate. Please check. [Tejasree] Yes. Will remove this. >=20 > > + { > > + .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, >=20 > [snip] >=20 > > @@ -558,18 +620,20 @@ test_blockcipher_one_case(const struct > > blockcipher_test_case *t, > > } > > } > > > > - 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 */ >=20 > 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? [Tejasree] Cipher text has both encrypted plain text and encrypted digest v= alue. If cipher text is correct, it implies digest is generated properly. Will amend the comment to better reflect this. >=20 > > + 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); > > > > - 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; > > + } > > } > > - } > >