[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e1d10668-3928-8b38-92d0-e92d26e20bef@linux.alibaba.com>
Date: Wed, 22 Dec 2021 21:11:39 +0800
From: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
To: Gilad Ben-Yossef <gilad@...yossef.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Vitaly Chikunov <vt@...linux.org>,
Eric Biggers <ebiggers@...gle.com>,
Eric Biggers <ebiggers@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>,
Jussi Kivilinna <jussi.kivilinna@....fi>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
x86@...nel.org, Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/6] crypto: sm3 - create SM3 stand-alone library
Hi Gilad,
On 12/22/21 2:59 PM, Gilad Ben-Yossef wrote:
> On Wed, Dec 22, 2021 at 6:50 AM Tianjia Zhang
> <tianjia.zhang@...ux.alibaba.com> wrote:
>>
>> Stand-alone implementation of the SM3 algorithm. It is designed
>> to have as little dependencies as possible. In other cases you
>> should generally use the hash APIs from include/crypto/hash.h.
>> Especially when hashing large amounts of data as those APIs may
>> be hw-accelerated. In the new SM3 stand-alone library,
>> sm3_compress() has also been optimized, instead of simply using
>> the code in sm3_generic.
>>
>
> I have a really minor nitpick: the commit message talks about changes
> to sm3_compress() which was there in the original code but there is no
> such function in the current code which is in a different patch and
> file, so if you do another iteration for other reason, perhaps change
> the commit message to refer to sm3_transform() instead? it's not
> really important enough to warrant a new iteration on it's own...
>
> Otherwise, I'm not smart enough to evaluate the changes to
> sm3_transform() cryptographically but the overall approach of moving
> to a standalone library seems sane to me.
>
> So, for what it's worth -
>
> Reviewed-by: Gilad Ben-Yossef <gilad@...yosef.com>
>
> Gilad
>
Thanks for your suggestion. I agree with you. In the implementation of
sm3_generic, sm3_compress() is a sub-function of sm3_transform(). The
optimization is indeed for sm3_transform(). I will fix it in the next patch.
Best regards,
Tianjia
Powered by blists - more mailing lists