git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] block-sha1: make the size member first in the context struct

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 18, 2009, 00:24 UTC
Message-ID
<alpine.DEB.1.00.0908180223280.8306@pacific.mpi-cbg.de>
In-Reply-To
<alpine.LFD.2.00.0908172012591.6044@xanadu.home>
Hi,
On Mon, 17 Aug 2009, Nicolas Pitre wrote:
Show 18 quoted lines
> This is a 64-bit value, hence having it first provides a better 
> alignment.
> 
> Signed-off-by: Nicolas Pitre <nico@cam.org>
> 
> diff --git a/block-sha1/sha1.h b/block-sha1/sha1.h
> index 6ff59b2..b864df6 100644
> --- a/block-sha1/sha1.h
> +++ b/block-sha1/sha1.h
> @@ -7,9 +7,9 @@
>   */
>  
>  typedef struct {
> +	unsigned long long size;
>  	unsigned int H[5];
>  	unsigned int W[16];
> -	unsigned long long size;
>  } blk_SHA_CTX;

By the reasoning suggested in the commit message, should H[5] not go to the end?

Ciao, Dscho

Previous: Nicolas PitreNext: Nicolas Pitre
Message 2 of 3 in “block-sha1: make the size member first in the context struct”
  1. block-sha1: make the size member first in the context structNicolas Pitre, Aug 18, 2009
  2. Johannes SchindelinAug 18, 2009
  3. Nicolas PitreAug 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.