types

package
v0.0.0-...-8cb8a38 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SigningSessionIDPartLength = 32
	KeygenSessionIDLength      = 32
	ReSharingSessionIDLength   = 32
)

Variables

View Source
var (
	ErrInvalidLengthJoinSession        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowJoinSession          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupJoinSession = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSigning        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSigning          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSigning = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type AggregateSigningSessionID

type AggregateSigningSessionID []byte

AggregateSigningSessionID is a signing session ID, consisting of sorted and concatenated session ID parts from each participating peer.

func (AggregateSigningSessionID) Bytes

func (sid AggregateSigningSessionID) Bytes() []byte

Bytes returns the byte representation of the aggregate signing session ID.

func (AggregateSigningSessionID) IsPeerParticipant

func (asid AggregateSigningSessionID) IsPeerParticipant(
	peer_session_id_part SigningSessionIDPart,
) bool

IsPeerParticipant returns true if the given peer is a signer for the given aggregate session ID.

func (AggregateSigningSessionID) String

func (sid AggregateSigningSessionID) String() string

String returns the hex representation of the aggregate signing session ID.

func (AggregateSigningSessionID) Validate

func (sid AggregateSigningSessionID) Validate() error

Validate returns an error if the session ID is an invalid length.

type JoinKeygenSessionMessage

type JoinKeygenSessionMessage struct {
	// Shared session ID, same for all peers.
	KeygenSessionID []byte `protobuf:"bytes,1,opt,name=keygen_session_id,json=keygenSessionId,proto3" json:"keygen_session_id,omitempty"`
}

JoinKeygenSessionMessage is used to create and join a new keygen session.

func (*JoinKeygenSessionMessage) Descriptor

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

func (*JoinKeygenSessionMessage) Marshal

func (m *JoinKeygenSessionMessage) Marshal() (dAtA []byte, err error)

func (*JoinKeygenSessionMessage) MarshalTo

func (m *JoinKeygenSessionMessage) MarshalTo(dAtA []byte) (int, error)

func (*JoinKeygenSessionMessage) MarshalToSizedBuffer

func (m *JoinKeygenSessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JoinKeygenSessionMessage) ProtoMessage

func (*JoinKeygenSessionMessage) ProtoMessage()

func (*JoinKeygenSessionMessage) Reset

func (m *JoinKeygenSessionMessage) Reset()

func (*JoinKeygenSessionMessage) Size

func (m *JoinKeygenSessionMessage) Size() (n int)

func (*JoinKeygenSessionMessage) String

func (m *JoinKeygenSessionMessage) String() string

func (*JoinKeygenSessionMessage) Unmarshal

func (m *JoinKeygenSessionMessage) Unmarshal(dAtA []byte) error

func (*JoinKeygenSessionMessage) ValidateBasic

func (msg *JoinKeygenSessionMessage) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*JoinKeygenSessionMessage) XXX_DiscardUnknown

func (m *JoinKeygenSessionMessage) XXX_DiscardUnknown()

func (*JoinKeygenSessionMessage) XXX_Marshal

func (m *JoinKeygenSessionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JoinKeygenSessionMessage) XXX_Merge

func (m *JoinKeygenSessionMessage) XXX_Merge(src proto.Message)

func (*JoinKeygenSessionMessage) XXX_Size

func (m *JoinKeygenSessionMessage) XXX_Size() int

func (*JoinKeygenSessionMessage) XXX_Unmarshal

func (m *JoinKeygenSessionMessage) XXX_Unmarshal(b []byte) error

type JoinReSharingSessionMessage

type JoinReSharingSessionMessage struct {
	// Shared session ID, same for all peers.
	ReSharingSessionID []byte `protobuf:"bytes,1,opt,name=resharing_session_id,json=resharingSessionId,proto3" json:"resharing_session_id,omitempty"`
}

JoinReSharingSessionMessage is used to create and join a new resharing session.

func (*JoinReSharingSessionMessage) Descriptor

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

func (*JoinReSharingSessionMessage) Marshal

func (m *JoinReSharingSessionMessage) Marshal() (dAtA []byte, err error)

func (*JoinReSharingSessionMessage) MarshalTo

