Documentation ¶
Index ¶
- Variables
- func AesDecrypt(ciphertext []byte, key []byte, iv []byte) ([]byte, error)
- func AesEncrypt(plaintext []byte, key []byte, iv []byte) ([]byte, error)
- func CheckPrivateKey(privateKey []byte) error
- func CheckPublicKey(publicKey []byte) error
- func CheckSeed(seed []byte) error
- func ComputeRoot(hashes []common.Uint256) (common.Uint256, error)
- func GenKeyPair() ([]byte, []byte, error)
- func GenerateVrf(privateKey, data []byte, randSrc bool) ([]byte, []byte, error)
- func GetPrivateKeyFromSeed(seed []byte) []byte
- func GetPublicKeyFromPrivateKey(privateKey []byte) []byte
- func GetSeedFromPrivateKey(priKey []byte) []byte
- func PasswordHash(password []byte) []byte
- func Sign(privateKey, data []byte) ([]byte, error)
- func Verify(publicKey, data, signature []byte) error
- func VerifyRoot(txnsHash []common.Uint256, txnsRoot []byte) error
- func VerifyVrf(publicKey, data, vrf, proof []byte) bool
- type MerkleTree
- type MerkleTreeNode
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DOUBLE_SHA256 = func(s []common.Uint256) common.Uint256 { b := new(bytes.Buffer) for _, d := range s { d.Serialize(b) } temp := sha256.Sum256(b.Bytes()) f := sha256.Sum256(temp[:]) return common.Uint256(f) } )
View Source
var Sha256ZeroHash = make([]byte, 32)
Functions ¶
func CheckPrivateKey ¶
func CheckPublicKey ¶
func ComputeRoot ¶
input a []uint256, create a MerkleTree & calc the root hash
func GenKeyPair ¶
func GetPrivateKeyFromSeed ¶
func GetSeedFromPrivateKey ¶
func PasswordHash ¶
Types ¶
type MerkleTree ¶
type MerkleTree struct { Depth uint Root *MerkleTreeNode }
func NewMerkleTree ¶
func NewMerkleTree(hashes []common.Uint256) (*MerkleTree, error)
use []Uint256 to create a new MerkleTree
type MerkleTreeNode ¶
type MerkleTreeNode struct { Hash common.Uint256 Left *MerkleTreeNode Right *MerkleTreeNode }
func (*MerkleTreeNode) IsLeaf ¶
func (t *MerkleTreeNode) IsLeaf() bool
Directories ¶
Path | Synopsis |
---|---|
edwards25519
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
|
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519. |
vrf
Package ed25519 implements a verifiable random function using the Edwards form of Curve25519, SHA512 and the Elligator map.
|
Package ed25519 implements a verifiable random function using the Edwards form of Curve25519, SHA512 and the Elligator map. |
Click to show internal directories.
Click to hide internal directories.