Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot merkle POUF #133

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mnm678
Copy link
Contributor

@mnm678 mnm678 commented Feb 3, 2021

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.

…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>
Add the procedures for computing leafs, nodes, and
path_directions used by the reference implementation

Signed-off-by: Marina Moore <mnm678@gmail.com>
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).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part would probably benefit from a diagram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant