Draft
Conversation
…atino POUF This commit adds metadata definitions and algorithm requirements for snapshot Merkle trees in the reference implementation. Signed-off-by: Marina Moore <mnm678@gmail.com>
This was referenced Feb 3, 2021
Add the procedures for computing leafs, nodes, and path_directions used by the reference implementation Signed-off-by: Marina Moore <mnm678@gmail.com>
mnm678
commented
Feb 4, 2021
| Snapshot Merkle trees in this implementation will use sha256 to compute the digest of each node, and will use the following procedures for computing node digests: | ||
| * A leaf digest is the sha256 hash of the cannonical json encoding of its `leaf_contents`. | ||
| * An internal node's digest is the sha256 hash of its left child's digest + it's right child's digest, using utf-8 encoding. | ||
| * The `path_directions` and `merkle_path` for each snapshot Merkle metadata file provide information needed to reconstruct the Merkle tree. For each node in the tree, starting with the given leaf node, the next `path_directions` will be -1 if the corresponding `merkle_path` is a right sibling of the current node, or 1 if it is a left sibling. So, a `path_direction` of -1 means that the parent node's digest will be the hash of the current node's digest + the next `merkle_path` digest (as the `merkle_path` is a right sibling). |
Contributor
Author
There was a problem hiding this comment.
This part would probably benefit from a diagram.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add description of snapshot Merkle metadata to the reference implementation POUF, based on the description of snapshot Merkle trees in #125.
This pr is a draft, and should be merged only if/when theupdateframework/python-tuf#1113 is incorporated into the reference implementation.