Documentation ¶
Index ¶
- func EncapsulateVSSSend(pi *Pi, BijList []bls.Fr, WBijList []bls.G1Point, F uint32) []byte
- func GenCoefficientsFile(N int, T int)
- func GetLagrangeCoefficients(deg uint32, x []bls.Fr, targetIndex bls.Fr, lambda []bls.Fr)
- func GetSamples(ExpIndexes []int, Values []bls.Fr, MaxWidth uint64) []*bls.Fr
- func GetScaleByCommitteeSize(size uint32) uint8
- func MainProcess(p *HonestParty, ID []byte, value []byte, validation []byte) []byte
- func PadCoeff(poly_coeff []bls.Fr, MaxWidth uint64) []bls.Fr
- func PolyToString(poly_coeff []bls.Fr) string
- func ReadFromFile(data interface{}, filename string)
- func Receiver(ctx context.Context, p *HonestParty, sender uint32, ID []byte, ...) ([]byte, []byte, bool)
- func SPBReceiver(ctx context.Context, p *HonestParty, sender uint32, ID []byte) ([]byte, []byte, bool)
- func SPBSender(ctx context.Context, p *HonestParty, ID []byte, value []byte, ...) ([]byte, []byte, bool)
- func Sender(ctx context.Context, p *HonestParty, ID []byte, value []byte, ...) ([]byte, bool)
- func SigKeyGen(n uint32, t uint32) ([]*share.PriShare, *share.PubPoly)
- func SigKeyGenFix(n uint32, t uint32) ([]*share.PriShare, *share.PubPoly)
- func SigKeyGenFix_New(n uint32, t uint32) ([]*share.PriShare, *share.PubPoly)
- func WriteToFile(data interface{}, filename string)
- type Client
- type HonestParty
- func (p *HonestParty) Broadcast(m *protobuf.Message) error
- func (p *HonestParty) BroadcastExclude(m *protobuf.Message, pid uint32) error
- func (p *HonestParty) BroadcastToNextCommittee(m *protobuf.Message) error
- func (p *HonestParty) GetMessage(messageType string, ID []byte) chan *protobuf.Message
- func (p *HonestParty) InitReceiveChannel() error
- func (p *HonestParty) InitSendChannel() error
- func (p *HonestParty) InitSendToNextChannel() error
- func (p *HonestParty) InterpolateComOrWit(degree uint32, targetIndex uint32, List []bls.G1Point) bls.G1Point
- func (p *HonestParty) InterpolateComOrWitByKnownIndexes(degree uint32, targetIndex uint32, knownIndexes []bls.Fr, List []bls.G1Point) bls.G1Point
- func (p *HonestParty) PrepareReceive(ID []byte)
- func (p *HonestParty) PrepareSend(ID []byte)
- func (p *HonestParty) ProactivizeAndShareDist(ID []byte)
- func (p *HonestParty) RBCReceive(ID []byte) *protobuf.Message
- func (p *HonestParty) RBCSend(M *protobuf.Message, ID []byte)
- func (p *HonestParty) RBCSendExclude(M *protobuf.Message, ID []byte, pid uint32)
- func (p *HonestParty) Send(m *protobuf.Message, des uint32) error
- func (p *HonestParty) SendToNextCommittee(m *protobuf.Message, des uint32) error
- func (p *HonestParty) ShareReduceReceive(ID []byte)
- func (p *HonestParty) ShareReduceSend(ID []byte)
- func (p *HonestParty) VSSShareReceive(ID []byte)
- func (p *HonestParty) VerifyVSSSendReceived(polyValue []bls.Fr, witness []bls.G1Point, piReceived *Pi) bool
- type Party
- type Pi
- type PiContent
- type RecoverMsg
- type SBElement
- type SComElement
- type SRecElement
- type SSigElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncapsulateVSSSend ¶
func GenCoefficientsFile ¶
func GetLagrangeCoefficients ¶
get the lagrange coefficients at index "targetIndex", with known indexes x[]. remenber to allocate memory for target[] before using this function.
func GetScaleByCommitteeSize ¶
w_0,w_1,...,w^(3f+1) will be used to represent values of a polynomial. The total number of values is 3f+2.So in this function we use size+1
func MainProcess ¶
func MainProcess(p *HonestParty, ID []byte, value []byte, validation []byte) []byte
MainProcess is the main process of smvba instances
func PolyToString ¶
func ReadFromFile ¶
func ReadFromFile(data interface{}, filename string)
func Receiver ¶
func Receiver(ctx context.Context, p *HonestParty, sender uint32, ID []byte, validator func(*HonestParty, []byte, uint32, []byte, []byte) error) ([]byte, []byte, bool)
Receiver is run by the receiver of a instance of provable broadcast
func SPBReceiver ¶
func SPBReceiver(ctx context.Context, p *HonestParty, sender uint32, ID []byte) ([]byte, []byte, bool)
SPBReceiver is run by the receiver of a instance of strong provable broadcast
func SPBSender ¶
func SPBSender(ctx context.Context, p *HonestParty, ID []byte, value []byte, validation []byte) ([]byte, []byte, bool)
SPBSender is run by the sender of a instance of strong provable broadcast
func Sender ¶
func Sender(ctx context.Context, p *HonestParty, ID []byte, value []byte, validation []byte) ([]byte, bool)
Sender is run by the sender of a instance of provable broadcast
func SigKeyGen ¶
SigKeyGen return pk and sks for threshold signature n is the number of parties, t is the threshold of combining signature
func SigKeyGenFix ¶
here t = 2f + 1
func SigKeyGenFix_New ¶
func WriteToFile ¶
func WriteToFile(data interface{}, filename string)
Types ¶
type Client ¶
type Client struct { *HonestParty // contains filtered or unexported fields }
type HonestParty ¶
type HonestParty struct { N uint32 // committee size F uint32 // number of corrupted parties PID uint32 // id of this party FS *polycommit.FFTSettings KZG *polycommit.KZGSettings SigPK *share.PubPoly //tss pk SigSK *share.PriShare //tss sk Proof *Pi //pi LagrangeCoefficients [][]bls.Fr //lagrange coefficients when using f(1),f(2),...,f(2t+1) to calculate f(k) for 0 <= k <= 3*f+1.Indices start from 0 VSSStart time.Time VSSEnd time.Time PrepareStart_old time.Time PrepareEnd_old time.Time PrepareStart_new time.Time PrepareEnd_new time.Time ProactivizeStart time.Time ProactivizeEnd time.Time // contains filtered or unexported fields }
HonestParty is a struct of honest committee members TODO: add epoch number into this struct
func NewHonestParty ¶
func NewHonestParty(e uint32, N uint32, F uint32, pid uint32, ipList []string, portList []string, ipListNext []string, portListNext []string, sigPK *share.PubPoly, sigSK *share.PriShare) *HonestParty
NewHonestParty returns a new honest party object
func (*HonestParty) Broadcast ¶
func (p *HonestParty) Broadcast(m *protobuf.Message) error
Broadcast a message to all parties
func (*HonestParty) BroadcastExclude ¶
func (p *HonestParty) BroadcastExclude(m *protobuf.Message, pid uint32) error
BroadcastExclude broadcasts a message to all parties except pid, used for RBC_test
func (*HonestParty) BroadcastToNextCommittee ¶
func (p *HonestParty) BroadcastToNextCommittee(m *protobuf.Message) error
BroadcastToNextCommittee broadcasts a message m to all parties in the new committee
func (*HonestParty) GetMessage ¶
func (p *HonestParty) GetMessage(messageType string, ID []byte) chan *protobuf.Message
GetMessage tries to get a message according to messageType and ID
func (*HonestParty) InitReceiveChannel ¶
func (p *HonestParty) InitReceiveChannel() error
InitReceiveChannel sets up the listener and Init the receiveChannel
func (*HonestParty) InitSendChannel ¶
func (p *HonestParty) InitSendChannel() error
InitSendChannel sets up the sender and Init the sendChannel, please run this after initializing all party's receiveChannel
func (*HonestParty) InitSendToNextChannel ¶
func (p *HonestParty) InitSendToNextChannel() error
func (*HonestParty) InterpolateComOrWit ¶
func (p *HonestParty) InterpolateComOrWit(degree uint32, targetIndex uint32, List []bls.G1Point) bls.G1Point
InterpolateComOrWit interpolates commitment or witness according to the first 2t+1 elements
func (*HonestParty) InterpolateComOrWitByKnownIndexes ¶
func (*HonestParty) PrepareReceive ¶
func (p *HonestParty) PrepareReceive(ID []byte)
PrepareReceive receives Prepare message which contains Pi from the previous commitee and sets p.Proof.
func (*HonestParty) PrepareSend ¶
func (p *HonestParty) PrepareSend(ID []byte)
PrepareSend sends public parameters(commitments) to the corresponding node in the next commitee
func (*HonestParty) ProactivizeAndShareDist ¶
func (p *HonestParty) ProactivizeAndShareDist(ID []byte)
func (*HonestParty) RBCReceive ¶
func (p *HonestParty) RBCReceive(ID []byte) *protobuf.Message
func (*HonestParty) RBCSend ¶
func (p *HonestParty) RBCSend(M *protobuf.Message, ID []byte)
RBC propose
func (*HonestParty) RBCSendExclude ¶
func (p *HonestParty) RBCSendExclude(M *protobuf.Message, ID []byte, pid uint32)
func (*HonestParty) Send ¶
func (p *HonestParty) Send(m *protobuf.Message, des uint32) error
Send a message to a party with des as its pid, 0 =< des < p.N
func (*HonestParty) SendToNextCommittee ¶
func (p *HonestParty) SendToNextCommittee(m *protobuf.Message, des uint32) error
SendToNextCommittee sends a message to a new committtee party with des as its pid, 0 =< des < p.N
func (*HonestParty) ShareReduceReceive ¶
func (p *HonestParty) ShareReduceReceive(ID []byte)
func (*HonestParty) ShareReduceSend ¶
func (p *HonestParty) ShareReduceSend(ID []byte)
func (*HonestParty) VSSShareReceive ¶
func (p *HonestParty) VSSShareReceive(ID []byte)
func (*HonestParty) VerifyVSSSendReceived ¶
type Party ¶
type Party interface {
// contains filtered or unexported methods
}
Party is an interface of committee members
type PiContent ¶
type PiContent struct { //In DyCAPS.Share, CBj refers to commitment to B(x,index) generated by dealer. //In DyCAPS.Handoff, CBj refers to commitment to Q_i(x,index) generated by Party i CBj bls.G1Point CZj bls.G1Point //Z_j(x)=R_j(x)-R_j(0) WZ0 bls.G1Point //witness of Z_j(0)=0 // contains filtered or unexported fields }
type RecoverMsg ¶
type RecoverMsg struct {
// contains filtered or unexported fields
}
type SComElement ¶
SComElement is the set of commitments
type SRecElement ¶
type SRecElement struct {
// contains filtered or unexported fields
}
SRecElement is the set of elements for recover
type SSigElement ¶
type SSigElement struct { Sig []byte // contains filtered or unexported fields }
SSigElement is the set of signatures