signer

package
v1.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Type_name = map[int32]string{
		0: "Round1",
		1: "Round2",
	}
	Type_value = map[string]int32{
		"Round1": 0,
		"Round2": 1,
	}
)

Enum value maps for Type.

View Source
var (

	//ErrExceedMaxRetry is returned if we retried over times
	ErrExceedMaxRetry = errors.New("exceed max retries")
	//ErrVerifyFailure is returned if the verification is failure.
	ErrVerifyFailure = errors.New("the verification is failure")
	//ErrPeerNotFound is returned if peer message not found.
	ErrPeerNotFound = errors.New("peer message not found")
	//ErrTrivialSignature is returned if obtain trivial signature.
	ErrTrivialSignature = errors.New("obtain trivial signature")
	//ErrTrivialShaResult is returned if the output of SHAPoint is trivial.
	ErrTrivialShaResult = errors.New("the output of SHAPoint is trivial")
	//ErrNotSupportCurve is returned if the curve is not support.
	ErrNotSupportCurve = errors.New("if the curve is not support")
	//ErrTrivialPoint is returned if the point is trivial.
	ErrTrivialPoint = errors.New("the point is trivial")
	//ErrNotCorrectMessage is returned if the message is not correct.
	ErrNotCorrectMessage = errors.New("the message is not correct")
)
View Source
var File_github_com_getamis_alice_crypto_tss_eddsa_frost_signer_message_proto protoreflect.FileDescriptor

Functions

func SHAPoints

func SHAPoints(pubKey, R *ecpointgrouplaw.ECPoint, message []byte) (*big.Int, error)

Types

type BMessage

type BMessage struct {
	X []byte `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"`
	D []byte `protobuf:"bytes,2,opt,name=D,proto3" json:"D,omitempty"`
	E []byte `protobuf:"bytes,3,opt,name=E,proto3" json:"E,omitempty"`
	// contains filtered or unexported fields
}

func (*BMessage) Descriptor deprecated

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

Deprecated: Use BMessage.ProtoReflect.Descriptor instead.

func (*BMessage) GetD

func (x *BMessage) GetD() []byte

func (*BMessage) GetE

func (x *BMessage) GetE() []byte

func (*BMessage) GetX

func (x *BMessage) GetX() []byte

func (*BMessage) ProtoMessage

func (*BMessage) ProtoMessage()

func (*BMessage) ProtoReflect

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

func (*BMessage) Reset

func (x *BMessage) Reset()

func (*BMessage) String

func (x *BMessage) String() string

type BodyRound1

type BodyRound1 struct {
	D *ecpointgrouplaw.EcPointMessage `protobuf:"bytes,1,opt,name=D,proto3" json:"D,omitempty"`
	E *ecpointgrouplaw.EcPointMessage `protobuf:"bytes,2,opt,name=E,proto3" json:"E,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyRound1) Descriptor deprecated

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

Deprecated: Use BodyRound1.ProtoReflect.Descriptor instead.

func (*BodyRound1) GetD

func (*BodyRound1) GetE

func (*BodyRound1) ProtoMessage

func (*BodyRound1) ProtoMessage()

func (*BodyRound1) ProtoReflect

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

func (*BodyRound1) Reset

func (x *BodyRound1) Reset()

func (*BodyRound1) String

func (x *BodyRound1) String() string

type BodyRound2

type BodyRound2 struct {
	Zi []byte `protobuf:"bytes,1,opt,name=zi,proto3" json:"zi,omitempty"`
	// contains filtered or unexported fields
}

func (*BodyRound2) Descriptor deprecated

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

Deprecated: Use BodyRound2.ProtoReflect.Descriptor instead.

func (*BodyRound2) GetZi

func (x *BodyRound2) GetZi() []byte

func (*BodyRound2) ProtoMessage

func (*BodyRound2) ProtoMessage()

func (*BodyRound2) ProtoReflect

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

func (*BodyRound2) Reset

func (x *BodyRound2) Reset()

func (*BodyRound2) String

func (x *BodyRound2) String() string

type Message

type Message struct {
	Type Type   `protobuf:"varint,1,opt,name=type,proto3,enum=getamis.alice.crypto.tss.eddsa.frost.signer.Type" json:"type,omitempty"`
	Id   string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are assignable to Body:
	//	*Message_Round1
	//	*Message_Round2
	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) GetId

func (x *Message) GetId() string

func (*Message) GetMessageType

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

func (*Message) GetRound1

func (x *Message) GetRound1() *BodyRound1

func (*Message) GetRound2

func (x *Message) GetRound2() *BodyRound2

func (*Message) GetType

func (x *Message) GetType() Type

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_Round1

type Message_Round1 struct {
	Round1 *BodyRound1 `protobuf:"bytes,4,opt,name=round1,proto3,oneof"`
}

type Message_Round2

type Message_Round2 struct {
	Round2 *BodyRound2 `protobuf:"bytes,5,opt,name=round2,proto3,oneof"`
}

type Result

type Result struct {
	R *ecpointgrouplaw.ECPoint
	S *big.Int
}

type Signer

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

func NewSigner

func NewSigner(pubKey *ecpointgrouplaw.ECPoint, peerManager types.PeerManager, threshold uint32, share *big.Int, dkgResult *dkg.Result, msg []byte, listener types.StateChangedListener) (*Signer, error)

func (*Signer) GetResult

func (s *Signer) GetResult() (*Result, error)

GetResult returns the final result: public key, share, bks (including self bk)

func (*Signer) Start

func (s *Signer) Start()

type Type

type Type int32
const (
	Type_Round1 Type = 0
	Type_Round2 Type = 1
)

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