Documentation ¶
Index ¶
- Constants
- func Hash(vv ...[]byte) []byte
- func MakeMerkleProof(hashes [][]byte, i int) (buf []byte)
- func MakeMerkleRoot(n int, itemHash func(int) []byte) []byte
- func MerkleProofAppend(proof []byte, op byte, hash []byte) []byte
- func MerkleRoot(hash ...[]byte) []byte
- func NewHash() hash.Hash
- func VerifyMerkleProof(hash, root, proof []byte) bool
- type MerkleHash
- type PrivateKey
- type PublicKey
Constants ¶
View Source
const ( OpLHash = 0 OpRHash = 1 )
View Source
const HashSize = 32
HashSize is the size of a hash-checksum in bytes.
View Source
const PublicKeySize = ed25519.PublicKeySize
View Source
const SignatureSize = ed25519.SignatureSize
Variables ¶
This section is empty.
Functions ¶
func MakeMerkleProof ¶
func MerkleRoot ¶
func VerifyMerkleProof ¶
Types ¶
type MerkleHash ¶
type MerkleHash struct {
// contains filtered or unexported fields
}
func NewMerkleHash ¶
func NewMerkleHash(partSize int64) *MerkleHash
func (*MerkleHash) Leaves ¶
func (h *MerkleHash) Leaves() [][]byte
func (*MerkleHash) Root ¶
func (h *MerkleHash) Root() []byte
func (*MerkleHash) Written ¶
func (h *MerkleHash) Written() int64
type PrivateKey ¶
type PrivateKey []byte
func NewPrivateKeyFromSeed ¶
func NewPrivateKeyFromSeed(seed string) PrivateKey
func (PrivateKey) Encode ¶
func (prv PrivateKey) Encode() string
func (PrivateKey) PublicKey ¶
func (prv PrivateKey) PublicKey() PublicKey
func (PrivateKey) Sign ¶
func (prv PrivateKey) Sign(message []byte) []byte
func (PrivateKey) String ¶
func (prv PrivateKey) String() string
func (PrivateKey) SubKey ¶
func (prv PrivateKey) SubKey(name string) PrivateKey
Click to show internal directories.
Click to hide internal directories.