From: Bill Zaumen <bill.zaumen+git@gmail.com>
To: git@vger.kernel.org, peff@peff.net, pclouds@gmail.com, gitster@pobox.com
Subject: Patches for message-digest support.
Date: Tue, 20 Dec 2011 23:51:52 -0800 [thread overview]
Message-ID: <1324453912.1684.62.camel@yos> (raw)
I just sent a series of 6 patches, roughly similar to the ones I sent a
few weeks ago, but allowing a choice of message digests in addition to
a CRC (kept for testing purposes) - SHA-1, SHA-256, and SHA-512 with
more added easily. The current default is SHA-256. The use of SHA-1
for git object IDs is unchanged. Unlike the object-ID digest, the
additional digests do not include the Git object-header. I also changed
a number of function names, using "digest" or "mdigest" in them.
Searching for the string "digest" is a good way of finding things.
Finally, I added a header to commit messages (conditionally compiled so
this can be turned off) that contains a digest of digests plus some
other fields. I also broke it up into a series of smaller patches.
Just as a summary:
The first patch contains several new files. It uses a data structure
for message digests that keeps the bytes of a digest aligned on
32 or 64 bit boundaries to allow fast comparisons. The digests are
stored long with a one-byte code indicating the digest type. The code
handles storing and looking up the digests, including support for
alternate object databases.
The second patch modifies some of the existing git files (the major
changes are in sha1_file.c and pack-write.c) for storing message digests
when an object or a pack index file is created.
The third patch modifies the files in the builtin directory that contain
the implementation of git commands for packing and pruning objects, and
for verifying pack files and counting objects. The code does some
checks for hash collisions by comparing the digests. At this point,
each git object will have a digest that can be looked up given the
object's ID. This mapping is maintained as pack files are
created.
The fourth patch adds a digest header to commit messages. This header
contains a digest of the digests for the commit's parents and for each
object in the commit's tree, and of the other fields in the commit.
The digest header, like the rest of the commit, is used in computing the
commit's object ID and matching digest. A function verify_commit
checks the digest header by recomputing it and can be used as desired
for authentication or other purposes.
The fifth patch transfers the message digest corresponding to a SHA-1
ID during fetch or push operations to allow early detection of
collisions. This is a fast test - a simple lookup - and can be turned
off by removing the "mds-check" capability.
The sixth patch contains documentation.
Bill
next reply other threads:[~2011-12-21 7:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-21 7:51 Bill Zaumen [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-12-21 18:44 Patches for message-digest support Bill Zaumen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1324453912.1684.62.camel@yos \
--to=bill.zaumen+git@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/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.
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 NNTP newsgroup(s).