Documentation
¶
Overview ¶
Package bmt defines the interface for the Binary Merkle Tree hash.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOverflow = errors.New("BMT hash capacity exceeded")
Functions ¶
This section is empty.
Types ¶
type Hash ¶
type Hash interface {
hash.Hash
// SetSpan sets the length prefix of BMT hash.
SetSpan(int64) error
// Capacity returns the maximum amount of bytes that will be processed by the implementation.
Capacity() int
// WriteSection writes to a specific section of the data to be hashed.
WriteSection(idx int, data []byte) error
}
Hash provides the necessary extension of the hash interface to add the length-prefix of the BMT hash.
Any implementation should make it possible to generate a BMT hash using the hash.Hash interface only. However, the limitation will be that the Span of the BMT hash always must be limited to the amount of bytes actually written.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package reference is a simple nonconcurrent reference implementation for hashsize segment based Binary Merkle tree hash on arbitrary but fixed maximum chunksize n where 0 <= n <= 4096 This implementation does not take advantage of any paralellisms and uses far more memory than necessary, but it is easy to see that it is correct.
|
Package reference is a simple nonconcurrent reference implementation for hashsize segment based Binary Merkle tree hash on arbitrary but fixed maximum chunksize n where 0 <= n <= 4096 This implementation does not take advantage of any paralellisms and uses far more memory than necessary, but it is easy to see that it is correct. |
Click to show internal directories.
Click to hide internal directories.