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 7D4D1A0471 for ; Wed, 17 Jul 2019 12:22:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F5E81DBE; Wed, 17 Jul 2019 12:22:47 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id B9C7B137C for ; Wed, 17 Jul 2019 12:22:45 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6HAJs2r015639; Wed, 17 Jul 2019 03:22:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=mqn6bC6TBd5MRSn9MDs7Ayop8PNhT9vIqQcdK86iJw8=; b=SUx7CezdWtj3Yqj5lGchzv9UtoJKeHSGwv564/yGQLLJ+fg9OirU1LcyDHoZuj2oC254 UwemygeYwWvjOIvO7rhcYZvgV5Lnn4ykWOhN9p9vCjVEecrZzb5q2Jueh44mur/L3zzj YHhrKDsXKCmE0YkQTG2C2YWpasacreJmf7TzJXS0lT2dFrOZuUSLcfVlqUuAqOQegHz0 KrzvXoM60LTEmXRfX6vml6fipIkTE8fKkFjlov9w7A1x5qsgFz8QOuWEA46jTu9PQELP LXmqXusuYoFckFxGvb7WuSpciMFdsKZO4NOvTfWa+nJSDaKAanXInGZyM/ksRNMb5NXs IQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2ts07vfrrr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jul 2019 03:22:44 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 17 Jul 2019 03:22:43 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (104.47.40.55) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 17 Jul 2019 03:22:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hqRgfuWM518Knod/tf1/Eb/32EgPTw7JL3xrNUw4v8K1Pw7Om2Ue52d8rAHwKTWKZfncxulZ/Blmr5wvaau6z7sD1Fdn4XSGyt3dVMSz+Xfw70zvXftRGHRlKl48OE509TkJgHQ6nLsKxIfNb7rN+vabDfv/tEUm6R3M6VBKgzhvhIn7tGHGPcEgKGIKsTf2ZF4V9FUmGkDNmz9iaGaMu7PKURk+7kgqeUF0DeMyJpu26Xql7fLMNC4jKfBVditgg+7FaEhGxumtgh/eGl6HFToWc6HfpQFt6kXRKoNTt8xs29ECEIYVuR8WoiN3Anch5WSEW9ucKm0543xTFFXrKA== 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=mqn6bC6TBd5MRSn9MDs7Ayop8PNhT9vIqQcdK86iJw8=; b=Axre/mdHZV/A7PJzX62V6x5f0N0kRPuSA490N12Luz2vIWuNfCUs7dp+NxLqzvEMGy8z5P6aHk0tKLvtGfrIQ+NTf5gZws9wblnl5r0jMKNnZsr5b3WH1BqsfdqbytYdrknFBA8k6KTpBIXPicV2KNsvPAELBCZ8LK0nyNoikw2pF5aA+2yMdbxCXpSNd1tkdde2WWfvyrM/tx1p0GRR1NPT3mId5hcA+Ykpau6SmATXlkV2g1Qdxcw7kzfTBSeG4JmKHuzjN0ywGucCOFtDcB6vhQBbOqfynFxPTEjT9Fq0D4RHM2UukzA2oGiZVDpHmjdY0Ok2Zy55bMFMmpnF+Q== 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=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mqn6bC6TBd5MRSn9MDs7Ayop8PNhT9vIqQcdK86iJw8=; b=nvL8bxU8eay4MhFIP4Z+GeUeXZPOFLymEbxnmfUF5fUWLtUtNo/4uJ68KjovBbOzkQLPpfLWQCJs3u4B0CNVsbw1eKck9MUa+Hp4Xz5wa2x2qZk16BaeUJC9kmViDofANfyjJ2mrbzJWTR5MaEgFd2SL3za62hPGgD39g7UX6Gw= Received: from BN6PR1801MB2052.namprd18.prod.outlook.com (10.161.157.11) by BN6PR1801MB2051.namprd18.prod.outlook.com (10.161.156.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Wed, 17 Jul 2019 10:22:39 +0000 Received: from BN6PR1801MB2052.namprd18.prod.outlook.com ([fe80::b9c4:1fd1:a47e:cd72]) by BN6PR1801MB2052.namprd18.prod.outlook.com ([fe80::b9c4:1fd1:a47e:cd72%6]) with mapi id 15.20.2073.012; Wed, 17 Jul 2019 10:22:39 +0000 From: Shally Verma To: Arek Kusztal , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "fiona.trahe@intel.com" Thread-Topic: [EXT] [PATCH v3 10/11] test: add pkcs1_5 padding simulation Thread-Index: AQHVPAfN1ybhSvZNJEmt6DHo4wqPFabOmt3w Date: Wed, 17 Jul 2019 10:22:39 +0000 Message-ID: References: <20190716185304.12592-1-arkadiuszx.kusztal@intel.com> <20190716185304.12592-11-arkadiuszx.kusztal@intel.com> In-Reply-To: <20190716185304.12592-11-arkadiuszx.kusztal@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.169.231.225] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dd766b3f-54c7-4dcd-481c-08d70aa0b1f0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BN6PR1801MB2051; x-ms-traffictypediagnostic: BN6PR1801MB2051: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1332; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(136003)(396003)(39860400002)(346002)(13464003)(199004)(189003)(8676002)(7736002)(74316002)(2906002)(486006)(305945005)(256004)(110136005)(14444005)(54906003)(6436002)(71190400001)(71200400001)(76116006)(8936002)(81166006)(9686003)(316002)(81156014)(55016002)(3846002)(6116002)(66066001)(52536014)(4326008)(66946007)(68736007)(6246003)(53546011)(76176011)(478600001)(33656002)(25786009)(102836004)(186003)(7696005)(26005)(53936002)(99286004)(86362001)(66446008)(66476007)(66556008)(64756008)(446003)(11346002)(5660300002)(229853002)(14454004)(476003)(2501003)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1801MB2051; H:BN6PR1801MB2052.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: MyHNMqk5238bU1oV2JhZ4N1CRPHPEUpwbIvglzhxiXuNLLPvXcUIfKLpcXK5yCHUpSbMakX2FWGi27sSMJWIDOktkI+7Rf96GhEjI6kpeOcrUrNcE6FU3lsuix7utCW3DaFioVJTorN68sJLwBxTHch1gC4KclgEFyCQClQ0rppasS86FB8LNgG/UoEOyj9OqY5rFdkEMDDl1ElDer0FV0avmbVkCImqgZRdMEH6GbQSRvkFl9RnHGhRp919Am+jiXqBWtr904ShpvxNWZRH/PAhplZKqGk5HIQC3NPuc+PsfEGUS/QKGJeUfziE1VdBzXzA1yE9tORgCR18ndmHRWwkAQbM5ckeoM7/ZDS1xJzwpI1XXHA2vLflQ5s4467zJqD9Y8N4ZIOeqqMSJgLD5IqndmiyruCk4xMnnLNcKY8= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: dd766b3f-54c7-4dcd-481c-08d70aa0b1f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 10:22:39.1304 (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: shallyv@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1801MB2051 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-17_03:2019-07-17,2019-07-17 signatures=0 Subject: Re: [dpdk-dev] [EXT] [PATCH v3 10/11] test: add pkcs1_5 padding simulation 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" > -----Original Message----- > From: Arek Kusztal > Sent: Wednesday, July 17, 2019 12:23 AM > To: dev@dpdk.org > Cc: akhil.goyal@nxp.com; fiona.trahe@intel.com; Shally Verma > ; Arek Kusztal > Subject: [EXT] [PATCH v3 10/11] test: add pkcs1_5 padding simulation >=20 > External Email >=20 > ---------------------------------------------------------------------- > This patch adds function to simulate pkcs1_5 padding, it serves nothing e= lse > than example. It provides no security and should not be used in security > context. >=20 > Signed-off-by: Arek Kusztal > --- [Shally] Sorry did not get context of this test. Is it to describe PADDING_= NONE? > app/test/test_cryptodev_asym_util.h | 54 > +++++++++++++++++++++++++++++++++++++ > 1 file changed, 54 insertions(+) >=20 > diff --git a/app/test/test_cryptodev_asym_util.h > b/app/test/test_cryptodev_asym_util.h > index b3d9fb4..f984166 100644 > --- a/app/test/test_cryptodev_asym_util.h > +++ b/app/test/test_cryptodev_asym_util.h > @@ -1,10 +1,64 @@ > /* SPDX-License-Identifier: BSD-3-Clause > * Copyright(c) 2018 Cavium Networks > + * Copyright (c) 2019 Intel Corporation > */ >=20 > #ifndef TEST_CRYPTODEV_ASYM_TEST_UTIL_H__ #define > TEST_CRYPTODEV_ASYM_TEST_UTIL_H__ >=20 > +/* > + * Two functions below simulate pkcs 1.5 padding and serves only as an > +example, > + * both offer no security. > + */ > +static inline int rsa_simulate_pkcs1_5_padding(int op, uint8_t *p, > + int key_size, const uint8_t *src, int len) { > + > + int ps_len; > + > + if (len > key_size - 11) > + return -1; > + ps_len =3D key_size - len - 3; > + > + *(p++) =3D 0; > + *(p++) =3D op ? 1 : 2; > + if (op) { > + while (ps_len--) > + *(p++) =3D 0xFF; > + } else { > + while (ps_len--) { > + *p =3D (uint8_t)rand(); > + *p ^=3D !(*p); > + p++; > + } > + } > + > + *(p++) =3D 0; > + memcpy(p, src, len); > + > + return 0; > +} > + > +static inline int rsa_simulate_strip_pkcs1_5_padding(uint8_t *src, > + int key_size) { > + uint8_t tmp[key_size], *orig_src =3D src; > + int i =3D 1; > + ++src; > + while (*(src) && i < key_size) { > + ++i; > + ++src; > + } > + if (i =3D=3D key_size) > + return -1; > + > + ++i; > + ++src; > + > + memcpy(tmp, src, key_size - i); > + memcpy(orig_src, tmp, key_size - i); > + return key_size - i; > +} > + > + > /* Below Apis compare resulted buffer to original test vector */ >=20 > static inline int rsa_verify(struct rsa_test_data *rsa_param, > -- > 2.1.0