Re: [PATCH v2 3/3] crypto: hisilicon/sec - fixes shash test error

2021-02-20 Thread liulongfang
On 2021/2/18 10:06, Herbert Xu wrote:
> On Thu, Feb 18, 2021 at 10:01:58AM +0800, liulongfang wrote:
>>
 diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c 
 b/drivers/crypto/hisilicon/sec2/sec_crypto.c
 index d2c4a2c..988faf7 100644
 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
 +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
 @@ -7,6 +7,7 @@
  #include 
  #include 
  #include 
 +#include 
>>>
>>> Please explain what exactly in this file needs this header file.
>>>
>>> As it stands you could just be hiding real bugs.
>>>
>>> Thanks,
>>>
>> The crypto_alloc_shash() interface in the header file
>> will be used in the function sec_aead_ctx_init(),
>> If this header file is not added, calling the interface
>> crypto_alloc_shash() during the initialization of the
>> aead algorithm will return an error.
> 
> This makes no sense whatsoever as crypto_alloc_shash is defiend
> by crypto/hash.h and you've already included that.
> 
> Cheers,
> 
On this kernel version, those modules set to Y will not use the sha512 
algorithm.
And our SEC module selects it "select CRYPTO_SHA512", so it is compiled into
ko: "sha512_generic.ko".
Because we did not load the "sha512_generic.ko" when we loaded the ko of SEC,
the sha512 algorithm test failed, Therefore, before using SEC,
we need to load this ko first, so this patch is not required, please ignore it.
Thanks
Longfang.


Re: [PATCH v2 3/3] crypto: hisilicon/sec - fixes shash test error

2021-02-17 Thread Herbert Xu
On Thu, Feb 18, 2021 at 10:01:58AM +0800, liulongfang wrote:
>
> >> diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c 
> >> b/drivers/crypto/hisilicon/sec2/sec_crypto.c
> >> index d2c4a2c..988faf7 100644
> >> --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
> >> +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
> >> @@ -7,6 +7,7 @@
> >>  #include 
> >>  #include 
> >>  #include 
> >> +#include 
> > 
> > Please explain what exactly in this file needs this header file.
> > 
> > As it stands you could just be hiding real bugs.
> > 
> > Thanks,
> > 
> The crypto_alloc_shash() interface in the header file
> will be used in the function sec_aead_ctx_init(),
> If this header file is not added, calling the interface
> crypto_alloc_shash() during the initialization of the
> aead algorithm will return an error.

This makes no sense whatsoever as crypto_alloc_shash is defiend
by crypto/hash.h and you've already included that.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v2 3/3] crypto: hisilicon/sec - fixes shash test error

2021-02-17 Thread liulongfang
On 2021/2/10 14:43, Herbert Xu Wrote:
> On Sun, Feb 07, 2021 at 06:04:40PM +0800, Longfang Liu wrote:
>> If the header file "crypto/internal/hash.h" not
>> added, the allocation of crypto_tfm will fail when
>> the shash algorithm calculates the hash
>> through the software.
>>
>> Signed-off-by: Longfang Liu 
>> ---
>>  drivers/crypto/hisilicon/sec2/sec_crypto.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c 
>> b/drivers/crypto/hisilicon/sec2/sec_crypto.c
>> index d2c4a2c..988faf7 100644
>> --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
>> +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
>> @@ -7,6 +7,7 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
> 
> Please explain what exactly in this file needs this header file.
> 
> As it stands you could just be hiding real bugs.
> 
> Thanks,
> 
The crypto_alloc_shash() interface in the header file
will be used in the function sec_aead_ctx_init(),
If this header file is not added, calling the interface
crypto_alloc_shash() during the initialization of the
aead algorithm will return an error.
Thanks,


Re: [PATCH v2 3/3] crypto: hisilicon/sec - fixes shash test error

2021-02-09 Thread Herbert Xu
On Sun, Feb 07, 2021 at 06:04:40PM +0800, Longfang Liu wrote:
> If the header file "crypto/internal/hash.h" not
> added, the allocation of crypto_tfm will fail when
> the shash algorithm calculates the hash
> through the software.
> 
> Signed-off-by: Longfang Liu 
> ---
>  drivers/crypto/hisilicon/sec2/sec_crypto.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c 
> b/drivers/crypto/hisilicon/sec2/sec_crypto.c
> index d2c4a2c..988faf7 100644
> --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
> +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
> @@ -7,6 +7,7 @@
>  #include 
>  #include 
>  #include 
> +#include 

Please explain what exactly in this file needs this header file.

As it stands you could just be hiding real bugs.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


[PATCH v2 3/3] crypto: hisilicon/sec - fixes shash test error

2021-02-07 Thread Longfang Liu
If the header file "crypto/internal/hash.h" not
added, the allocation of crypto_tfm will fail when
the shash algorithm calculates the hash
through the software.

Signed-off-by: Longfang Liu 
---
 drivers/crypto/hisilicon/sec2/sec_crypto.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c 
b/drivers/crypto/hisilicon/sec2/sec_crypto.c
index d2c4a2c..988faf7 100644
--- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
+++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
@@ -7,6 +7,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.8.1