TIGR
From DCBase Wiki
Contents |
TIGR - Tiger tree hash support
Note: Since this is the only hash extension currently specified, it's mandatory for ADC software among with BASE support.
General
This extension is included in ADC 1.0, though approved and in use.
This extension adds Tiger tree hash support to the base protocol. It is intended to be used both for identifying files and for purposes such as CID generation and password negotiation.
All files shared by TIGR supporting clients must have been hashed using Merkle Hash trees, as defined by http://www.open-content.net/specs/draft-jchapweske-thex-02.html. The Tiger algorithm, as specified by http://www.cs.technion.ac.il/~biham/Reports/Tiger/, functions as the hash algorithm. A base segment size of 1024 bytes must be used when generating the tree, but clients may then discard parts of the tree as long as at least 7 levels are kept or a block granularity of 64 KiB is achieved.
Generally, the root of the tree (TTH) serves to identify a file uniquely. Searches use it and it must be present in the file list. Further, the root of the file list must also be available and discoverable via GFI. A client may also request the rest of the tree using the normal client-client transfer procedure. The root must be encoded using base32 encoding when converted to text.
In the file list, each File element carries an additional attribute "TTH" containing the base32-encoded value of the Tiger tree root.
In the GET/GFI type, the full tree may be accessed using the "tthl" type.
"tthl" transfers send the largest set of leaves available) as a binary stream of leaf data, right-to-left, with no spacing in between them. <start_pos> must be set to 0 and <bytes> to -1 when requesting the data. <bytes> must contain the total binary size of the leaf stream in SND; by dividing this length by the individual hash length, the number of leaves, and thus the leaf level, can be deducted. The received leaves can then be used to reconstruct the entire tree, and the resulting root must match the root of the file (this verifies the integrity of the tree itself). Identifier must be a TTH root value from the "TTH/" root.
In the GET/GFI namespace, files are identified by "TTH/<base32-encoded tree root>".
In SCH and GFI, the following attributes are added:
| TR | Tiger tree Hash root, encoded with base32. |
| TD | Tree depth, index of the highest level of tree data available, root-only = 0, first level (2 leaves) = 1, second level = 2, etc… |
References
1. Tiger Tree Hash on Wikipedia Added by: Toast 20:35, 21 November 2008 (UTC)