core

package
v0.0.0-...-a360f25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2019 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CommitteeMax        = 5 //Just default params, will update from contract when process running
	CommitteeRequires   = 3
	CommitteeNodeList   []string // All committer
	VerifierRequires    = 2
	VerifierSubRequires = 5
)

Functions

func GeneratePKPairFromSubAddress

func GeneratePKPairFromSubAddress(w []byte) (*ecdsa.PublicKey, *ecdsa.PublicKey, error)

Types

type KeyPool

type KeyPool struct {
	// contains filtered or unexported fields
}

func NewKeyPool

func NewKeyPool() *KeyPool

func (*KeyPool) Cachelen

func (self *KeyPool) Cachelen() int

func (*KeyPool) InsertKeyCache

func (self *KeyPool) InsertKeyCache(cache string)

func (*KeyPool) InsertPolynomialShare

func (self *KeyPool) InsertPolynomialShare(id int, keys []*ecdsa.PublicKey)

func (*KeyPool) InsertPrivateKeyShare

func (self *KeyPool) InsertPrivateKeyShare(id int, key string)

func (*KeyPool) KeyCache

func (self *KeyPool) KeyCache(id int) string

func (*KeyPool) ShamirKeyShareCheck

func (self *KeyPool) ShamirKeyShareCheck(usechain *config.Usechain)

Check whether get enough shares, and try to generate the multi-sssa private key

type SharePool

type SharePool struct {
	VerifiedChan chan VerifiedMain

	VerifiedSubChan chan VerifiedSub

	SubChan chan *SubData

	SubFailedDecrypted chan string
	// contains filtered or unexported fields
}

func NewSharePool

func NewSharePool() *SharePool

func (*SharePool) AddVerifiedMain

func (self *SharePool) AddVerifiedMain(data VerifiedMain)

func (*SharePool) CheckSharedMsg

func (self *SharePool) CheckSharedMsg(usechain *config.Usechain, requires int)

func (*SharePool) GetVerifiedCertHash

func (self *SharePool) GetVerifiedCertHash(key string) common.Hash

func (*SharePool) SaveAccountSharedCache

func (self *SharePool) SaveAccountSharedCache(A string, bsA string, id int)

func (*SharePool) SaveEncryptedData

func (self *SharePool) SaveEncryptedData(addrID string, h common.Hash, data string)

func (*SharePool) SaveEncryptedSub

func (self *SharePool) SaveEncryptedSub(addrSubIDstring string, data string)

func (*SharePool) SaveSubData

func (self *SharePool) SaveSubData(S string, H string, subID string)

type SubData

type SubData struct {
	SubID string
	H     string
	Amain string
	S     string
}

type UserData

type UserData struct {
	Id       string `json:"id"`
	CertType string `json:"certtype"`
	Sex      string `json:"sex"`
	Name     string `json:"name"`
	EName    string `json:"ename"`
	Nation   string `json:"nation"`
	Addr     string `json:"addr"`
	BirthDay string `json:"birthday"`
}

type VerifiedMain

type VerifiedMain struct {
	Addr       common.Address
	RegisterID *big.Int
	Hashkey    common.Hash
	Status     *big.Int
}

type VerifiedSub

type VerifiedSub struct {
	RegisterID *big.Int
	Status     *big.Int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL