{"thread":{"id":"29226","subject":"Patches for message-digest support.","startedAt":"2011-12-21T07:51:52Z","lastAt":"2011-12-21T07:51:52Z","messageCount":1,"participants":["Bill Zaumen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"181568","messageId":"1324453912.1684.62.camel@yos","threadId":"29226","inReplyTo":null,"subject":"Patches for message-digest support.","fromName":"Bill Zaumen","fromEmail":"bill.zaumen+git@gmail.com","sentAt":"2011-12-21T07:51:52Z","receivedAt":"2011-12-21T07:51:52Z","isPatch":false,"sender":{"key":"bill.zaumen+git@gmail.com","avatar":null},"body":"\nI just sent a series of 6 patches, roughly similar to the ones I sent a\nfew weeks ago, but allowing a choice of message digests in addition to\na CRC (kept for testing purposes) - SHA-1, SHA-256, and SHA-512 with\nmore added easily.  The current default is SHA-256.  The use of SHA-1\nfor git object IDs is unchanged. Unlike the object-ID digest, the\nadditional digests do not include the Git object-header.  I also changed\na number of function names, using \"digest\" or \"mdigest\" in them.\nSearching for the string \"digest\" is a good way of finding things.\nFinally, I added a header to commit messages (conditionally compiled so\nthis can be turned off) that contains a digest of digests plus some\nother fields.  I also broke it up into a series of smaller patches.\n\nJust as a summary:\n\nThe first patch contains several new files.  It uses a data structure\nfor message digests that keeps the bytes of a digest aligned on\n32 or 64 bit boundaries to allow fast comparisons. The digests are\nstored long with a one-byte code indicating the digest type. The code\nhandles storing and looking up the digests, including support for\nalternate object databases.\n\nThe second patch modifies some of the existing git files (the major\nchanges are in sha1_file.c and pack-write.c) for storing message digests\nwhen an object or a pack index file is created.\n\nThe third patch modifies the files in the builtin directory that contain\nthe implementation of git commands for packing and pruning objects, and\nfor verifying pack files and counting objects.  The code does some\nchecks for hash collisions by comparing the digests.  At this point,\neach git object will have a digest that can be looked up given the\nobject's ID.  This mapping is maintained as pack files are\ncreated.\n\nThe fourth patch adds a digest header to commit messages.  This header\ncontains a digest of the digests for the commit's parents and for each\nobject in the commit's tree, and of the other fields in the commit.\nThe digest header, like the rest of the commit, is used in computing the\ncommit's object ID and matching digest.  A function verify_commit\nchecks the digest header by recomputing it and can be used as desired\nfor authentication or other purposes.\n\nThe fifth patch transfers the message digest corresponding to a SHA-1\nID during fetch or push operations to allow early detection of\ncollisions.  This is a fast test - a simple lookup - and can be turned\noff by removing the \"mds-check\" capability.\n\nThe sixth patch contains documentation.\n\nBill\n"}]}