storemanmpc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: GPL-3.0, MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrivateShare

func GetPrivateShare(ks *keystore.KeyStore,
	address common.Address,
	enableKms bool,
	kmsInfo *KmsInfo,
	password string) (*keystore.Key, int, error)

Types

type BaseMpcResult

type BaseMpcResult struct {
	Result map[string][]big.Int
	// contains filtered or unexported fields
}

func (*BaseMpcResult) GetByteValue

func (mpc *BaseMpcResult) GetByteValue(key string) ([]byte, error)

func (*BaseMpcResult) GetValue

func (mpc *BaseMpcResult) GetValue(key string) ([]big.Int, error)

func (*BaseMpcResult) Initialize

func (mpc *BaseMpcResult) Initialize() error

func (*BaseMpcResult) InitializeValue

func (result *BaseMpcResult) InitializeValue(preSetValue ...MpcValue)

func (*BaseMpcResult) SetByteValue

func (mpc *BaseMpcResult) SetByteValue(key string, value []byte) error

func (*BaseMpcResult) SetValue

func (mpc *BaseMpcResult) SetValue(key string, value []big.Int) error

type KmsInfo

type KmsInfo struct {
	AKID      string
	SecretKey string
	Region    string
}

type MemStatus

type MemStatus struct {
	All  uint64 `json:"all"`
	Used uint64 `json:"used"`
	Free uint64 `json:"free"`
	Self uint64 `json:"self"`
}

type MpcContext

type MpcContext struct {
	ContextID uint64 //Unique id for every content

	MpcSteps    []MpcStepFunc
	MapStepChan map[uint64]chan *mpcprotocol.StepMessage
	// contains filtered or unexported fields
}

type MpcContextCreater

type MpcContextCreater interface {
	CreateContext(int, uint64, []mpcprotocol.PeerInfo, ...MpcValue) (MpcInterface, error) //createContext
}

type MpcCtxFactory

type MpcCtxFactory struct {
}

func (*MpcCtxFactory) CreateContext

func (*MpcCtxFactory) CreateContext(ctxType int,
	mpcID uint64,
	peers []mpcprotocol.PeerInfo,
	preSetValue ...MpcValue) (MpcInterface, error)

type MpcDistributor

type MpcDistributor struct {
	Self          *discover.Node
	StoreManGroup []discover.NodeID

	AccountManager *accounts.Manager
	P2pMessager    P2pMessager
	// contains filtered or unexported fields
}

func CreateMpcDistributor

func CreateMpcDistributor(accountManager *accounts.Manager,
	msger P2pMessager,
	aKID,
	secretKey,
	region,
	password string) *MpcDistributor

func (*MpcDistributor) BroadcastMessage

func (mpcServer *MpcDistributor) BroadcastMessage(peers []discover.NodeID, code uint64, msg interface{}) error

func (*MpcDistributor) CreateKeystore

func (mpcServer *MpcDistributor) CreateKeystore(result mpcprotocol.MpcResultInterface,
	peers *[]mpcprotocol.PeerInfo,
	accType string) error

func (*MpcDistributor) CreateReqMpcSign

func (mpcServer *MpcDistributor) CreateReqMpcSign(data []byte, extern []byte, pkBytes []byte, byApprove int64) ([]byte, error)

func (*MpcDistributor) CreateRequestGPK

func (mpcServer *MpcDistributor) CreateRequestGPK() ([]byte, error)

func (*MpcDistributor) GetMessage

func (mpcServer *MpcDistributor) GetMessage(PeerID discover.NodeID, rw p2p.MsgReadWriter, msg *p2p.Msg) error

func (*MpcDistributor) InitStoreManGroup

func (mpcServer *MpcDistributor) InitStoreManGroup()

func (*MpcDistributor) P2pMessage

func (mpcServer *MpcDistributor) P2pMessage(peerID *discover.NodeID, code uint64, msg interface{}) error

func (*MpcDistributor) QuitMpcContext

func (mpcServer *MpcDistributor) QuitMpcContext(msg *mpcprotocol.MpcMessage)

func (*MpcDistributor) SelfNodeId

func (mpcServer *MpcDistributor) SelfNodeId() *discover.NodeID

func (*MpcDistributor) SetMessagePeers

func (mpcServer *MpcDistributor) SetMessagePeers(mpcMessage *mpcprotocol.MpcMessage, peers *[]mpcprotocol.PeerInfo)

type MpcInterface

type MpcInterface interface {
	// contains filtered or unexported methods
}

type MpcStepFunc

type MpcStepFunc interface {
	mpcprotocol.GetMessageInterface
	InitMessageLoop(mpcprotocol.GetMessageInterface) error
	Quit(error)
	InitStep(mpcprotocol.MpcResultInterface) error
	CreateMessage() []mpcprotocol.StepMessage
	FinishStep(mpcprotocol.MpcResultInterface, mpcprotocol.StoremanManager) error
	GetMessageChan() chan *mpcprotocol.StepMessage
	SetWaitAll(bool)
	SetStepId(int)
}

type MpcValue

type MpcValue struct {
	Key       string
	Value     []big.Int
	ByteValue []byte
}

func (*MpcValue) String

func (v *MpcValue) String() string

type P2pMessager

type P2pMessager interface {
	SendToPeer(*discover.NodeID, uint64, interface{}) error
	IsActivePeer(*discover.NodeID) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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