Re: [PATCH 3/3] sha1: use char type for temporary work buffer
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 12, 2012, 18:42 UTC
- Message-ID
- <7v8vcfccbn.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <a8c30a998cad6a7b38bd983e7689a628567a8176.1347442430.git.ydroneaud@opteya.com>
Yann Droneaud <ydroneaud@opteya.com> writes:
Show 7 quoted lines
> The SHA context is holding a temporary buffer for partial block. > > This block must 64 bytes long. It is currently described as > an array of 16 integers. > > Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> > ---
As we do not work with 16-bit integers anyway, 16 integers occupy 64 bytes anyway.
What problem does this series fix?
Show 16 quoted lines
> block-sha1/sha1.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block-sha1/sha1.h b/block-sha1/sha1.h
> index b864df6..d29ff6a 100644
> --- a/block-sha1/sha1.h
> +++ b/block-sha1/sha1.h
> @@ -9,7 +9,7 @@
> typedef struct {
> unsigned long long size;
> unsigned int H[5];
> - unsigned int W[16];
> + unsigned char W[64];
> } blk_SHA_CTX;
>
> void blk_SHA1_Init(blk_SHA_CTX *ctx);