Documentation
¶
Index ¶
Constants ¶
View Source
const ( SIGNRLEN = 32 SIGNATURELEN = 64 NEGBIGNUMLEN = 33 )
View Source
const ( INFINITYLEN = 1 FLAGLEN = 1 XORYVALUELEN = 32 COMPRESSEDLEN = 33 NOCOMPRESSEDLEN = 65 COMPEVENFLAG = 0x02 COMPODDFLAG = 0x03 NOCOMPRESSEDFLAG = 0x04 P256PARAMA = -3 )
Variables ¶
This section is empty.
Functions ¶
func ComputeRoot ¶
func ComputeRoot(hashes []Uint256) (Uint256, error)
input a []uint256, create a MerkleTree & calc the root hash
func DoubleSHA256 ¶
func DoubleSHA256(s []Uint256) Uint256
Types ¶
type CryptoAlgSet ¶
type CryptoAlgSet struct {
EccParams elliptic.CurveParams
Curve elliptic.Curve
}
type MerkleTree ¶
type MerkleTree struct {
Depth uint
Root *MerkleTreeNode
}
func NewMerkleTree ¶
func NewMerkleTree(hashes []Uint256) (*MerkleTree, error)
use []Uint256 to create a new MerkleTree
type MerkleTreeNode ¶
type MerkleTreeNode struct {
Hash Uint256
Left *MerkleTreeNode
Right *MerkleTreeNode
}
func (*MerkleTreeNode) IsLeaf ¶
func (t *MerkleTreeNode) IsLeaf() bool
Click to show internal directories.
Click to hide internal directories.