From patchwork Fri Sep 24 09:27:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 12514653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2AA7C433F5 for ; Fri, 24 Sep 2021 09:28:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2C6660FDC for ; Fri, 24 Sep 2021 09:28:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245112AbhIXJa3 (ORCPT ); Fri, 24 Sep 2021 05:30:29 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:16293 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244959AbhIXJaZ (ORCPT ); Fri, 24 Sep 2021 05:30:25 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HG6C774sjz8tQH; Fri, 24 Sep 2021 17:28:03 +0800 (CST) Received: from dggpeml500012.china.huawei.com (7.185.36.15) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 24 Sep 2021 17:28:47 +0800 Received: from huawei.com (10.69.192.56) by dggpeml500012.china.huawei.com (7.185.36.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 24 Sep 2021 17:28:47 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH v2 0/6] crypto: hisilicon - supports hash algorithm for SEC engine Date: Fri, 24 Sep 2021 17:27:10 +0800 Message-ID: <20210924092716.12848-1-yekai13@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500012.china.huawei.com (7.185.36.15) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The driver adds hash algorithms, sm3, md5, sha1, sha256, sha512. Add fallback tfm supporting. Modify the driver as needed. The fuzzing test has been passed. changes v1->v2: 1. Modify the process of export and import. Using the ahash_req as hash state. By copying the content of structure sec_ahash_req to avoid dereferencing random pointers from import path. User can export the hash state and then import the hash state, and it still work. 2. Add sm3/md5 generic selection Kai Ye (6): crypto: hisilicon/sec - add ping-pong buffer for ahash crypto: hisilicon/sec - add ahash alg features for Kunpeng920 crypto: hisilicon/sec - support the larger packets for digest mode crypto: hisilicon/sec - ahash adapt to Kunpeng930 SQE crypto: hisilicon/sec - add fallback tfm supporting for ahash crypto: hisilicon/sec - add sm3/md5 generic selection for ahash drivers/crypto/hisilicon/Kconfig | 2 + drivers/crypto/hisilicon/sec2/sec.h | 52 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 1323 +++++++++++++++++++- drivers/crypto/hisilicon/sec2/sec_crypto.h | 9 + 4 files changed, 1369 insertions(+), 17 deletions(-)