func (m *JoinReSharingSessionMessage) MarshalTo(dAtA []byte) (int, error)

func (*JoinReSharingSessionMessage) MarshalToSizedBuffer

func (m *JoinReSharingSessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JoinReSharingSessionMessage) ProtoMessage

func (*JoinReSharingSessionMessage) ProtoMessage()

func (*JoinReSharingSessionMessage) Reset

func (m *JoinReSharingSessionMessage) Reset()

func (*JoinReSharingSessionMessage) Size

func (m *JoinReSharingSessionMessage) Size() (n int)

func (*JoinReSharingSessionMessage) String

func (m *JoinReSharingSessionMessage) String() string

func (*JoinReSharingSessionMessage) Unmarshal

func (m *JoinReSharingSessionMessage) Unmarshal(dAtA []byte) error

func (*JoinReSharingSessionMessage) ValidateBasic

func (msg *JoinReSharingSessionMessage) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*JoinReSharingSessionMessage) XXX_DiscardUnknown

func (m *JoinReSharingSessionMessage) XXX_DiscardUnknown()

func (*JoinReSharingSessionMessage) XXX_Marshal

func (m *JoinReSharingSessionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JoinReSharingSessionMessage) XXX_Merge

func (m *JoinReSharingSessionMessage) XXX_Merge(src proto.Message)

func (*JoinReSharingSessionMessage) XXX_Size

func (m *JoinReSharingSessionMessage) XXX_Size() int

func (*JoinReSharingSessionMessage) XXX_Unmarshal

func (m *JoinReSharingSessionMessage) XXX_Unmarshal(b []byte) error

type JoinSessionMessage

type JoinSessionMessage struct {
	// Peer ID that sent this message, set by sender and validated by receiver.
	PeerID github_com_libp2p_go_libp2p_core_peer.ID `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3,customtype=github.com/libp2p/go-libp2p-core/peer.ID" json:"peer_id"`
	// Types that are valid to be assigned to Session:
	//	*JoinSessionMessage_JoinSigningSessionMessage
	//	*JoinSessionMessage_JoinKeygenSessionMessage
	//	*JoinSessionMessage_JoinResharingSessionMessage
	Session isJoinSessionMessage_Session `protobuf_oneof:"session"`
}

JoinSessionMessage is used to create a new signing session.

func NewJoinKeygenSessionMessage

func NewJoinKeygenSessionMessage(
	peerID peer.ID,
	keygen_session_id KeygenSessionID,
) JoinSessionMessage

NewJoinKeygenSessionMessage creates a new keygen JoinSessionMessage.

func NewJoinReSharingSessionMessage

func NewJoinReSharingSessionMessage(
	peerID peer.ID,
	resharing_session_id ReSharingSessionID,
) JoinSessionMessage

NewJoinReSharingSessionMessage creates a new resharing JoinSessionMessage.

func NewJoinSessionMessage

func NewJoinSessionMessage(
	peerID peer.ID,
	session isJoinSessionMessage_Session,
) JoinSessionMessage

NewJoinSessionMessage creates a new JoinSessionMessage.

func NewJoinSigningSessionMessage

func NewJoinSigningSessionMessage(
	peerID peer.ID,
	tx_hash common.Hash,
	session_id_part SigningSessionIDPart,
) JoinSessionMessage

NewJoinSigningSessionMessage creates a new signing JoinSessionMessage.

func (*JoinSessionMessage) Descriptor

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

func (*JoinSessionMessage) GetJoinKeygenSessionMessage

func (m *JoinSessionMessage) GetJoinKeygenSessionMessage() *JoinKeygenSessionMessage

func (*JoinSessionMessage) GetJoinResharingSessionMessage

func (m *JoinSessionMessage) GetJoinResharingSessionMessage() *JoinReSharingSessionMessage

func (*JoinSessionMessage) GetJoinSigningSessionMessage

func (m *JoinSessionMessage) GetJoinSigningSessionMessage() *JoinSigningSessionMessage

func (*JoinSessionMessage) GetSession

func (m *JoinSessionMessage) GetSession() isJoinSessionMessage_Session

func (*JoinSessionMessage) Marshal

func (m *JoinSessionMessage) Marshal() (dAtA []byte, err error)

