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 1A21DA0A0A; Sun, 11 Apr 2021 22:27:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9838A141437; Sun, 11 Apr 2021 22:27:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id DFD64141433 for ; Sun, 11 Apr 2021 22:27:02 +0200 (CEST) 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 13BKPj07000747; Sun, 11 Apr 2021 13:26:55 -0700 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by mx0a-0016f401.pphosted.com with ESMTP id 37u9cpjqjh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 11 Apr 2021 13:26:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+z4frD0yfv1arK3L1bxrHABpJhZwXP8gBVFtvWqcCp066ShwrxLRAA8ugbJx3h+HKcw7Bon/4SGJgQOe23c8sykA0XsXy3zKijxqD6J/IxnNtoeqPH1KGaCZPpWEfCE6HI9n4czzRQGquATb2cbDNourH5zLXZszMsKNwe+A13/qkqyIeEasQVcyjt+Jl3oYxHtf0Yf6wOg06y3rCxaFq5pAocZQdVEuGDh1pweiGUEQvyNkDHurmyDt+mCXC3hT4wrddEms8ydOgRNhJ8EY3na2eZmv6J6yIs9MiBw5O7toz36dTWVLv/0hSy0CGbulvHT38NMNIGpFH8ay/+oNA== 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=dbH8iOLCl5PHNzCTDjse3gamDYuh4z4e7EmiciwrEdg=; b=bk08izdrae3NbdfEJRoE3j+XJFzbTdON8l9AnE1v7BIpWP+75HxeshLJqld5v2DAmrq/72VgV/LvLa1R3lJT9C/39KZYnIQTegRICbL0b4DTmJ+OEJvWFmmL8a/f0fym6ZJ1X97TCPwG9oTtDPDrvHvHJiGFJ8fgffu/Dr9TtIhSrfxz0JRR0G2e+KUMoeVkb+tCgRxOSgibbCqZA0zLrzuX/4NdhlctjeqcRrCXDZTONGfwWSFtxOeQdFufJVBGlrFhZBbABpz7RKNoDHOon/s+EWheD8XPkgVwFLMdEkDYgG3We1DtxWfdeuOsFXGNgfWpDV3DwQd960xSYvR+BQ== 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=dbH8iOLCl5PHNzCTDjse3gamDYuh4z4e7EmiciwrEdg=; b=JaGW8MXMzxFEgF87aiQZbeBcYCJmjeye4dlzHGeNfIT+ufs1RKimLQQiSPJ6LhKiBHHyUN6mt6fmxsDcezn1iL4ILXmApZv4rqpFNrSCR5OWCquMQD/NZY69B67yTZr87jgicQMl+pf3RiQIbhbDCylPbG6A4xPmIiTXxXdiVuQ= Received: from MW2PR18MB2284.namprd18.prod.outlook.com (2603:10b6:907:10::16) by MWHPR18MB1632.namprd18.prod.outlook.com (2603:10b6:300:c5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Sun, 11 Apr 2021 20:26:53 +0000 Received: from MW2PR18MB2284.namprd18.prod.outlook.com ([fe80::3168:cb00:6607:743f]) by MW2PR18MB2284.namprd18.prod.outlook.com ([fe80::3168:cb00:6607:743f%7]) with mapi id 15.20.4020.022; Sun, 11 Apr 2021 20:26:53 +0000 From: Akhil Goyal To: Matan Azrad , "dev@dpdk.org" CC: Declan Doherty , Somalapuram Amaranath , Ruifeng Wang , Ajit Khaparde , Anoob Joseph , Fan Zhang , John Griffin , Pablo de Lara , Michael Shamis , Nagadheeraj Rottela , Ankur Dwivedi , Gagandeep Singh , Jay Zhou , ArkadiuszX Kusztal , "sashakot@nvidia.com" , "oren@nvidia.com" , Shiri Kuzin Thread-Topic: [EXT] [PATCH v2] cryptodev: formalize key wrap method in API Thread-Index: AQHXLtsfZ3UPiDE7S0iNQweZ6SMUG6qvumLA Date: Sun, 11 Apr 2021 20:26:52 +0000 Message-ID: References: <1615877501-164036-1-git-send-email-matan@nvidia.com> <20210411140053.2914307-1-matan@nvidia.com> In-Reply-To: <20210411140053.2914307-1-matan@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=marvell.com; x-originating-ip: [182.69.47.6] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 89ee2947-b1dc-4902-8e23-08d8fd2824e9 x-ms-traffictypediagnostic: MWHPR18MB1632: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RtSxV3gWBExufvqTb1I2nrLqEL/ScJbEFaIXD3Bj0CRrbnaK9qN4gdCEtSpsIeMbVD7em48jqhDq2+KcnkFSOti5jDrssb2nohl5LPPhydhogK3lAC/Ri9wP7DCJchpjybBry0LeVsJORJGx4TiCl98WpAIs8m2lEoI2lyQkZjX1bMUsmYTn6L9o5KD/dyRHSbqw9j3P8+twnI1g4hzNzrQT00Zj97kNwjFKriGSpsTXgXc9VifKlLOvGfIsqcEyJh2sQ/ckv1y/NSu/rW6DOaykZVImXwAlfblcpTa66OlqfQPryF3E7Yh+e8YZcOV9CNRjJoEPodZySfCpCwByIfX+fNAFnN+6dGMyl6U20elq/vxNlydo9ra7aq0A9S/soF0Hzdx1UvyGyNGzzCwe/KuKmbJ3cArWOdHUVat9BWjh8DXGyHE5a6kR6VnYc3h3ISzdjw1+bAWOpFxwVwCIU/8ESVzvkQljlEu9Cuk2W1E8GXs/+BBpeg/HdnvmDOT9vZRGK7dM3fz4aSt2b86JFECsBCb0rnC3SGvSnSLKY+gNxeI2B/gyTBZOyUVC365TLe1RGMbLevGcdOQ40J3TWwcvpQ95KKt9Lx47td+2lhY= 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)(346002)(376002)(366004)(39850400004)(396003)(86362001)(71200400001)(7416002)(8676002)(66446008)(5660300002)(2906002)(4326008)(38100700002)(6506007)(52536014)(55016002)(66476007)(83380400001)(478600001)(26005)(76116006)(66946007)(186003)(9686003)(8936002)(7696005)(64756008)(54906003)(110136005)(316002)(66556008)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?FntQOnEzYOW11iCFIYZVqGuuOfyxMc8ZPl9B8JeHzc9CiojIVSx4B5IyqN5r?= =?us-ascii?Q?FgI+ljjMW0o4VXceDTG8TSeBgUA6Dh00k3cCC3FECdkQRbYC0BZ/yYVObrCf?= =?us-ascii?Q?FETVydI0UUQQQhvtAa7c/tcnYd6CF0B2GI2aaTOkUahgZhos124wnWEeSi/B?= =?us-ascii?Q?WuqlpldDfwJIEWAp/ib+c8y1X5aXtsuwzEgMDuavSW9GHrTvENa/7ryJaawg?= =?us-ascii?Q?XFYDZQSVz9rIdrWxkB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=?us-ascii?Q?uxrTJ5YekV6wE3PlF2qD+/B0EIs4Pq6KWiVvpnMMm6kHkkvZmb+hMfmdCc27?= =?us-ascii?Q?uiy7defh32KKOy7RRuKfyeRL7kmk5kERwbjRe6jZ67nh8EgVacJHztEfskhD?= =?us-ascii?Q?wnBX22Uwd5tqMnCsIr9TxjZqPR9o4FPOWWIijjzbppPA8FTIFLG7ZJm4xX7+?= =?us-ascii?Q?XKA=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: MW2PR18MB2284.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89ee2947-b1dc-4902-8e23-08d8fd2824e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2021 20:26:52.9642 (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: Mf2NqmlNGil+ONiJoM/LWcKqwqjc1U1ldsH8k+FwN0H1qr/YbtsL7WJ8xZ1wV8OGANz01k4hDXpIOJ1GFlVIGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR18MB1632 X-Proofpoint-ORIG-GUID: U6cV-dqdf8MMq4mjqmGPDjAqs74hG2TZ X-Proofpoint-GUID: U6cV-dqdf8MMq4mjqmGPDjAqs74hG2TZ X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-04-11_09:2021-04-09, 2021-04-11 signatures=0 Subject: Re: [dpdk-dev] [EXT] [PATCH v2] cryptodev: formalize key wrap method in API 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 Matan, > The Key Wrap approach is used by applications in order to protect keys > located in untrusted storage or transmitted over untrusted > communications networks. The constructions are typically built from > standard primitives such as block ciphers and cryptographic hash > functions. >=20 > The Key Wrap method and its parameters are a secret between the keys > provider and the device, means that the device is preconfigured for > this method using very secured way. >=20 > The key wrap method may change the key length and layout. >=20 > Add a description for the cipher transformation key to allow wrapped key > to be forwarded by the same API. >=20 > Add a new feature flag RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY to be > enabled > by PMDs support wrapped key in cipher trasformation. Spell check >=20 > Signed-off-by: Matan Azrad > --- >=20 > V2: > Address Akhil coment to introduce ne feature flag for wrapped keys. >=20 >=20 > doc/guides/cryptodevs/features/default.ini | 1 + > doc/guides/cryptodevs/overview.rst | 3 +++ > doc/guides/rel_notes/release_21_05.rst | 5 +++++ > lib/librte_cryptodev/rte_crypto_sym.h | 8 ++++++++ > lib/librte_cryptodev/rte_cryptodev.c | 2 ++ > lib/librte_cryptodev/rte_cryptodev.h | 2 ++ > 6 files changed, 21 insertions(+) >=20 > diff --git a/doc/guides/cryptodevs/features/default.ini > b/doc/guides/cryptodevs/features/default.ini > index 978bb30cc1..c24814de98 100644 > --- a/doc/guides/cryptodevs/features/default.ini > +++ b/doc/guides/cryptodevs/features/default.ini > @@ -32,6 +32,7 @@ Symmetric sessionless =3D > Non-Byte aligned data =3D > Sym raw data path API =3D > Cipher multiple data units =3D > +Cipher wrapped key =3D >=20 > ; > ; Supported crypto algorithms of a default crypto driver. > diff --git a/doc/guides/cryptodevs/overview.rst > b/doc/guides/cryptodevs/overview.rst > index e24e3e1993..47b1231226 100644 > --- a/doc/guides/cryptodevs/overview.rst > +++ b/doc/guides/cryptodevs/overview.rst > @@ -49,6 +49,9 @@ Supported Feature Flags > - "CIPHER_MULTIPLE_DATA_UNITS" feature flag means PMD support > operations > on multiple data-units message. >=20 > + - "CIPHER_WRAPPED_KEY" feature flag means PMD support wrapped key > in cipher > + transformation. > + >=20 > Supported Cipher Algorithms > --------------------------- > diff --git a/doc/guides/rel_notes/release_21_05.rst > b/doc/guides/rel_notes/release_21_05.rst > index 1537fac4bc..75b2b86c5f 100644 > --- a/doc/guides/rel_notes/release_21_05.rst > +++ b/doc/guides/rel_notes/release_21_05.rst > @@ -132,6 +132,11 @@ New Features > data-units for AES-XTS algorithm, the data-unit length should be set i= n the > transformation. A capability for it was added too. >=20 > +* **Added feature to support cipher wrapped key on cryptodev library > API.** > + > + The Cryptodev library has been enhanced to allow providing wrapped key > in > + cipher transformation. Added a crypto PMD feature flag to support cipher wrapped keys A new feature flag is added to allow application to provide cipher wrapped = keys in session xforms. > + >=20 > Removed Items > ------------- > diff --git a/lib/librte_cryptodev/rte_crypto_sym.h > b/lib/librte_cryptodev/rte_crypto_sym.h > index 5973e31f30..0e08d2ef9e 100644 > --- a/lib/librte_cryptodev/rte_crypto_sym.h > +++ b/lib/librte_cryptodev/rte_crypto_sym.h > @@ -200,6 +200,14 @@ struct rte_crypto_cipher_xform { > uint16_t length; /**< key length in bytes */ > } key; > /**< Cipher key > + * When the device RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY > feature is > + * enabled, the original key data may be provided wrapped > (encrypted) > + * using a key wrap algorithm such as AES key wrap (from rfc3394) or > + * other. In such case, the wrapping details is a secret between the > key > + * provider and the device. Such key wrapping may increase the > length of > + * the provided key beyond the advertised supported key size. Hence > it > + * is the responsibility of the driver/device to validate the length of > + * the provided key. How will the PMD respond if length of the provided key is not correct. Which API will return error? Session_init?=20 It should also be mentioned here. Also, the application should check the capability key lengths only in case= =20 FF_CIPHER_WRAPPED_KEY is set. Otherwise it should be checked as it was Done before. Please align the l2fwd-crypto patch as per this patch. You may rephrase it as "In case the PMD supports RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY, the original key data provided may be wrapped(encrypted) using key wrap algorithm such as AES key wrap (rfc3394) and hence length of the key may increase beyond the PMD advertised supported key size. PMD shall validate the key length and report error while configuring the Session and application can skip checking the capability key length in Such cases." > * > * For the RTE_CRYPTO_CIPHER_AES_F8 mode of operation, key.data > will > * point to a concatenation of the AES encryption key followed by a > diff --git a/lib/librte_cryptodev/rte_cryptodev.c > b/lib/librte_cryptodev/rte_cryptodev.c > index e02e001325..a84cd745f9 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.c > +++ b/lib/librte_cryptodev/rte_cryptodev.c > @@ -619,6 +619,8 @@ rte_cryptodev_get_feature_name(uint64_t flag) > return "NON_BYTE_ALIGNED_DATA"; > case RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS: > return "CIPHER_MULTIPLE_DATA_UNITS"; > + case RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY: > + return "CIPHER_WRAPPED_KEY"; > default: > return NULL; > } > diff --git a/lib/librte_cryptodev/rte_cryptodev.h > b/lib/librte_cryptodev/rte_cryptodev.h > index c274e208ed..16c20de94c 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.h > +++ b/lib/librte_cryptodev/rte_cryptodev.h > @@ -476,6 +476,8 @@ rte_cryptodev_asym_get_xform_enum(enum > rte_crypto_asym_xform_type *xform_enum, > /**< Support accelerator specific symmetric raw data-path APIs */ > #define RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS (1ULL << 25) > /**< Support operations on multiple data-units message */ > +#define RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY (1ULL << 26) > +/**< Support wrapped key in cipher transformation */ >=20 > /** > * Get the name of a crypto device feature flag > -- > 2.25.1