bmt: Binary Merkle Tree Hash (#14334)

bmt is a new package that provides hashers for binary merkle tree hashes on
size-limited chunks. the main motivation is that using BMT hash as the chunk
hash of the swarm hash offers logsize inclusion proofs for arbitrary files on a
32-byte resolution completely viable to use in challenges on the blockchain.
This commit is contained in:
Viktor Trón
2017-09-05 12:38:36 +02:00
committed by Felix Lange
parent 32d8d42274
commit 2bacf36d80
5 changed files with 1131 additions and 1 deletions

View File

@ -51,7 +51,8 @@ data_{i} := size(subtree_{i}) || key_{j} || key_{j+1} .... || key_{j+n-1}
*/
const (
defaultHash = "SHA3" // http://golang.org/pkg/hash/#Hash
defaultHash = "SHA3"
// defaultHash = "BMTSHA3" // http://golang.org/pkg/hash/#Hash
// defaultHash = "SHA256" // http://golang.org/pkg/hash/#Hash
defaultBranches int64 = 128
// hashSize int64 = hasherfunc.New().Size() // hasher knows about its own length in bytes