func (*JoinSessionMessage) MarshalTo

func (m *JoinSessionMessage) MarshalTo(dAtA []byte) (int, error)

func (*JoinSessionMessage) MarshalToSizedBuffer

func (m *JoinSessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JoinSessionMessage) ProtoMessage

func (*JoinSessionMessage) ProtoMessage()

func (*JoinSessionMessage) Reset

func (m *JoinSessionMessage) Reset()

func (*JoinSessionMessage) Size

func (m *JoinSessionMessage) Size() (n int)

func (*JoinSessionMessage) String

func (m *JoinSessionMessage) String() string

func (*JoinSessionMessage) Unmarshal

func (m *JoinSessionMessage) Unmarshal(dAtA []byte) error

func (*JoinSessionMessage) ValidateBasic

func (msg *JoinSessionMessage) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*JoinSessionMessage) XXX_DiscardUnknown

func (m *JoinSessionMessage) XXX_DiscardUnknown()

func (*JoinSessionMessage) XXX_Marshal

func (m *JoinSessionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JoinSessionMessage) XXX_Merge

func (m *JoinSessionMessage) XXX_Merge(src proto.Message)

func (*JoinSessionMessage) XXX_OneofWrappers

func (*JoinSessionMessage) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*JoinSessionMessage) XXX_Size

func (m *JoinSessionMessage) XXX_Size() int

func (*JoinSessionMessage) XXX_Unmarshal

func (m *JoinSessionMessage) XXX_Unmarshal(b []byte) error

type JoinSessionMessage_JoinKeygenSessionMessage

type JoinSessionMessage_JoinKeygenSessionMessage struct {
	JoinKeygenSessionMessage *JoinKeygenSessionMessage `` /* 143-byte string literal not displayed */
}

func (*JoinSessionMessage_JoinKeygenSessionMessage) MarshalTo

func (*JoinSessionMessage_JoinKeygenSessionMessage) MarshalToSizedBuffer

func (m *JoinSessionMessage_JoinKeygenSessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JoinSessionMessage_JoinKeygenSessionMessage) Size

type JoinSessionMessage_JoinResharingSessionMessage

type JoinSessionMessage_JoinResharingSessionMessage struct {
	JoinResharingSessionMessage *JoinReSharingSessionMessage `` /* 152-byte string literal not displayed */
}

func (*JoinSessionMessage_JoinResharingSessionMessage) MarshalTo

func (*JoinSessionMessage_JoinResharingSessionMessage) MarshalToSizedBuffer

func (m *JoinSessionMessage_JoinResharingSessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JoinSessionMessage_JoinResharingSessionMessage) Size

type JoinSessionMessage_JoinSigningSessionMessage

type JoinSessionMessage_JoinSigningSessionMessage struct {
	JoinSigningSessionMessage *JoinSigningSessionMessage `` /* 146-byte string literal not displayed */
}

func (*JoinSessionMessage_JoinSigningSessionMessage) MarshalTo

func (*JoinSessionMessage_JoinSigningSessionMessage) MarshalToSizedBuffer

func (m *JoinSessionMessage_JoinSigningSessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JoinSessionMessage_JoinSigningSessionMessage) Size

type JoinSessionMessages

type JoinSessionMessages []JoinSessionMessage

JoinSessionMessages is a slice of JoinSessionMessages.

func (JoinSessionMessages) GetSessionID

func (jMsgs JoinSessionMessages) GetSessionID(threshold int) (
	AggregateSigningSessionID,
	peer.IDSlice,
	error,
)

GetSessionID returns the session ID of a signing session with a randomized subset of participants.

func (JoinSessionMessages) Len

func (a JoinSessionMessages) Len() int

func (JoinSessionMessages) Less

func (a JoinSessionMessages) Less(i, j int) bool

func (JoinSessionMessages) Swap

func (a JoinSessionMessages) Swap(i, j int)

func (JoinSessionMessages) ValidateBasic

func (jMsgs JoinSessionMessages) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

type JoinSigningSessionMessage

