From patchwork Mon Jun 24 19:07:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary R Hook X-Patchwork-Id: 11013993 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A2B39924 for ; Mon, 24 Jun 2019 19:07:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9340828A4E for ; Mon, 24 Jun 2019 19:07:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8717228A89; Mon, 24 Jun 2019 19:07:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FAAE28A4E for ; Mon, 24 Jun 2019 19:07:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730063AbfFXTHo (ORCPT ); Mon, 24 Jun 2019 15:07:44 -0400 Received: from mail-eopbgr690081.outbound.protection.outlook.com ([40.107.69.81]:24681 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729146AbfFXTHo (ORCPT ); Mon, 24 Jun 2019 15:07:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WJyxUKkzrAIJ4gEGZ3SSbpbp416kpHzkjoVRdvVp2ME=; b=CgPqvZB+7Tk9vWErPSnzCSf2fOOAPbMhyYKGIL9vfdowPExj0RZycidFTyF+xMfksvkGXIS+di6BCyEg5Ybdk+xo+mdnna14yK1s0uWc4Z5GzS/5XiOvZ2KKgjItgMV/Viwkj9oBzFHgMcquGuIcXY1t3kkw4oXvmnW+7SGLYCg= Received: from DM5PR12MB1449.namprd12.prod.outlook.com (10.172.40.14) by DM5PR12MB2584.namprd12.prod.outlook.com (52.132.141.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.13; Mon, 24 Jun 2019 19:07:42 +0000 Received: from DM5PR12MB1449.namprd12.prod.outlook.com ([fe80::180c:ff0c:37e6:a482]) by DM5PR12MB1449.namprd12.prod.outlook.com ([fe80::180c:ff0c:37e6:a482%10]) with mapi id 15.20.2008.014; Mon, 24 Jun 2019 19:07:42 +0000 From: "Hook, Gary" To: "herbert@gondor.apana.org.au" , "corbet@lwn.net" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "davem@davemloft.net" Subject: [PATCH 1/3] crypto: doc - Add parameter documentation Thread-Topic: [PATCH 1/3] crypto: doc - Add parameter documentation Thread-Index: AQHVKsAZ2iu41GA1mUC92fRE2Scqqw== Date: Mon, 24 Jun 2019 19:07:42 +0000 Message-ID: <156140326035.29777.7460831085991852791.stgit@taos> References: <156140322426.29777.8610751479936722967.stgit@taos> In-Reply-To: <156140322426.29777.8610751479936722967.stgit@taos> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0501CA0051.namprd05.prod.outlook.com (2603:10b6:803:41::28) To DM5PR12MB1449.namprd12.prod.outlook.com (2603:10b6:4:10::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 87702f17-bbc5-43e2-863d-08d6f8d73b76 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:DM5PR12MB2584; x-ms-traffictypediagnostic: DM5PR12MB2584: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(376002)(136003)(366004)(39860400002)(396003)(346002)(199004)(189003)(99286004)(6436002)(25786009)(76176011)(52116002)(72206003)(33716001)(9686003)(6512007)(14444005)(256004)(68736007)(110136005)(6116002)(3846002)(446003)(476003)(11346002)(316002)(2906002)(26005)(186003)(102836004)(6486002)(386003)(14454004)(5660300002)(486006)(81156014)(86362001)(103116003)(305945005)(81166006)(478600001)(8676002)(66946007)(73956011)(8936002)(66066001)(66446008)(64756008)(66556008)(66476007)(2501003)(71190400001)(71200400001)(6506007)(53936002)(7736002)(2201001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB2584;H:DM5PR12MB1449.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: IJfZ3Gv8tbFmiw08mirh2Uukbyl5CK76BsD9lrzEno8dysZEhe6mutHm+ZtpCeJJOEaChHDuBkCKT0OjKTTIlJv0FS1VTTfb4SiVE0G2hiXoMSBsY7iQTc+/jvNOOCfZmBwAJrtN72qMRk63iXjhZYxp/z/oAqqB6oAshhf0ylx3iMp9Lv38/+3v3lypjrarl7UjTWBYPIKzRJD4hDC4YViiG+8n5WCZCI7wMGMJJ6q8/haD0x9plLS/PezcgFUUeeivqBFCkgC6ahjh1oIQCVSC2hiFzVp6EJIRcKomK0tWQU+xl8+KLy/HrfTTIO9POp3QzChCBzOlDMQoLYDj5kCsk1G+XJu+IT/ohWcM+9VbAguWuK1X4lJ7cSnjXySNjg54dcZ0XUnFw6kf4z5/qP4t+9hfDWhVqDhD6+KVqxs= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87702f17-bbc5-43e2-863d-08d6f8d73b76 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 19:07:42.1696 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ghook@amd.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2584 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fill in missing parameter descriptions for the ompression algorithm, then pick them up to document for the compression_alg structure. Signed-off-by: Gary R Hook --- Documentation/crypto/api-skcipher.rst | 2 +- include/linux/crypto.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/crypto/api-skcipher.rst b/Documentation/crypto/api-skcipher.rst index 4eec4a93f7e3..20ba08dddf2e 100644 --- a/Documentation/crypto/api-skcipher.rst +++ b/Documentation/crypto/api-skcipher.rst @@ -5,7 +5,7 @@ Block Cipher Algorithm Definitions :doc: Block Cipher Algorithm Definitions .. kernel-doc:: include/linux/crypto.h - :functions: crypto_alg ablkcipher_alg blkcipher_alg cipher_alg + :functions: crypto_alg ablkcipher_alg blkcipher_alg cipher_alg compress_alg Symmetric Key Cipher API ------------------------ diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 311237b1dab0..4b4e2ffbee74 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -327,6 +327,17 @@ struct cipher_alg { void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); }; +/** + * struct compress_alg - compression/decompression algorithm + * @coa_compress: Compress a buffer of specified length, storing the resulting + * data in the specified buffer. Return the length of the + * compressed data in dlen. + * @coa_decompress: Decompress the source buffer, storing the uncompressed + * data in the specified buffer. The length of the data is + * returned in dlen. + * + * All fields are mandatory. + */ struct compress_alg { int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen); From patchwork Mon Jun 24 19:07:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary R Hook X-Patchwork-Id: 11013995 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8E6114B6 for ; Mon, 24 Jun 2019 19:07:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA8DE28A81 for ; Mon, 24 Jun 2019 19:07:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE90728A8C; Mon, 24 Jun 2019 19:07:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 669AB28A81 for ; Mon, 24 Jun 2019 19:07:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730128AbfFXTHv (ORCPT ); Mon, 24 Jun 2019 15:07:51 -0400 Received: from mail-eopbgr730086.outbound.protection.outlook.com ([40.107.73.86]:12516 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729146AbfFXTHv (ORCPT ); Mon, 24 Jun 2019 15:07:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=urgLOV1FExNoseo8dSa71pKIYiP+PKatEBf1iJSXlnk=; b=lkp9xvf5wv8S2b4mEkQrz9wdCyZEqb/S2QDllKkKIpHN5yYG10NkAaHgF648sBECC6vAWDV+ubZQvuHymjt+gOYqEEfad+hoTYhlV7B0eNvs2MD9nHdokwkIA6TxE0iTUtVddDnLbiOT6wpah7zrKr0By7I6el+1nXbzn6r9aoQ= Received: from DM5PR12MB1449.namprd12.prod.outlook.com (10.172.40.14) by DM5PR12MB2471.namprd12.prod.outlook.com (52.132.141.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.13; Mon, 24 Jun 2019 19:07:49 +0000 Received: from DM5PR12MB1449.namprd12.prod.outlook.com ([fe80::180c:ff0c:37e6:a482]) by DM5PR12MB1449.namprd12.prod.outlook.com ([fe80::180c:ff0c:37e6:a482%10]) with mapi id 15.20.2008.014; Mon, 24 Jun 2019 19:07:49 +0000 From: "Hook, Gary" To: "herbert@gondor.apana.org.au" , "corbet@lwn.net" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "davem@davemloft.net" Subject: [PATCH 2/3] crypto: doc - Describe the crypto engine Thread-Topic: [PATCH 2/3] crypto: doc - Describe the crypto engine Thread-Index: AQHVKsAd+xpmsaFX3kCZNKb6odNQPw== Date: Mon, 24 Jun 2019 19:07:49 +0000 Message-ID: <156140326736.29777.7751606850237303573.stgit@taos> References: <156140322426.29777.8610751479936722967.stgit@taos> In-Reply-To: <156140322426.29777.8610751479936722967.stgit@taos> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0501CA0044.namprd05.prod.outlook.com (2603:10b6:803:41::21) To DM5PR12MB1449.namprd12.prod.outlook.com (2603:10b6:4:10::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: de92951a-52ed-4e88-a7e9-08d6f8d73fc8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:DM5PR12MB2471; x-ms-traffictypediagnostic: DM5PR12MB2471: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(396003)(39860400002)(346002)(366004)(376002)(136003)(199004)(189003)(316002)(64756008)(66066001)(66446008)(186003)(5660300002)(68736007)(486006)(72206003)(6436002)(6512007)(14454004)(9686003)(476003)(86362001)(6486002)(99286004)(33716001)(446003)(76176011)(3846002)(52116002)(6116002)(11346002)(2201001)(66556008)(25786009)(81156014)(4744005)(8676002)(81166006)(110136005)(305945005)(7736002)(2501003)(103116003)(8936002)(478600001)(26005)(73956011)(66946007)(102836004)(2906002)(256004)(386003)(6506007)(71190400001)(71200400001)(66476007)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB2471;H:DM5PR12MB1449.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: pE3kHWos26QjHwFqhJbeVDzJDSZ9PIOct2D0OEZ9XDO3RsmzspQo75uKwZx5aBsgEKTWx/hosTNFvuxL/N8xhyzYZ9kA2JCzfprtSso/szP5K4/v9wI8s3mcWV/ect8altzU1aVGmmHOuS4fwC57g1zZVPkb9VcBNgdDjEQ+QG5QnkH0mgCYzqsWoqMsMk/J5mmSuvTcfvivShW+lJ1DSO61/btFo4I4L2jXTJNL8ZQ3Jia4ggL8DAQi0loonZ5T2cxpfq0Pr7ghlarmAWie+6jWLtuaRGno0ICYsa+ssM5RyNwIY0WQzJXKV/1sv0Ol7U3bju5YJeh+p0C3Mj3SkNhLaJXrXVbPwYnMUXMEb5AlgWRa5b98wDJGSm6/0eLOrp9GI6COGejAjxxdXRnjtHx+zWu7YvZnd/h673cdo9w= Content-ID: <31AAA56924FEA34BB0FC183DDB51A70C@namprd12.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: de92951a-52ed-4e88-a7e9-08d6f8d73fc8 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 19:07:49.4518 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ghook@amd.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2471 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a reference to the crypto engine documentation to the index. Signed-off-by: Gary R Hook --- Documentation/crypto/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/crypto/index.rst b/Documentation/crypto/index.rst index c4ff5d791233..37cd7fb0ea82 100644 --- a/Documentation/crypto/index.rst +++ b/Documentation/crypto/index.rst @@ -19,6 +19,7 @@ for cryptographic use cases, as well as programming examples. intro architecture devel-algos + crypto_engine userspace-if crypto_engine api From patchwork Mon Jun 24 19:07:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary R Hook X-Patchwork-Id: 11013997 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5118924 for ; Mon, 24 Jun 2019 19:08:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9665928A4E for ; Mon, 24 Jun 2019 19:08:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A8AF28A89; Mon, 24 Jun 2019 19:08:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC0D328A4E for ; Mon, 24 Jun 2019 19:07:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728152AbfFXTH7 (ORCPT ); Mon, 24 Jun 2019 15:07:59 -0400 Received: from mail-eopbgr730087.outbound.protection.outlook.com ([40.107.73.87]:44147 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729146AbfFXTH7 (ORCPT ); Mon, 24 Jun 2019 15:07:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zbT805oAzOX0M5kaSVapQkXVQXSrEu2t7DpsC7Cj4+k=; b=iY4TIsufHLowqDhWaZIiP46CxqgOfkqxUydLxpSRspbY1kavfd53CqsJCoiUkGRpnrJ8f19Y0Rlqa0yR5KzTCLpWZhgsWw+NAWa1L0OjvaxH2F3TFYEJnyObZ87xLxLLeC6Ca3P4i7j+tTfadlLgw340g83MOb2TZOxqU6m6kW4= Received: from DM5PR12MB1449.namprd12.prod.outlook.com (10.172.40.14) by DM5PR12MB2471.namprd12.prod.outlook.com (52.132.141.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.13; Mon, 24 Jun 2019 19:07:56 +0000 Received: from DM5PR12MB1449.namprd12.prod.outlook.com ([fe80::180c:ff0c:37e6:a482]) by DM5PR12MB1449.namprd12.prod.outlook.com ([fe80::180c:ff0c:37e6:a482%10]) with mapi id 15.20.2008.014; Mon, 24 Jun 2019 19:07:56 +0000 From: "Hook, Gary" To: "herbert@gondor.apana.org.au" , "corbet@lwn.net" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "davem@davemloft.net" Subject: [PATCH 3/3] crypto: doc - Fix formatting of new crypto engine content Thread-Topic: [PATCH 3/3] crypto: doc - Fix formatting of new crypto engine content Thread-Index: AQHVKsAhzQYljFA8HEerpaXh3eY2Gw== Date: Mon, 24 Jun 2019 19:07:56 +0000 Message-ID: <156140327467.29777.2980404770916038687.stgit@taos> References: <156140322426.29777.8610751479936722967.stgit@taos> In-Reply-To: <156140322426.29777.8610751479936722967.stgit@taos> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DM5PR08CA0035.namprd08.prod.outlook.com (2603:10b6:4:60::24) To DM5PR12MB1449.namprd12.prod.outlook.com (2603:10b6:4:10::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1988cb91-604f-4a2b-e06a-08d6f8d743c5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:DM5PR12MB2471; x-ms-traffictypediagnostic: DM5PR12MB2471: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1443; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(396003)(39860400002)(346002)(366004)(376002)(136003)(199004)(189003)(316002)(64756008)(66066001)(66446008)(186003)(5660300002)(68736007)(486006)(72206003)(6436002)(6512007)(14454004)(9686003)(476003)(86362001)(6486002)(99286004)(33716001)(446003)(14444005)(76176011)(3846002)(52116002)(6116002)(11346002)(2201001)(66556008)(25786009)(81156014)(8676002)(81166006)(110136005)(305945005)(7736002)(2501003)(103116003)(8936002)(478600001)(26005)(73956011)(66946007)(102836004)(2906002)(256004)(386003)(6506007)(71190400001)(71200400001)(66476007)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB2471;H:DM5PR12MB1449.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: tXNrZB35d6KEaWS1ztbz2FZlxn4FXHd3tE/avKo9C0w5iRCcoVxtZUXn8DHSCpiqfc26bMMKafclbzpic3FpuarxzGhuEba7EZeHYHzqCnMTUhdUKSTH7Wqdyqu8suvoGNuHKeFLIc73ZzfSJS1jUSllv4xj0Gu2RSy3lgia6uBe/gMsmZ6C0F/Ko50y9RBMzGLMHmSiGghVdK4uSfKeyhtolJkdsLpIctf5ijWm0oZ9mDNpUHMGS+C9t5LnTOMLLKLM0QRSrhcflsTYa7YPBfDoyInu5oTI6w9X7Oko/FX+/WCCwBi4tRyP0oLC+8vBjzwpUUnTgvPG93LTbbWXmYcN2mtIDOfl6zeH0nOEdI8eB26l3Ps80TW6WNfpOUuGr0WXiEp9cqW2N/LIwChbah1rcaFJuxNhMAKnPrmONsY= Content-ID: <3ADDB3C18D515143ADB1482D2612DA1E@namprd12.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1988cb91-604f-4a2b-e06a-08d6f8d743c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 19:07:56.0874 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ghook@amd.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2471 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Tidy up the formatting/grammar in crypto_engine.rst. Use lists where appropriate. Signed-off-by: Gary R Hook --- Documentation/crypto/crypto_engine.rst | 120 ++++++++++++++++++++++---------- 1 file changed, 82 insertions(+), 38 deletions(-) diff --git a/Documentation/crypto/crypto_engine.rst b/Documentation/crypto/crypto_engine.rst index 1d56221dfe35..18e3a9afa444 100644 --- a/Documentation/crypto/crypto_engine.rst +++ b/Documentation/crypto/crypto_engine.rst @@ -1,50 +1,94 @@ -============= -CRYPTO ENGINE +.. SPDX-License-Identifier: GPL-2.0 + +Crypto Engine ============= Overview -------- -The crypto engine API (CE), is a crypto queue manager. + +The crypto engine (CE) API is a crypto queue manager. Requirement ----------- -You have to put at start of your tfm_ctx the struct crypto_engine_ctx:: - struct your_tfm_ctx { - struct crypto_engine_ctx enginectx; - ... - }; +You must put, at the start of your transform context your_tfm_ctx, the structure +crypto_engine: + +:: -Why: Since CE manage only crypto_async_request, it cannot know the underlying -request_type and so have access only on the TFM. -So using container_of for accessing __ctx is impossible. -Furthermore, the crypto engine cannot know the "struct your_tfm_ctx", -so it must assume that crypto_engine_ctx is at start of it. + + struct your_tfm_ctx { + struct crypto_engine engine; + ... + }; + + +The crypto engine only manages asynchronous requests in the form of +crypto_async_request. It cannot know the underlying request type and thus only +has access to the transform structure. It is not possible to access the context +using container_of. In addition, the engine knows nothing about your +structure "``struct your_tfm_ctx``". The engine assumes (requires) the placement +of the known member ``struct crypto_engine`` at the beginning. Order of operations ------------------- -You have to obtain a struct crypto_engine via crypto_engine_alloc_init(). -And start it via crypto_engine_start(). - -Before transferring any request, you have to fill the enginectx. -- prepare_request: (taking a function pointer) If you need to do some processing before doing the request -- unprepare_request: (taking a function pointer) Undoing what's done in prepare_request -- do_one_request: (taking a function pointer) Do encryption for current request - -Note: that those three functions get the crypto_async_request associated with the received request. -So your need to get the original request via container_of(areq, struct yourrequesttype_request, base); - -When your driver receive a crypto_request, you have to transfer it to -the cryptoengine via one of: -- crypto_transfer_ablkcipher_request_to_engine() -- crypto_transfer_aead_request_to_engine() -- crypto_transfer_akcipher_request_to_engine() -- crypto_transfer_hash_request_to_engine() -- crypto_transfer_skcipher_request_to_engine() - -At the end of the request process, a call to one of the following function is needed: -- crypto_finalize_ablkcipher_request -- crypto_finalize_aead_request -- crypto_finalize_akcipher_request -- crypto_finalize_hash_request -- crypto_finalize_skcipher_request + +You are required to obtain a struct crypto_engine via ``crypto_engine_alloc_init()``. +Start it via ``crypto_engine_start()``. When finished with your work, shut down the +engine using ``crypto_engine_stop()`` and destroy the engine with +``crypto_engine_exit()``. + +Before transferring any request, you have to fill the context enginectx by +providing functions for the following: + +* ``prepare_crypt_hardware``: Called once before any prepare functions are + called. + +* ``unprepare_crypt_hardware``: Called once after all unprepare functions have + been called. + +* ``prepare_cipher_request``/``prepare_hash_request``: Called before each + corresponding request is performed. If some processing or other preparatory + work is required, do it here. + +* ``unprepare_cipher_request``/``unprepare_hash_request``: Called after each + request is handled. Clean up / undo what was done in the prepare function. + +* ``cipher_one_request``/``hash_one_request``: Handle the current request by + performing the operation. + +Note that these functions access the crypto_async_request structure +associated with the received request. You are able to retrieve the original +request by using: + +:: + + + container_of(areq, struct yourrequesttype_request, base); + + + +When your driver receives a crypto_request, you must to transfer it to +the crypto engine via one of: + +* ``crypto_transfer_ablkcipher_request_to_engine()`` + +* ``crypto_transfer_aead_request_to_engine()`` + +* ``crypto_transfer_akcipher_request_to_engine()`` + +* ``crypto_transfer_hash_request_to_engine()`` + +* ``crypto_transfer_skcipher_request_to_engine()`` + +At the end of the request process, a call to one of the following functions is needed: + +* ``crypto_finalize_ablkcipher_request()`` + +* ``crypto_finalize_aead_request()`` + +* ``crypto_finalize_akcipher_request()`` + +* ``crypto_finalize_hash_request()`` + +* ``crypto_finalize_skcipher_request()``