store

package
v3.0.0-...-6ddf7be Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GlobalStoreKeyPrefix is the prefix for global primitive state variables.
	GlobalStoreKeyPrefix = []byte{0x00}
	// DKGStoreKeyPrefix is the prefix for DKG store.
	DKGStoreKeyPrefix = []byte{0x01}
	// GroupStoreKeyPrefix is the prefix for group store.
	GroupStoreKeyPrefix = []byte{0x02}
	// DEStoreKeyPrefix is the prefix for DE store.
	DEStoreKeyPrefix = []byte{0x03}
)

Functions

func DEStoreKey

func DEStoreKey(pubDE types.DE) []byte

DEStoreKey returns the key to retrieve private (d, e) by public (D, E).

func DKGStoreKey

func DKGStoreKey(groupID tss.GroupID) []byte

DKGStoreKey returns the key to retrieve all data for a group.

func GroupStoreKey

func GroupStoreKey(pubKey tss.Point) []byte

GroupStoreKey returns the key to retrieve all data for a group.

Types

type DE

type DE struct {
	PubDE types.DE   `json:"pub_d_e"` // Public key of D and E
	PrivD tss.Scalar `json:"priv_d"`  // Private key d
	PrivE tss.Scalar `json:"priv_e"`  // Private key e
}

DE represents private value (D, E) used in TSS signing process.

type DKG

type DKG struct {
	GroupID        tss.GroupID  `json:"group_id"`          // Group ID associated with the DKG
	MemberID       tss.MemberID `json:"member_id"`         // Member ID associated with the DKG
	Coefficients   tss.Scalars  `json:"coefficients"`      // Coefficients used in the DKG process of the DKG
	OneTimePrivKey tss.Scalar   `json:"one_time_priv_key"` // One-time private key used in the DKG process of the DKG
}

DKG represents DKG information of a TSS group.

type Group

type Group struct {
	GroupPubKey tss.Point    `json:"group_pub_key"` // Public key of the group
	MemberID    tss.MemberID `json:"member_id"`     // Member ID associated with the group
	PrivKey     tss.Scalar   `json:"priv_key"`      // Private key associated with the group
}

Group represents a TSS group.

type Store

type Store struct {
	DB dbm.DB
}

Store represents a data store for storing data information for Cylinder process

func NewStore

func NewStore(db dbm.DB) *Store

NewStore creates a new instance of Store with the provided database.

func (*Store) DeleteDE

func (s *Store) DeleteDE(pubDE types.DE) error

DeleteDE deletes the private (d, E) by the given public (D, E)

func (*Store) DeleteDKG

func (s *Store) DeleteDKG(groupID tss.GroupID) error

DeleteDKG deletes the dkg information by the given group id.

func (*Store) GetAllDEs

func (s *Store) GetAllDEs() ([]DE, error)

GetAllDEs retrieves all DEs information

func (*Store) GetAllDKGs

func (s *Store) GetAllDKGs() ([]DKG, error)

GetAllDKGs retrieves all DKGs information

func (*Store) GetAllGroups

func (s *Store) GetAllGroups() ([]Group, error)

GetAllGroups retrieves all groups information

func (*Store) GetDE

func (s *Store) GetDE(pubDE types.DE) (DE, error)

GetDE retrieves the private (d, E) by the given public (D, E)

func (*Store) GetDKG

func (s *Store) GetDKG(groupID tss.GroupID) (DKG, error)

GetDKG retrieves the dkg information by the given group id.

func (*Store) GetGroup

func (s *Store) GetGroup(pubKey tss.Point) (Group, error)

GetGroup retrieves the group information by the given public key.

func (*Store) HasDE

func (s *Store) HasDE(pubDE types.DE) bool

func (*Store) SetDE

func (s *Store) SetDE(privDE DE) error

SetDE stores the private (d, E)

func (*Store) SetDKG

func (s *Store) SetDKG(dkg DKG) error

SetDKG stores the dkg information by the given group id.

func (*Store) SetGroup

func (s *Store) SetGroup(group Group) error

SetGroup stores the group information

Jump to

Keyboard shortcuts

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