type JoinSigningSessionMessage struct {
	// Hash of the transaction that initiated the signing session.
	TxHash []byte `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"`
	// Random bytes different per peer to create an aggregated party session ID.
	PeerSessionIDPart []byte `protobuf:"bytes,2,opt,name=peer_session_id_part,json=peerSessionIdPart,proto3" json:"peer_session_id_part,omitempty"`
}

JoinSigningSessionMessage is used to create and join a new signing session.

func (*JoinSigningSessionMessage) Descriptor

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

func (*JoinSigningSessionMessage) GetPeerSessionIDPart

func (msg *JoinSigningSessionMessage) GetPeerSessionIDPart() SigningSessionIDPart

GetPeerSessionIDPart returns the SigningSessionIDPart

func (*JoinSigningSessionMessage) GetTxHash

func (msg *JoinSigningSessionMessage) GetTxHash() common.Hash

GetTxHash returns the transaction hash.

func (*JoinSigningSessionMessage) Marshal

func (m *JoinSigningSessionMessage) Marshal() (dAtA []byte, err error)

func (*JoinSigningSessionMessage) MarshalTo

func (m *JoinSigningSessionMessage) MarshalTo(dAtA []byte) (int, error)

func (*JoinSigningSessionMessage) MarshalToSizedBuffer

func (m *JoinSigningSessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JoinSigningSessionMessage) ProtoMessage

func (*JoinSigningSessionMessage) ProtoMessage()

func (*JoinSigningSessionMessage) Reset

func (m *JoinSigningSessionMessage) Reset()

func (*JoinSigningSessionMessage) Size

func (m *JoinSigningSessionMessage) Size() (n int)

func (*JoinSigningSessionMessage) String

func (m *JoinSigningSessionMessage) String() string

func (*JoinSigningSessionMessage) Unmarshal

func (m *JoinSigningSessionMessage) Unmarshal(dAtA []byte) error

func (*JoinSigningSessionMessage) ValidateBasic

func (msg *JoinSigningSessionMessage) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*JoinSigningSessionMessage) XXX_DiscardUnknown

func (m *JoinSigningSessionMessage) XXX_DiscardUnknown()

func (*JoinSigningSessionMessage) XXX_Marshal

func (m *JoinSigningSessionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JoinSigningSessionMessage) XXX_Merge

func (m *JoinSigningSessionMessage) XXX_Merge(src proto.Message)

func (*JoinSigningSessionMessage) XXX_Size

func (m *JoinSigningSessionMessage) XXX_Size() int

func (*JoinSigningSessionMessage) XXX_Unmarshal

func (m *JoinSigningSessionMessage) XXX_Unmarshal(b []byte) error

type KeygenSessionID

type KeygenSessionID [KeygenSessionIDLength]byte

KeygenSessionID is the ID for a keygen session.

type ReSharingSessionID

type ReSharingSessionID [ReSharingSessionIDLength]byte

ReSharingSessionID is the ID for a resharing session.

type SigningPartMessage

