-
Notifications
You must be signed in to change notification settings - Fork 9
Move PendingLogEntry and LogEntry traits to tlog_tiles crate #47
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
Conversation
* Move PendingLogEntry and LogEntry to tlog_tiles crate * Add implementation of above traits for tlog-tiles spec * Remove 'as_bytes' from PendingLogEntry trait, as the LogEntry can access private fields of the PendingLogEntry directly as it is an associated type.
* Move StandardEd25519CheckpointSigner to tlog_tiles crate, as it is the
default checkpoint signer used by the tlog-tiles spec, and drop the
'Standard' prefix.
* Rename StandardSigner -> Ed25519NoteSigner, signed_note::{Signer,
Verifier} -> signed_note::Note{Signer,Verifier}
crates/tlog_tiles/src/entries.rs
Outdated
| /// Returns the underlying pending entry | ||
| fn inner(&self) -> &Self::Pending; | ||
|
|
||
| /// Returns a marshaled [RFC 6962 `MerkleTreeLeaf`](https://datatracker.ietf.org/doc/html/rfc6962#section-3.4). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, forgot to do this. This comment should be moved to the StaticCtLogEntry impl of this trait. The comment here should be something like "Returns the Merkle leaf value corresponding to this entry. For the tlog-tiles spec, this MUST be the hash of self.tile_leaf."
That comes from here
Each entry in a bundle hashes to the corresponding entry in the corresponding “level 0” Merkle Tree tile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah whoops yeah forgot to update the comment. The value returned here isn't the leaf hash, but the bytes to be hashed into the leaf. I just pushed an update to make it just return the leaf hash directly, since it also simplifies some downstream code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that makes sense. One thing I’m not super clear on is what the relationship between data tile entry, leaf entry, and leaf hash has to be. In general, do they have to satisfy any specific relation? Idk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In tlog-tiles, the leaf entry (or "log entry") is an opaque blob that you can hash (a la RFC6962) to get the leaf hash, or serialize with the big-endian uint16 length prefix to get the data tile entry.
In static CT, the relationship is fuzzier (due to needing the Merkle Tree hashes to be backwards-compatible with RFC6962). For example, the chain_fingerprints field of the log entry goes into the data tile entry, but is not hashed into the tree. Any protocol that doesn't have to deal with backwards-compatibility should probably just use the tlog-tiles approach so that everything in the data tile entries are authenticated.
fd0041d to
de4bf0c
Compare
default checkpoint signer used by the tlog-tiles spec, and drop the
'Standard' prefix.
Verifier} -> signed_note::Note{Signer,Verifier}