exported

package
v0.0.0-...-5efa85e Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyIDLengthMin = 4
	KeyIDLengthMax = 256
)

key id length range bounds dictated by tofnd

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var KeyRole_name = map[int32]string{
	0: "KEY_ROLE_UNSPECIFIED",
	1: "KEY_ROLE_MASTER_KEY",
	2: "KEY_ROLE_SECONDARY_KEY",
	3: "KEY_ROLE_EXTERNAL_KEY",
}
View Source
var KeyRole_value = map[string]int32{
	"KEY_ROLE_UNSPECIFIED":   0,
	"KEY_ROLE_MASTER_KEY":    1,
	"KEY_ROLE_SECONDARY_KEY": 2,
	"KEY_ROLE_EXTERNAL_KEY":  3,
}
View Source
var KeyShareDistributionPolicy_name = map[int32]string{
	0: "KEY_SHARE_DISTRIBUTION_POLICY_UNSPECIFIED",
	1: "KEY_SHARE_DISTRIBUTION_POLICY_WEIGHTED_BY_STAKE",
	2: "KEY_SHARE_DISTRIBUTION_POLICY_ONE_PER_VALIDATOR",
}
View Source
var KeyShareDistributionPolicy_value = map[string]int32{
	"KEY_SHARE_DISTRIBUTION_POLICY_UNSPECIFIED":       0,
	"KEY_SHARE_DISTRIBUTION_POLICY_WEIGHTED_BY_STAKE": 1,
	"KEY_SHARE_DISTRIBUTION_POLICY_ONE_PER_VALIDATOR": 2,
}
View Source
var KeyType_name = map[int32]string{
	0: "KEY_TYPE_UNSPECIFIED",
	1: "KEY_TYPE_NONE",
	2: "KEY_TYPE_THRESHOLD",
	3: "KEY_TYPE_MULTISIG",
}
View Source
var KeyType_value = map[string]int32{
	"KEY_TYPE_UNSPECIFIED": 0,
	"KEY_TYPE_NONE":        1,
	"KEY_TYPE_THRESHOLD":   2,
	"KEY_TYPE_MULTISIG":    3,
}

Functions

func ComputeAbsCorruptionThreshold

func ComputeAbsCorruptionThreshold(safetyThreshold utils.Threshold, totalShareCount sdk.Int) int64

ComputeAbsCorruptionThreshold returns absolute corruption threshold to be used by tss. (threshold + 1) shares are required to sign

Types

type KeyID

type KeyID string

KeyID ensures a correctly formatted tss key ID

func (KeyID) Validate

func (id KeyID) Validate() error

Validate returns an error, if the key ID is too short or too long

type KeyRequirement

type KeyRequirement struct {
	KeyRole                    KeyRole                    `protobuf:"varint,1,opt,name=key_role,json=keyRole,proto3,enum=axelar.tss.exported.v1beta1.KeyRole" json:"key_role,omitempty"`
	KeyType                    KeyType                    `protobuf:"varint,2,opt,name=key_type,json=keyType,proto3,enum=axelar.tss.exported.v1beta1.KeyType" json:"key_type,omitempty"`
	MinKeygenThreshold         utils.Threshold            `protobuf:"bytes,3,opt,name=min_keygen_threshold,json=minKeygenThreshold,proto3" json:"min_keygen_threshold"`
	SafetyThreshold            utils.Threshold            `protobuf:"bytes,4,opt,name=safety_threshold,json=safetyThreshold,proto3" json:"safety_threshold"`
	KeyShareDistributionPolicy KeyShareDistributionPolicy `` /* 204-byte string literal not displayed */
	MaxTotalShareCount         int64                      `protobuf:"varint,6,opt,name=max_total_share_count,json=maxTotalShareCount,proto3" json:"max_total_share_count,omitempty"`
	MinTotalShareCount         int64                      `protobuf:"varint,7,opt,name=min_total_share_count,json=minTotalShareCount,proto3" json:"min_total_share_count,omitempty"`
	KeygenVotingThreshold      utils.Threshold            `protobuf:"bytes,8,opt,name=keygen_voting_threshold,json=keygenVotingThreshold,proto3" json:"keygen_voting_threshold"`
	SignVotingThreshold        utils.Threshold            `protobuf:"bytes,9,opt,name=sign_voting_threshold,json=signVotingThreshold,proto3" json:"sign_voting_threshold"`
	KeygenTimeout              int64                      `protobuf:"varint,10,opt,name=keygen_timeout,json=keygenTimeout,proto3" json:"keygen_timeout,omitempty"`
	SignTimeout                int64                      `protobuf:"varint,11,opt,name=sign_timeout,json=signTimeout,proto3" json:"sign_timeout,omitempty"`
}

KeyRequirement defines requirements for keys

func (*KeyRequirement) Descriptor

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

func (*KeyRequirement) GetKeyRole

func (m *KeyRequirement) GetKeyRole() KeyRole

func (*KeyRequirement) GetKeyShareDistributionPolicy

func (m *KeyRequirement) GetKeyShareDistributionPolicy() KeyShareDistributionPolicy

func (*KeyRequirement) GetKeyType

func (m *KeyRequirement) GetKeyType() KeyType

func (*KeyRequirement) GetKeygenTimeout

func (m *KeyRequirement) GetKeygenTimeout() int64

func (*KeyRequirement) GetKeygenVotingThreshold

func (m *KeyRequirement) GetKeygenVotingThreshold() utils.Threshold

func (*KeyRequirement) GetMaxTotalShareCount

func (m *KeyRequirement) GetMaxTotalShareCount() int64