type SigningPartMessage struct {
	// Signing party session ID.
	SessionID []byte `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// Bytes from lib-tss to send.
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// If this message is broadcasted to all session peers.
	IsBroadcast bool `protobuf:"varint,3,opt,name=is_broadcast,json=isBroadcast,proto3" json:"is_broadcast,omitempty"`
}

SigningPartMessage is an outgoing message from lib-tss.

func NewSigningPartMessage

func NewSigningPartMessage(
	sessionID AggregateSigningSessionID,
	data []byte,
	isBroadcast bool,
) SigningPartMessage

func (*SigningPartMessage) Descriptor

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

func (*SigningPartMessage) GetSessionID

func (*SigningPartMessage) Marshal

func (m *SigningPartMessage) Marshal() (dAtA []byte, err error)

func (*SigningPartMessage) MarshalTo

func (m *SigningPartMessage) MarshalTo(dAtA []byte) (int, error)

func (*SigningPartMessage) MarshalToSizedBuffer

func (m *SigningPartMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SigningPartMessage) ProtoMessage

func (*SigningPartMessage) ProtoMessage()

func (*SigningPartMessage) Reset

func (m *SigningPartMessage) Reset()

func (*SigningPartMessage) Size

func (m *SigningPartMessage) Size() (n int)

func (*SigningPartMessage) String

func (m *SigningPartMessage) String() string

func (*SigningPartMessage) Unmarshal

func (m *SigningPartMessage) Unmarshal(dAtA []byte) error

func (*SigningPartMessage) ValidateBasic

func (m *SigningPartMessage) ValidateBasic() error

func (*SigningPartMessage) XXX_DiscardUnknown

func (m *SigningPartMessage) XXX_DiscardUnknown()

func (*SigningPartMessage) XXX_Marshal

func (m *SigningPartMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SigningPartMessage) XXX_Merge

func (m *SigningPartMessage) XXX_Merge(src proto.Message)

func (*SigningPartMessage) XXX_Size

func (m *SigningPartMessage) XXX_Size() int

func (*SigningPartMessage) XXX_Unmarshal

func (m *SigningPartMessage) XXX_Unmarshal(b []byte) error

type SigningPartyStartMessage

type SigningPartyStartMessage struct {
	// Hash of the transaction that initiated the signing session.
	TxHash []byte `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"`
	// Aggregated party session ID.
	SessionId []byte `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// The peer IDs of the parties involved in the signing session.
	ParticipatingPeerIDs []github_com_libp2p_go_libp2p_core_peer.ID `` /* 175-byte string literal not displayed */
}

func NewSigningPartyStartMessage

func NewSigningPartyStartMessage(
	txHash common.Hash,
	sessionID AggregateSigningSessionID,
	participatingPeerIDs []peer.ID,
) *SigningPartyStartMessage

NewSigningPartyStartMessage returns a new SigningPartyStartMessage.

func (*SigningPartyStartMessage) Descriptor

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

func (*SigningPartyStartMessage) GetSessionID

func (*SigningPartyStartMessage) GetTxHash

func (m *SigningPartyStartMessage) GetTxHash() common.Hash

func (*SigningPartyStartMessage) Marshal

func (m *SigningPartyStartMessage) Marshal() (dAtA []byte, err error)

func (*SigningPartyStartMessage) MarshalTo

func (m *SigningPartyStartMessage) MarshalTo(dAtA []byte) (int, error)

func (*SigningPartyStartMessage) MarshalToSizedBuffer

func (m *SigningPartyStartMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SigningPartyStartMessage) ProtoMessage

func (*SigningPartyStartMessage) ProtoMessage()

func (*SigningPartyStartMessage) Reset

func (m *SigningPartyStartMessage) Reset()

func (*SigningPartyStartMessage) Size

func (m *SigningPartyStartMessage) Size() (n int)

func (*SigningPartyStartMessage) String

func (m *SigningPartyStartMessage) String() string

func (*SigningPartyStartMessage) Unmarshal

func (m *SigningPartyStartMessage) Unmarshal(dAtA []byte) error

func (*SigningPartyStartMessage) ValidateBasic

func (m *SigningPartyStartMessage) ValidateBasic() error

func (*SigningPartyStartMessage) XXX_DiscardUnknown

func (m *SigningPartyStartMessage) XXX_DiscardUnknown()

func (*SigningPartyStartMessage) XXX_Marshal

func (m *SigningPartyStartMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SigningPartyStartMessage) XXX_Merge

func (m *SigningPartyStartMessage) XXX_Merge(src proto.Message)

func (*SigningPartyStartMessage) XXX_Size

func (m *SigningPartyStartMessage) XXX_Size() int

func (*SigningPartyStartMessage) XXX_Unmarshal

func (m *SigningPartyStartMessage) XXX_Unmarshal(b []byte) error

type SigningSessionIDPart

type SigningSessionIDPart [SigningSessionIDPartLength]byte

SigningSessionIDPart is a peer part of signing session ID.

func NewSigningSessionIDPart

func NewSigningSessionIDPart() (SigningSessionIDPart, error)

NewSigningSessionIDPart returns a new random SigningSessionIDPart.

func (SigningSessionIDPart) Bytes

func (s SigningSessionIDPart) Bytes() []byte

Bytes returns the bytes of the SigningSessionIDPart.

func (SigningSessionIDPart) String

func (s SigningSessionIDPart) String() string

String returns the hex string of the SigningSessionIDPart.

Jump to

Keyboard shortcuts

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