diff options
Diffstat (limited to 'Documentation/technical/hash-function-transition.adoc')
| -rw-r--r-- | Documentation/technical/hash-function-transition.adoc | 46 | 
1 files changed, 25 insertions, 21 deletions
| diff --git a/Documentation/technical/hash-function-transition.adoc b/Documentation/technical/hash-function-transition.adoc index f047fd80ca..2359d7d106 100644 --- a/Documentation/technical/hash-function-transition.adoc +++ b/Documentation/technical/hash-function-transition.adoc @@ -227,9 +227,9 @@ network byte order):      ** 4-byte length in bytes of shortened object names. This is the        shortest possible length needed to make names in the shortened        object name table unambiguous. -    ** 4-byte integer, recording where tables relating to this format +    ** 8-byte integer, recording where tables relating to this format        are stored in this index file, as an offset from the beginning. -  * 4-byte offset to the trailer from the beginning of this file. +  * 8-byte offset to the trailer from the beginning of this file.    * Zero or more additional key/value pairs (4-byte key, 4-byte      value). Only one key is supported: 'PSRC'. See the "Loose objects      and unreachable objects" section for supported values and how this @@ -260,12 +260,10 @@ network byte order):      compressed data to be copied directly from pack to pack during      repacking without undetected data corruption. -  * A table of 4-byte offset values. For an object in the table of -    sorted shortened object names, the value at the corresponding -    index in this table indicates where that object can be found in -    the pack file. These are usually 31-bit pack file offsets, but -    large offsets are encoded as an index into the next table with the -    most significant bit set. +  * A table of 4-byte offset values. The index of this table in pack order +    indicates where that object can be found in the pack file. These are +    usually 31-bit pack file offsets, but large offsets are encoded as +    an index into the next table with the most significant bit set.    * A table of 8-byte offset entries (empty for pack files less than      2 GiB). Pack files are organized with heavily used objects toward @@ -276,10 +274,14 @@ network byte order):    up to and not including the table of CRC32 values.  - Zero or more NUL bytes.  - The trailer consists of the following: -  * A copy of the 20-byte SHA-256 checksum at the end of the +  * A copy of the full main hash checksum at the end of the      corresponding packfile. -  * 20-byte SHA-256 checksum of all of the above. +  * Full main hash checksum of all of the above. + +The "full main hash" is a full-length hash of the main (not compatibility) +algorithm in the repository.  Thus, if the main algorithm is SHA-256, this is +a 32-byte SHA-256 hash and for SHA-1, it's a 20-byte SHA-1 hash.  Loose object index  ~~~~~~~~~~~~~~~~~~ @@ -427,17 +429,19 @@ ordinary unsigned commit.  Signed Tags  ~~~~~~~~~~~ -We add a new field "gpgsig-sha256" to the tag object format to allow -signing tags without relying on SHA-1. Its signed payload is the -SHA-256 content of the tag with its gpgsig-sha256 field and "-----BEGIN PGP -SIGNATURE-----" delimited in-body signature removed. - -This means tags can be signed - -1. using SHA-1 only, as in existing signed tag objects -2. using both SHA-1 and SHA-256, by using gpgsig-sha256 and an in-body -   signature. -3. using only SHA-256, by only using the gpgsig-sha256 field. +We add new fields "gpgsig" and "gpgsig-sha256" to the tag object format to +allow signing tags in both formats.  The in-body signature is used for the +signature in the current hash algorithm and the header is used for the +signature in the other algorithm.  Thus, a dual-signature tag will contain both +an in-body signature and a gpgsig-sha256 header for the SHA-1 format of an +object or both an in-body signature and a gpgsig header for the SHA-256 format +of and object. + +The signed payload of the tag is the content of the tag in the current +algorithm with both its gpgsig and gpgsig-sha256 fields and +"-----BEGIN PGP SIGNATURE-----" delimited in-body signature removed. + +This means tags can be signed using one or both algorithms.  Mergetag embedding  ~~~~~~~~~~~~~~~~~~ | 
