lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 29 Oct 2015 09:16:27 -0700
From:	Tim Chen <tim.c.chen@...ux.intel.com>
To:	LABBE Corentin <clabbe.montjoie@...il.com>
Cc:	tglx@...utronix.de, ameenali023@...il.com, bp@...en8.de,
	dan.carpenter@...cle.com, davem@...emloft.net, firogm@...il.com,
	herbert@...dor.apana.org.au, hpa@...or.com, mingo@...hat.com,
	minipli@...glemail.com, smueller@...onox.de, x86@...nel.org,
	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: x86: Remove duplicate define of SHA1_DIGEST_SIZE

On Thu, 2015-10-29 at 08:51 +0100, LABBE Corentin wrote:
> On Fri, Oct 16, 2015 at 09:04:58AM -0700, Tim Chen wrote:
> > On Wed, 2015-10-14 at 21:15 +0200, LABBE Corentin wrote:
> > > The sha x86 crypto code use two define for the same thing:
> > > NUM_SHA1_DIGEST_WORDS and SHA1_DIGEST_LENGTH
> > > Replace them by SHA1_DIGEST_SIZE/4
> > 
> > Thanks.  Acked-by: Tim Chen <tim.c.chen@...ux.intel.com>
> > > 
> > > Signed-off-by: LABBE Corentin <clabbe.montjoie@...il.com>
> > 
> 
> Hello
> 
> Thanks for your ack, but Thomas Gleixner in the same time NACK this patch.
> Just in case I attach the new patch, for permit you to decide which one you prefer.
> 
> Regards

Looks fine.  But wonder if you should have
#define SHA1_DIGEST_WORDS (SHA1_DIGEST_SIZE / sizeof(u32))

moved to sha1.h

Tim
> 

> diff --git a/arch/x86/crypto/sha-mb/sha_mb_ctx.h b/arch/x86/crypto/sha-mb/sha_mb_ctx.h
> index e36069d..9fd36eb5 100644
> --- a/arch/x86/crypto/sha-mb/sha_mb_ctx.h
> +++ b/arch/x86/crypto/sha-mb/sha_mb_ctx.h
> @@ -94,7 +94,6 @@ enum hash_ctx_error {
>  
> 
>  /* Hash Constants and Typedefs */
> -#define SHA1_DIGEST_LENGTH          5
>  #define SHA1_LOG2_BLOCK_SIZE        6
>  
>  #define SHA1_PADLENGTHFIELD_SIZE    8
> diff --git a/arch/x86/crypto/sha-mb/sha_mb_mgr.h b/arch/x86/crypto/sha-mb/sha_mb_mgr.h
> index 08ad1a9..b295e15 100644
> --- a/arch/x86/crypto/sha-mb/sha_mb_mgr.h
> +++ b/arch/x86/crypto/sha-mb/sha_mb_mgr.h
> @@ -54,10 +54,10 @@
>  #ifndef __SHA_MB_MGR_H
>  #define __SHA_MB_MGR_H
>  
> -
> +#include <crypto/sha.h>
>  #include <linux/types.h>
>  
> -#define NUM_SHA1_DIGEST_WORDS 5
> +#define SHA1_DIGEST_WORDS (SHA1_DIGEST_SIZE / sizeof(u32))

Suggest to move SHA1_DIGEST_WORDS to sha1.h

Tim



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