‹ BackHN Continuity

Thread

Git 3.0's upcoming SHA-256 default will be a costly mistake

570 points · 536 comments · chmaynard

  1. gandreani · · focus · HN ↗
    One of my favorite fun facts about Fossil SCM (another source control by the devs of sqlite) is that they patched their use of SHA1 6 days after the shattered attack was published:

    "Both Fossil and Git started out using only SHA1 hashes. But when the SHAttered attack against SHA1 was published on 2017-02-23, the need to migrate to a stronger hash algorithm was recognized. Fossil added the ability to use SHA3-256 as an alternative on 2017-03-01 (six days after the SHAttered attack was first published). SHA3-256 is now the default for all new repositories and check-ins in Fossil, though older check-ins that occurred prior to SHAttered can still use their original SHA1 hash. Hence, no repositories had to be rebuilt and no hyperlinks were broken."

    <a href="https:&#x2F;&#x2F;fossil-scm.org&#x2F;home&#x2F;doc&#x2F;trunk&#x2F;www&#x2F;hundredandone.md" rel="nofollow">https:&#x2F;&#x2F;fossil-scm.org&#x2F;home&#x2F;doc&#x2F;trunk&#x2F;www&#x2F;hundredandone.md

    To me it&#x27;s so interesting watching in realtime Git is still battling with this decision and for Fossil it was just another week of development.

    That whole page is fun to read. Another fun fact somewhere else in the docs is that Fossil uses a grow-only set to store commits. They came up with this scheme some years before it was formalized by CRDTs!

    1. 6thbit · · focus · HN ↗
      That&#x27;s impressive. I suppose they had a more flexible architecture to make that change so fast.

      Is there any writeup on why it was easy for them and not for git?

      1. gandreani · · focus · HN ↗
        Hmm probably nothing architecture wise. It&#x27;s probably just the fact that fossil is developed by way fewer devs.

        From the skim I read of this article it seems both projects arrived at the same solution: support both but make SHA-256 the default.

        1. kccqzy · · focus · HN ↗
          No it’s different. Git supports both but you cannot mix them in a repo. Fossil allows mixing them in a single repo. This is clearly stated in the link.
          1. xyzsparetimexyz · · focus · HN ↗
            They should let you mix it in a repo then.
            1. conartist6 · · focus · HN ↗
              They do apparently. There&#x27;s information about it in the comment thread on this story on lobste.rs
        2. rurban · · focus · HN ↗
          SHA3-256 != SHA-256
          1. gandreani · · focus · HN ↗
            Oops! I admit I don&#x27;t have much knowledge on hashing algos. I thought it was a shorthand
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.