All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
To: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Vitaly Chikunov <vt@altlinux.org>,
	Eric Biggers <ebiggers@google.com>,
	Eric Biggers <ebiggers@kernel.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Jussi Kivilinna <jussi.kivilinna@iki.fi>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	x86@kernel.org, Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/6] crypto: sm3 - create SM3 stand-alone library
Date: Wed, 22 Dec 2021 21:11:39 +0800	[thread overview]
Message-ID: <e1d10668-3928-8b38-92d0-e92d26e20bef@linux.alibaba.com> (raw)
In-Reply-To: <CAOtvUMehn2_HW+b0etPKAV+H=V=PoENkO1xAdL78dCuHma4m_A@mail.gmail.com>

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@linux.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@benyosef.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

WARNING: multiple messages have this Message-ID (diff)
From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
To: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Vitaly Chikunov <vt@altlinux.org>,
	Eric Biggers <ebiggers@google.com>,
	Eric Biggers <ebiggers@kernel.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Jussi Kivilinna <jussi.kivilinna@iki.fi>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	x86@kernel.org, Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/6] crypto: sm3 - create SM3 stand-alone library
Date: Wed, 22 Dec 2021 21:11:39 +0800	[thread overview]
Message-ID: <e1d10668-3928-8b38-92d0-e92d26e20bef@linux.alibaba.com> (raw)
In-Reply-To: <CAOtvUMehn2_HW+b0etPKAV+H=V=PoENkO1xAdL78dCuHma4m_A@mail.gmail.com>

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@linux.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@benyosef.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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-12-22 13:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  4:50 [PATCH v2 0/6] Introduce x86 assembly accelerated implementation for SM3 algorithm Tianjia Zhang
2021-12-22  4:50 ` Tianjia Zhang
2021-12-22  4:50 ` [PATCH v2 1/6] crypto: sm3 - create SM3 stand-alone library Tianjia Zhang
2021-12-22  4:50   ` Tianjia Zhang
2021-12-22  6:59   ` Gilad Ben-Yossef
2021-12-22  6:59     ` Gilad Ben-Yossef
2021-12-22 13:11     ` Tianjia Zhang [this message]
2021-12-22 13:11       ` Tianjia Zhang
2021-12-22  4:50 ` [PATCH v2 2/6] crypto: arm64/sm3-ce - make dependent on sm3 library Tianjia Zhang
2021-12-22  4:50   ` Tianjia Zhang
2021-12-31  7:05   ` liulongfang
2021-12-31  7:05     ` liulongfang
2021-12-31 11:00     ` Tianjia Zhang
2021-12-31 11:00       ` Tianjia Zhang
2021-12-22  4:50 ` [PATCH v2 3/6] crypto: sm2 " Tianjia Zhang
2021-12-22  4:50   ` Tianjia Zhang
2021-12-22  4:50 ` [PATCH v2 4/6] crypto: sm3 " Tianjia Zhang
2021-12-22  4:50   ` Tianjia Zhang
2021-12-22  4:50 ` [PATCH v2 5/6] crypto: x86/sm3 - add AVX assembly implementation Tianjia Zhang
2021-12-22  4:50   ` Tianjia Zhang
2021-12-22  4:50 ` [PATCH v2 6/6] crypto: tcrypt - add asynchronous speed test for SM3 Tianjia Zhang
2021-12-22  4:50   ` Tianjia Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1d10668-3928-8b38-92d0-e92d26e20bef@linux.alibaba.com \
    --to=tianjia.zhang@linux.alibaba.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers@google.com \
    --cc=ebiggers@kernel.org \
    --cc=gilad@benyossef.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=jussi.kivilinna@iki.fi \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vt@altlinux.org \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.