master

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeedLength = 32
	Threshold  = 2
)

Variables

View Source
var (
	ErrPeerNotFound = errors.New("peer message not found")
	ErrInvalidSeed  = errors.New("invalid seed")
)
View Source
var (
	ErrIdentityPublicKey   = errors.New("identity public key")
	ErrInconsistentResults = errors.New("inconsistent results")
)
View Source
var (
	Type_name = map[int32]string{
		0: "Initial",
		1: "OtReceiver",
		2: "OtSendResponse",
		3: "Commitment",
		4: "Decommitment",
		5: "Result",
		6: "Verify",
	}
	Type_value = map[string]int32{
		"Initial":        0,
		"OtReceiver":     1,
		"OtSendResponse": 2,
		"Commitment":     3,
		"Decommitment":   4,
		"Result":         5,
		"Verify":         6,
	}
)

Enum value maps for Type.

View Source
var (
	ErrNotReady = errors.New("not ready")
)
View Source
var File_github_com_getamis_alice_crypto_bip32_master_message_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BodyCommitment

type BodyCommitment struct {
	RandomChooseCommitment *commitment.HashCommitmentMessage `protobuf:"bytes,1,opt,name=randomChooseCommitment,proto3" json:"randomChooseCommitment,omitempty"`
	RandomSeedCommitment   *commitment.HashCommitmentMessage `protobuf:"bytes,2,opt,name=randomSeedCommitment,proto3" json:"randomSeedCommitment,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyCommitment) Descriptor deprecated

func (*BodyCommitment) Descriptor() ([]byte, []int)

Deprecated: Use BodyCommitment.ProtoReflect.Descriptor instead.

func (*BodyCommitment) GetRandomChooseCommitment

func (x *BodyCommitment) GetRandomChooseCommitment() *commitment.HashCommitmentMessage

func (*BodyCommitment) GetRandomSeedCommitment

func (x *BodyCommitment) GetRandomSeedCommitment() *commitment.HashCommitmentMessage

func (*BodyCommitment) ProtoMessage

func (*BodyCommitment) ProtoMessage()

func (*BodyCommitment) ProtoReflect

func (x *BodyCommitment) ProtoReflect() protoreflect.Message

func (*BodyCommitment) Reset

func (x *BodyCommitment) Reset()

func (*BodyCommitment) String

func (x *BodyCommitment) String() string

type BodyDecommitment

type BodyDecommitment struct {
	RandomChooseDeommitment *commitment.HashDecommitmentMessage `protobuf:"bytes,1,opt,name=randomChooseDeommitment,proto3" json:"randomChooseDeommitment,omitempty"`
	RandomSeedDecommitment  *commitment.HashDecommitmentMessage `protobuf:"bytes,2,opt,name=randomSeedDecommitment,proto3" json:"randomSeedDecommitment,omitempty"`
	AG                      *ecpointgrouplaw.EcPointMessage     `protobuf:"bytes,3,opt,name=aG,proto3" json:"aG,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyDecommitment) Descriptor deprecated

func (*BodyDecommitment) Descriptor() ([]byte, []int)

Deprecated: Use BodyDecommitment.ProtoReflect.Descriptor instead.

func (*BodyDecommitment) GetAG

func (*BodyDecommitment) GetRandomChooseDeommitment

func (x *BodyDecommitment) GetRandomChooseDeommitment() *commitment.HashDecommitmentMessage

func (*BodyDecommitment) GetRandomSeedDecommitment

func (x *BodyDecommitment) GetRandomSeedDecommitment() *commitment.HashDecommitmentMessage

func (*BodyDecommitment) ProtoMessage

func (*BodyDecommitment) ProtoMessage()

func (*BodyDecommitment) ProtoReflect

func (x *BodyDecommitment) ProtoReflect() protoreflect.Message

func (*BodyDecommitment) Reset

func (x *BodyDecommitment) Reset()

func (*BodyDecommitment) String

func (x *BodyDecommitment) String() string

type BodyInitial

type BodyInitial struct {
	OtRecMsg      *ot.OtReceiverMessage                     `protobuf:"bytes,1,opt,name=otRecMsg,proto3" json:"otRecMsg,omitempty"`
	GarcirMsg     *circuit.GarbleCircuitMessage             `protobuf:"bytes,2,opt,name=garcirMsg,proto3" json:"garcirMsg,omitempty"`
	OtherInfoWire [][]byte                                  `protobuf:"bytes,3,rep,name=otherInfoWire,proto3" json:"otherInfoWire,omitempty"`
	Bk            *birkhoffinterpolation.BkParameterMessage `protobuf:"bytes,4,opt,name=bk,proto3" json:"bk,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyInitial) Descriptor deprecated

func (*BodyInitial) Descriptor() ([]byte, []int)

Deprecated: Use BodyInitial.ProtoReflect.Descriptor instead.

func (*BodyInitial) GetBk

func (*BodyInitial) GetGarcirMsg

func (x *BodyInitial) GetGarcirMsg() *circuit.GarbleCircuitMessage

func (*BodyInitial) GetOtRecMsg

func (x *BodyInitial) GetOtRecMsg() *ot.OtReceiverMessage

func (*BodyInitial) GetOtherInfoWire

func (x *BodyInitial) GetOtherInfoWire() [][]byte

func (*BodyInitial) ProtoMessage

func (*BodyInitial) ProtoMessage()

func (*BodyInitial) ProtoReflect

func (x *BodyInitial) ProtoReflect() protoreflect.Message

func (*BodyInitial) Reset

func (x *BodyInitial) Reset()

func (*BodyInitial) String

func (x *BodyInitial) String() string

type BodyOtReceiver

type BodyOtReceiver struct {
	OtExtReceiveMsg *ot.OtExtReceiveMessage `protobuf:"bytes,1,opt,name=otExtReceiveMsg,proto3" json:"otExtReceiveMsg,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyOtReceiver) Descriptor deprecated

func (*BodyOtReceiver) Descriptor() ([]byte, []int)

Deprecated: Use BodyOtReceiver.ProtoReflect.Descriptor instead.

func (*BodyOtReceiver) GetOtExtReceiveMsg

func (x *BodyOtReceiver) GetOtExtReceiveMsg() *ot.OtExtReceiveMessage

func (*BodyOtReceiver) ProtoMessage

func (*BodyOtReceiver) ProtoMessage()

func (*BodyOtReceiver) ProtoReflect

func (x *BodyOtReceiver) ProtoReflect() protoreflect.Message

func (*BodyOtReceiver) Reset

func (x *BodyOtReceiver) Reset()

func (*BodyOtReceiver) String

func (x *BodyOtReceiver) String() string

type BodyOtSendResponse

type BodyOtSendResponse struct {
	OtExtSendResponseMsg *ot.OtExtSendResponseMessage `protobuf:"bytes,1,opt,name=otExtSendResponseMsg,proto3" json:"otExtSendResponseMsg,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyOtSendResponse) Descriptor deprecated

func (*BodyOtSendResponse) Descriptor() ([]byte, []int)

Deprecated: Use BodyOtSendResponse.ProtoReflect.Descriptor instead.

func (*BodyOtSendResponse) GetOtExtSendResponseMsg

func (x *BodyOtSendResponse) GetOtExtSendResponseMsg() *ot.OtExtSendResponseMessage

func (*BodyOtSendResponse) ProtoMessage

func (*BodyOtSendResponse) ProtoMessage()

func (*BodyOtSendResponse) ProtoReflect

func (x *BodyOtSendResponse) ProtoReflect() protoreflect.Message

func (*BodyOtSendResponse) Reset

func (x *BodyOtSendResponse) Reset()

func (*BodyOtSendResponse) String

func (x *BodyOtSendResponse) String() string

type BodyResult

type BodyResult struct {
	Result *commitment.FeldmanVerifyMessage `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyResult) Descriptor deprecated

func (*BodyResult) Descriptor() ([]byte, []int)

Deprecated: Use BodyResult.ProtoReflect.Descriptor instead.

func (*BodyResult) GetResult

func (x *BodyResult) GetResult() *commitment.FeldmanVerifyMessage

func (*BodyResult) ProtoMessage

func (*BodyResult) ProtoMessage()

func (*BodyResult) ProtoReflect

func (x *BodyResult) ProtoReflect() protoreflect.Message

func (*BodyResult) Reset

func (x *BodyResult) Reset()

func (*BodyResult) String

func (x *BodyResult) String() string

type BodyVerify

type BodyVerify struct {
	ShareGProofMsg *zkproof.SchnorrProofMessage `protobuf:"bytes,1,opt,name=shareGProofMsg,proto3" json:"shareGProofMsg,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyVerify) Descriptor deprecated

func (*BodyVerify) Descriptor() ([]byte, []int)

Deprecated: Use BodyVerify.ProtoReflect.Descriptor instead.

func (*BodyVerify) GetShareGProofMsg

func (x *BodyVerify) GetShareGProofMsg() *zkproof.SchnorrProofMessage

func (*BodyVerify) ProtoMessage

func (*BodyVerify) ProtoMessage()

func (*BodyVerify) ProtoReflect

func (x *BodyVerify) ProtoReflect() protoreflect.Message

func (*BodyVerify) Reset

func (x *BodyVerify) Reset()

func (*BodyVerify) String

func (x *BodyVerify) String() string

type Master

type Master struct {
	*message.MsgMain
	// contains filtered or unexported fields
}

func NewAlice

func NewAlice(peerManager types.PeerManager, sid []uint8, rank uint32, path string, listener types.StateChangedListener) (*Master, error)

sid/aliceSeed

func NewBob

func NewBob(peerManager types.PeerManager, sid []uint8, rank uint32, path string, listener types.StateChangedListener) (*Master, error)

func (*Master) GetResult

func (m *Master) GetResult() (*Result, error)

func (*Master) Start

func (m *Master) Start()

type Message

type Message struct {
	Type Type   `protobuf:"varint,1,opt,name=type,proto3,enum=master.Type" json:"type,omitempty"`
	Id   string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are assignable to Body:
	//	*Message_Initial
	//	*Message_OtReceiver
	//	*Message_OtSendResponse
	//	*Message_Commitment
	//	*Message_Decommitment
	//	*Message_Result
	//	*Message_Verify
	Body isMessage_Body `protobuf_oneof:"body"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

func (*Message) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBody

func (m *Message) GetBody() isMessage_Body

func (*Message) GetCommitment

func (x *Message) GetCommitment() *BodyCommitment

func (*Message) GetDecommitment

func (x *Message) GetDecommitment() *BodyDecommitment

func (*Message) GetId

func (x *Message) GetId() string

func (*Message) GetInitial

func (x *Message) GetInitial() *BodyInitial

func (*Message) GetMessageType

func (m *Message) GetMessageType() types.MessageType

func (*Message) GetOtReceiver

func (x *Message) GetOtReceiver() *BodyOtReceiver

func (*Message) GetOtSendResponse

func (x *Message) GetOtSendResponse() *BodyOtSendResponse

func (*Message) GetResult

func (x *Message) GetResult() *BodyResult

func (*Message) GetType

func (x *Message) GetType() Type

func (*Message) GetVerify

func (x *Message) GetVerify() *BodyVerify

func (*Message) IsValid

func (m *Message) IsValid() bool

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type Message_Commitment

type Message_Commitment struct {
	Commitment *BodyCommitment `protobuf:"bytes,6,opt,name=commitment,proto3,oneof"`
}

type Message_Decommitment

type Message_Decommitment struct {
	Decommitment *BodyDecommitment `protobuf:"bytes,7,opt,name=decommitment,proto3,oneof"`
}

type Message_Initial

type Message_Initial struct {
	Initial *BodyInitial `protobuf:"bytes,3,opt,name=initial,proto3,oneof"`
}

type Message_OtReceiver

type Message_OtReceiver struct {
	OtReceiver *BodyOtReceiver `protobuf:"bytes,4,opt,name=otReceiver,proto3,oneof"`
}

type Message_OtSendResponse

type Message_OtSendResponse struct {
	OtSendResponse *BodyOtSendResponse `protobuf:"bytes,5,opt,name=otSendResponse,proto3,oneof"`
}

type Message_Result

type Message_Result struct {
	Result *BodyResult `protobuf:"bytes,8,opt,name=result,proto3,oneof"`
}

type Message_Verify

type Message_Verify struct {
	Verify *BodyVerify `protobuf:"bytes,9,opt,name=verify,proto3,oneof"`
}

type Result

type Result struct {
	PublicKey *ecpointgrouplaw.ECPoint
	Share     *big.Int
	Bks       map[string]*birkhoffinterpolation.BkParameter
	Seed      []byte
	ChainCode []byte
}

type Type

type Type int32
const (
	Type_Initial        Type = 0
	Type_OtReceiver     Type = 1
	Type_OtSendResponse Type = 2
	Type_Commitment     Type = 3
	Type_Decommitment   Type = 4
	Type_Result         Type = 5
	Type_Verify         Type = 6
)

func (Type) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

func (Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Type.Descriptor instead.

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

func (Type) Type

func (Type) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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