Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3219921pxb; Sun, 7 Feb 2021 01:51:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBhHGKt8aPY8pfE6Qe/q01H3YDT4j17i5nCV0e6WpfycrngL5IDZkWD98HKpNEr4w5s84j X-Received: by 2002:a17:906:82c9:: with SMTP id a9mr11921178ejy.547.1612691484017; Sun, 07 Feb 2021 01:51:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612691484; cv=none; d=google.com; s=arc-20160816; b=yGDBc2XB3uyHIYe1evm7KkUm6BkjeCxMCXfqI/M887VkxKcLo8cj8nXIU7GGunnR0D VTNusXfR0h4BD0BJaj3mitnuZgwOB6KKlfNkUWrDMZ2jmr4Awv29yqFpa/eYWSQ86vVH priPZq2+4iu+ZmNr6dXon7Ch0KPUL8Tq+5Cmz9CpWw4DddtwecCsLk6pJXSD98kJ9MFn 96VjV83Alv80pYoZDB3uI9/D7IJdtudXDU8BmsaaUlAmmQLUpeHljAdh4+KcLEPn3Z11 yMelayT3haV/phoQlueIdO1cjO4tNz88llXHMc3MSH4s0MMDR3NIE7ua2HsHbU4pTt3b fYIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=AZA5IajzTF3121qzop72z8ViwatX1+AyLr7DzLUtJSc=; b=KnaEv3pYEYuHGBqcMZE7BUVdFpFr3gAwR3JARd38gJQesk+B6NzQQ/wSEKIXd7me/m FRrX9oFyIcS+6b2GQcgE76f9AAUY+LvmxSIDOI57cjDs/La1NNDyXdrC69MQCBOWApX5 S8w4Ll0zFZXw3riNAgvMXiomEjG+mxs+Efej+smJDmHSs52uiDIBM3Q7plDFapAmg/+D FuEtNd7vUDqDDPWXTtIZl1LZfn1FQrlV9m5XyRlGSLQh+X5C9E/siBUhBI0ogepkSiph fd6bg3nZy6knhZbGvvJCQZmdcK7CHFiv0w30jph7NOW0EFCR6cC8gzoIoBaXNHrzmJgP 9K2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb9si10642274ejb.162.2021.02.07.01.51.00; Sun, 07 Feb 2021 01:51:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229707AbhBGJuD (ORCPT + 99 others); Sun, 7 Feb 2021 04:50:03 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:12445 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbhBGJtw (ORCPT ); Sun, 7 Feb 2021 04:49:52 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DYPTv5vDszjGFZ; Sun, 7 Feb 2021 17:48:03 +0800 (CST) Received: from [10.67.102.118] (10.67.102.118) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Sun, 7 Feb 2021 17:49:03 +0800 Subject: Re: [PATCH 3/3] crypto: hisilicon/sec - fixes shash test error To: Ard Biesheuvel CC: Herbert Xu , , "Zaibo Xu" , Linux Crypto Mailing List , Linux Kernel Mailing List References: <1612519857-30714-1-git-send-email-liulongfang@huawei.com> <1612519857-30714-4-git-send-email-liulongfang@huawei.com> <20210205114435.GA17031@gondor.apana.org.au> <70c0e041-9bcc-aa67-a0ad-a1a202f2e708@huawei.com> From: liulongfang Message-ID: <29e527d9-5b0e-5054-b0b4-d8b72e1c917c@huawei.com> Date: Sun, 7 Feb 2021 17:49:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.118] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/7 16:02, Ard Biesheuvel wrote: > On Sun, 7 Feb 2021 at 03:47, liulongfang wrote: >> >> On 2021/2/5 19:44, Herbert Xu write: >>> On Fri, Feb 05, 2021 at 06:10:57PM +0800, Longfang Liu wrote: >>>> If this configuration item is not turned on, >>>> the allocation of crypto_tfm will fail when >>>> the shash algorithm calculates the hash >>>> through the software. >>>> >>>> Signed-off-by: Longfang Liu >>>> --- >>>> arch/arm64/configs/defconfig | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig >>>> index 8383016..7cfc9b6 100644 >>>> --- a/arch/arm64/configs/defconfig >>>> +++ b/arch/arm64/configs/defconfig >>>> @@ -117,7 +117,7 @@ CONFIG_KVM=y >>>> CONFIG_ARM64_CRYPTO=y >>>> CONFIG_CRYPTO_SHA1_ARM64_CE=y >>>> CONFIG_CRYPTO_SHA2_ARM64_CE=y >>>> -CONFIG_CRYPTO_SHA512_ARM64_CE=m >>>> +CONFIG_CRYPTO_SHA512_ARM64_CE=y >>> >>> If this is truly needed then it should be enabled through Kconfig. >>> >>> Cheers, >>> >> Hi Herbert, >> The option select CRYPTO_SHA512 already exists in Kconfig. > > In that case, how can the shash TFM allocation fail? > Hi After comparison and investigation, the problem is that the header file "crypto/internal/hash.h" is not added. After adding this header file, which CRYPTO_SHA512_ARM64_C compilation option does not need to be enabled. I will modify it in the next patch. >> Can I change it to this: select CRYPTO_SHA512 || CRYPTO_SHA512_ARM64_CE > > No, you cannot select expressions like that. > > Could you please explain the problem you are trying to solve? > . > When allocation shash TFM with hmac(sha512)-cbc(aes) algorithm, TFM will return an error. Thanks Longfang.