Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1348524pxb; Fri, 24 Sep 2021 02:29:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgrJp+3q/qY/eohdG0TcXxmahxGX/3Gr6DoeR/tgT07M9wXQw5wm24fNE4PrNOdY5qRquc X-Received: by 2002:a05:6e02:4a4:: with SMTP id e4mr7505844ils.232.1632475762036; Fri, 24 Sep 2021 02:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632475762; cv=none; d=google.com; s=arc-20160816; b=jqXnIf0RDR+KVf2T+wk+AYnJlaw4XMCSF71b+FmYAaHCt9E6OYMTQ2hUQQMlUxSPhC zsPhiAcDkUFaWZRpo+AyUSW0dbyJ/3c2YoKaxjhvoMUk0EE/A+JdYf8jozGN7XSCSw+j KQEM6qP1eadp5rLe7vTRsbqDLzUo0u4HNrRy66GMhqk+Hzi4ncmaUg91Yq1Im5QULkMh UITlMX8MYVAbJfVrhlYmAeiDPJm+LGMn1fUWlEtz1xzKUyn6hmSp68phz49jnFPoU9DR Wf7KfKK/aiYvygUvR2ni7Xp0ng1SdhbNTdXGhSD5cGC/jF9aLy99CrP4m1JAoTNkoPt0 Hlzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ITVgKyluscCo/YCTVvazBMNXuDrT3VEzWozOqjkhNew=; b=LsHmb9JL/0AeGZRQxHIplg0ywNrH1dwbY088iQS9x6uazjWg6zamsuNu54qBc5pAYu j2X8jnzm7GpH2ndy7ZEIx+ziL3AcojH+7rV3p1bolkTBB9G25q6OLA7Ds8DQ9ikmURM6 OoRexA5jwE+gMAqxlopMhCml3xhydMXf4JBKGxBW3GFrYs5R+TRvrlxdvy7UqinRrw7+ bw9Qb9kTHz+4Kqk3IF0o0EjB2WaDw8VxVFuwvVkOB0HyI4JFVIpGd3bTnzFmXwbwGvWD foI4Me3yPyj3ZnM2kCUBcK4HghvYqkuSqFwI774F1HJGAA5Nwn5MC6NRApRH+5vNRBK0 ygzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si9883404ilh.66.2021.09.24.02.29.09; Fri, 24 Sep 2021 02:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245112AbhIXJa3 (ORCPT + 99 others); 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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(-) -- 2.33.0