cs

package
v0.0.0-...-4f9f457 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitteeSize

func CommitteeSize(totalNodeCount int64, failedTotalNodesPercentage int64, failureChance big.Rat) int

func IsNodeInConfig

func IsNodeInConfig(id uint32, expectedPubKey []byte, nodes committee.Nodes) (int, error)

IsNodeInConfig returns whether the given node is in the config.

func SelectCommittee

func SelectCommittee(config committee.Config, seed []byte) []uint32

func VerifyConfig

func VerifyConfig(config committee.Config) error

Types

type Body

type Body struct {
	Commitments []committee.Commitment
	ReconShares []committee.ReconShare
}

func (Body) Bytes

func (b Body) Bytes() []byte

type Commitment

type Commitment struct {
	From        int32
	EncShares   []*pvss.PubVerShare // n encrypted shares and corresponding ZKPs
	Commitments []kyber.Point       // f+1 commitments
}

func (Commitment) ToRawForm

func (cmt Commitment) ToRawForm(from uint32) (committee.Commitment, error)

type CommitteeSelection

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

func (*CommitteeSelection) GenerateKeyPair

func (cs *CommitteeSelection) GenerateKeyPair(rand io.Reader) ([]byte, []byte, error)

func (*CommitteeSelection) Initialize

func (cs *CommitteeSelection) Initialize(ID uint32, privateKey []byte, nodes committee.Nodes) error

func (*CommitteeSelection) Process

func (*CommitteeSelection) VerifyCommitment

func (cs *CommitteeSelection) VerifyCommitment(commitment committee.Commitment, key committee.PublicKey) error

func (*CommitteeSelection) VerifyReconShare

func (cs *CommitteeSelection) VerifyReconShare(share committee.ReconShare, key committee.PublicKey) error

type EncShare

type EncShare struct {
	I int
	V []byte
}
type Header struct {
	RemainingRounds      int32
	CommitteeIncarnation int32
	BodyDigest           string
}

func (Header) Bytes

func (h Header) Bytes() []byte

type Proof

type Proof struct {
	Proofs []dleq.Proof
}

func (Proof) ToBytes

func (p Proof) ToBytes() ([]byte, error)

type SerializedCommitment

type SerializedCommitment struct {
	Commitments [][]byte
	EncShares   [][]byte
}

func (*SerializedCommitment) FromBytes

func (scm *SerializedCommitment) FromBytes(bytes []byte) error

func (SerializedCommitment) ToBytes

func (scm SerializedCommitment) ToBytes() ([]byte, error)

type SerializedProof

type SerializedProof struct {
	R  []byte
	VG []byte
	VH []byte
}

func (*SerializedProof) Initialize

func (sp *SerializedProof) Initialize(bytes []byte) error

func (SerializedProof) ToBytes

func (sp SerializedProof) ToBytes() ([]byte, error)

type SerializedProofs

type SerializedProofs struct {
	Proofs []SerializedProof
}

func (*SerializedProofs) Initialize

func (sps *SerializedProofs) Initialize(bytes []byte) error

func (SerializedProofs) ToBytes

func (sps SerializedProofs) ToBytes() ([]byte, error)

type State

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

func (*State) Initialize

func (s *State) Initialize(rawState []byte) error

func (*State) ToBytes

func (s *State) ToBytes() []byte

Jump to

Keyboard shortcuts

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