git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: Hans Petter Selasky <hps@selasky.org>
Cc: rsbecker@nexbridge.com, git@vger.kernel.org
Subject: Re: Gitorious should use CRC128 / 256 / 512 instead of SHA-1
Date: Fri, 13 Jan 2023 11:27:21 -0500	[thread overview]
Message-ID: <20230113162721.qwl2asjo542cxe3c@meerkat.local> (raw)
In-Reply-To: <a2e6fdc3-fbb0-821c-078f-1ad4e55dc8e3@selasky.org>

On Fri, Jan 13, 2023 at 05:06:57PM +0100, Hans Petter Selasky wrote:
> OK, if you say so. Though in my mind 46K rebases of millions of commits seem
> a lot overhead.

Not to discourage you, but you seem to be making statements without a good
understanding of how git works. If there is a history rewrite (even one that
for some reason goes back millions of commits) all hash calculations will
happen exactly once -- on the system of the person who's rewriting the
history. After they push it, it's just a bunch of objects that everyone else
merely downloads.

> However, if history can be edited anyway, why do you need the cryptographic
> hash algorithm. Why not use a non-cryptographic one?

The answer is, unhelpfully, "because that's how git works." Every commit is a
standalone object that references the previous commit, plus includes hashes of
all trees, and those include hashes of all blobs. SHA-1 was picked because of
its speed and the fact that it guarantees an extremely low potential for
collisions (even better with SHA256). As a side-effect, it's easy to calculate
the integrity of the entire tree, including its history, by verifying its
hashes (this is what git fsck does).

Hashes aren't really "cryptographic" anyway (they just happen to be used all
over the place in cryptography). It's really just a one-way function to reduce
content of arbitrary size to a set of bytes of a determined size (and give a
relatively high assurance of it being collision-free).

-K

  parent reply	other threads:[~2023-01-13 16:34 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 12:59 Gitorious should use CRC128 / 256 / 512 instead of SHA-1 Hans Petter Selasky
2023-01-13 13:30 ` Konstantin Khomoutov
2023-01-13 13:39   ` Hans Petter Selasky
2023-01-13 14:21     ` rsbecker
2023-01-13 14:42       ` Hans Petter Selasky
2023-01-13 15:45         ` Konstantin Ryabitsev
2023-01-13 15:50           ` Hans Petter Selasky
2023-01-13 15:56             ` rsbecker
2023-01-13 16:02               ` Hans Petter Selasky
2023-01-13 15:54           ` Hans Petter Selasky
2023-01-13 16:02             ` Konstantin Ryabitsev
2023-01-13 16:06               ` Hans Petter Selasky
2023-01-13 16:18                 ` Hans Petter Selasky
2023-01-13 16:36                   ` Konstantin Ryabitsev
2023-01-13 16:44                     ` Hans Petter Selasky
2023-01-13 16:49                       ` Konstantin Ryabitsev
2023-01-13 16:51                         ` Hans Petter Selasky
2023-01-13 16:27                 ` Konstantin Ryabitsev [this message]
2023-01-13 16:30                   ` Hans Petter Selasky
2023-01-13 16:35                   ` Hans Petter Selasky
2023-01-13 16:41                     ` Konstantin Ryabitsev
2023-01-13 16:45                       ` Hans Petter Selasky
2023-01-13 15:15       ` Hans Petter Selasky
2023-01-13 17:44       ` Philip Oakley
2023-01-13 15:30     ` Konstantin Khomoutov
2023-01-13 15:39     ` Konstantin Ryabitsev
  -- strict thread matches above, loose matches on Subject: below --
2023-01-13 13:23 Hans Petter Selasky
2023-01-14 23:59 ` brian m. carlson
2023-01-15  3:14   ` Junio C Hamano
2023-01-15 10:09   ` demerphq
2023-01-16  7:21   ` Hans Petter Selasky
2023-01-16  7:23   ` Hans Petter Selasky
2023-01-16 12:34     ` rsbecker
2023-01-16 14:01       ` Hans Petter Selasky
2023-01-16 15:06         ` Junio C Hamano
2023-01-15 13:53 ` Michal Suchánek
2023-01-16  7:17   ` Hans Petter Selasky
2023-01-16  9:13     ` Michal Suchánek
2023-01-16  9:55       ` Hans Petter Selasky
2023-01-16 12:31         ` rsbecker
2023-01-16 14:10           ` Hans Petter Selasky
2023-01-16 19:08         ` Michal Suchánek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230113162721.qwl2asjo542cxe3c@meerkat.local \
    --to=konstantin@linuxfoundation.org \
    --cc=git@vger.kernel.org \
    --cc=hps@selasky.org \
    --cc=rsbecker@nexbridge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).