-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TreeHash.EmptyHash -> TreeHash.EmptyHash(height int) (#685)
* MapHasher interface Replaces a private [][]byte cache of empty nodes with an interface `EmptyHash(depth int)` which can have multiple implementations. Moves the default HStar2 empty hash algorithm and tests into a separate package which implements the MapHasher interface. * Make TreeHasher generic - Use height rather than depth for HashEmpty to simplify math. - Move emtpy hash logic into rfc6962 hasher. - Create LogHasher to support special casing an empty tree. * comments and spelling * Separate map hasher from rfc6962 hasher Logs do not need to compute empty branches. Rather than creating a unified hasher for logs and maps, create separate hashers that will panic when used in the wrong setting. * Add MAP_HASHER to createtree * Reviewer guided cleanup - Removed map references from rfc6962 - Removed generic references from maphasher - Comment cleanup * Separate LogHasher and MapHasher It turns out that having two separate interfaces for Log and Map hashing is both feasible and suports better code design. The inner merkle tree computations for the log and map do not actually share code, making this possible. * Review modifications - Spelling and comments - MAP_HASHER -> TEST_MAP_HASHER
- Loading branch information
Showing
49 changed files
with
554 additions
and
394 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.