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

Re: [PATCH] sha1dc: fix issues with a big endian platform

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 17, 2017, 15:26 UTC
Message-ID
<alpine.DEB.2.21.1.1705171722440.3610@virtualbox>
In-Reply-To
<xmqq37c4xcr6.fsf_-_@gitster.mtv.corp.google.com>
Hi Junio,
On Wed, 17 May 2017, Junio C Hamano wrote:
Show 21 quoted lines
> diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c
> index 35e9dd5bf4..ae25318c47 100644
> --- a/sha1dc/sha1.c
> +++ b/sha1dc/sha1.c
> @@ -20,7 +20,7 @@
>   */
>  #if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || \
>      (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __BIG_ENDIAN__)) || \
> -    defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) ||  defined(__AARCH64EB__) || \
> +    defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) ||  defined(__AARCH64EB__) || \
>      defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
>  
>  #define SHA1DC_BIGENDIAN	1
> @@ -1728,7 +1728,8 @@ void SHA1DCUpdate(SHA1_CTX* ctx, const char* buf, size_t len)
>  	while (len >= 64)
>  	{
>  		ctx->total += 64;
> -		sha1_process(ctx, (uint32_t*)(buf));
> +		memcpy(ctx->buffer, buf, 64);
> +		sha1_process(ctx, (uint32_t*)(ctx->buffer));
>  		buf += 64;
There is actually a discussion going on about this. See
https://github.com/cr-marcstevens/sha1collisiondetection/commit/33a694a9ee1b79c24be45f9eab5ac0e1aeeaf271#commitcomment-22158243
for details.
The fixup commit under discussion is here:
https://github.com/cr-marcstevens/sha1collisiondetection/commit/40f07a0c12d525b24ac1235ee8a81bbf33957ca5

Ciao, dscho

Previous: Brandon Williams
Message 17 of 17 in “Git 2.13.0 segfaults on Solaris SPARC due to DC_SHA1=YesPlease being on by default”
  1. Ævar Arnfjörð BjarmasonMay 15, 2017
  2. Marc StevensMay 15, 2017
  3. Ævar Arnfjörð BjarmasonMay 15, 2017
  4. Jeff KingMay 15, 2017
  5. demerphqJun 1, 2017
  6. Michael KebeMay 16, 2017
  7. sha1dc: fix issues with a big endian platformJunio C Hamano, May 17, 2017
  8. Ævar Arnfjörð BjarmasonMay 17, 2017
  9. Junio C HamanoMay 17, 2017
  10. 0/3 Use sha1collisiondetection as a submoduleÆvar Arnfjörð Bjarmason, May 17, 2017
  11. 1/3 sha1dc: update from my fork of upstreamÆvar Arnfjörð Bjarmason, May 17, 2017
  12. 2/3 sha1dc: use sha1collisiondetection as a submoduleÆvar Arnfjörð Bjarmason, May 17, 2017
  13. Stefan BellerMay 17, 2017
  14. Ævar Arnfjörð BjarmasonMay 17, 2017
  15. Stefan BellerMay 17, 2017
  16. Brandon WilliamsMay 18, 2017
  17. Johannes SchindelinMay 17, 2017

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.