lkml.org 
[lkml]   [2021]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/6] crypto: sm3 - create SM3 stand-alone library
From
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

\
 
 \ /
  Last update: 2021-12-22 14:12    [W:0.056 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site