func (*KeyRequirement) GetMinKeygenThreshold

func (m *KeyRequirement) GetMinKeygenThreshold() utils.Threshold

func (*KeyRequirement) GetMinTotalShareCount

func (m *KeyRequirement) GetMinTotalShareCount() int64

func (*KeyRequirement) GetSafetyThreshold

func (m *KeyRequirement) GetSafetyThreshold() utils.Threshold

func (*KeyRequirement) GetSignTimeout

func (m *KeyRequirement) GetSignTimeout() int64

func (*KeyRequirement) GetSignVotingThreshold

func (m *KeyRequirement) GetSignVotingThreshold() utils.Threshold

func (*KeyRequirement) Marshal

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

func (*KeyRequirement) MarshalTo

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

func (*KeyRequirement) MarshalToSizedBuffer

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

func (*KeyRequirement) ProtoMessage

func (*KeyRequirement) ProtoMessage()

func (*KeyRequirement) Reset

func (m *KeyRequirement) Reset()

func (*KeyRequirement) Size

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

func (*KeyRequirement) String

func (m *KeyRequirement) String() string

func (*KeyRequirement) Unmarshal

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

func (KeyRequirement) Validate

func (m KeyRequirement) Validate() error

Validate validates the KeyRequirement

func (*KeyRequirement) XXX_DiscardUnknown

func (m *KeyRequirement) XXX_DiscardUnknown()

func (*KeyRequirement) XXX_Marshal

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

func (*KeyRequirement) XXX_Merge

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

func (*KeyRequirement) XXX_Size

func (m *KeyRequirement) XXX_Size() int

func (*KeyRequirement) XXX_Unmarshal

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

type KeyRole

type KeyRole int32
const (
	Unknown      KeyRole = 0
	MasterKey    KeyRole = 1
	SecondaryKey KeyRole = 2
	ExternalKey  KeyRole = 3
)

func KeyRoleFromSimpleStr

func KeyRoleFromSimpleStr(str string) (KeyRole, error)

KeyRoleFromSimpleStr creates a KeyRole from string

func (KeyRole) EnumDescriptor

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

func (KeyRole) SimpleString

func (x KeyRole) SimpleString() string

SimpleString returns a human-readable string

func (KeyRole) String

func (x KeyRole) String() string

func (KeyRole) Validate

func (x KeyRole) Validate() error

Validate validates the KeyRole

type KeyShareDistributionPolicy

type KeyShareDistributionPolicy int32
const (
	Unspecified     KeyShareDistributionPolicy = 0
	WeightedByStake KeyShareDistributionPolicy = 1
	OnePerValidator KeyShareDistributionPolicy = 2
)

func KeyShareDistributionPolicyFromSimpleStr

func KeyShareDistributionPolicyFromSimpleStr(str string) (KeyShareDistributionPolicy, error)

KeyShareDistributionPolicyFromSimpleStr creates a KeyShareDistributionPolicy from string

func (KeyShareDistributionPolicy) EnumDescriptor

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

func (KeyShareDistributionPolicy) SimpleString

func (r KeyShareDistributionPolicy) SimpleString() string

SimpleString returns a human-readable string

func (KeyShareDistributionPolicy) String

func (KeyShareDistributionPolicy) Validate

func (r KeyShareDistributionPolicy) Validate() error

Validate validates the KeyShareDistributionPolicy

type KeyType

type KeyType int32
const (
	KEY_TYPE_UNSPECIFIED KeyType = 0
	None                 KeyType = 1
	Threshold            KeyType = 2
	Multisig             KeyType = 3
)

func (KeyType) EnumDescriptor

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

func (KeyType) SimpleString

func (x KeyType) SimpleString() string

SimpleString returns a human-readable string

func (KeyType) String

func (x KeyType) String() string

func (KeyType) Validate

func (x KeyType) Validate() error

Validate validates the KeyType

type SigKeyPair

type SigKeyPair struct {
	PubKey    []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
	Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}

PubKeyInfo holds a pubkey and a signature

func (*SigKeyPair) Descriptor

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

func (SigKeyPair) GetKey

func (m SigKeyPair) GetKey() (ecdsa.PublicKey, error)

GetKey returns the public key of the SigKeyPair

func (*SigKeyPair) GetPubKey

func (m *SigKeyPair) GetPubKey() []byte

func (SigKeyPair) GetSig

func (m SigKeyPair) GetSig() (ec.Signature, error)

GetSig returns the signature of the SigKeyPair

func (*SigKeyPair) GetSignature

func (m *SigKeyPair) GetSignature() []byte

func (*SigKeyPair) Marshal

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

func (*SigKeyPair) MarshalTo

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

func (*SigKeyPair) MarshalToSizedBuffer

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

func (*SigKeyPair) ProtoMessage

func (*SigKeyPair) ProtoMessage()

func (*SigKeyPair) Reset

func (m *SigKeyPair) Reset()

func (*SigKeyPair) Size

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

func (*SigKeyPair) String

func (m *SigKeyPair) String() string

func (*SigKeyPair) Unmarshal

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

func (SigKeyPair) Validate

func (m SigKeyPair) Validate() error

Validate validates the SigKeyPair

func (*SigKeyPair) XXX_DiscardUnknown

func (m *SigKeyPair) XXX_DiscardUnknown()

func (*SigKeyPair) XXX_Marshal

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

func (*SigKeyPair) XXX_Merge

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

func (*SigKeyPair) XXX_Size

func (m *SigKeyPair) XXX_Size() int

func (*SigKeyPair) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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