Documentation
¶
Index ¶
- Constants
- Variables
- type BlockStorageImp
- func (bs *BlockStorageImp) DeleteFile(fileName string) error
- func (bs *BlockStorageImp) Exist(fileName string) (bool, error)
- func (bs *BlockStorageImp) FileExist(fileName string) (bool, error)
- func (bs *BlockStorageImp) GetFile(fileName string) ([]byte, error)
- func (bs *BlockStorageImp) GetVault(fileName string) ([]byte, error)
- func (bs *BlockStorageImp) SaveVault(file string, content []byte) error
- func (bs *BlockStorageImp) UploadFile(fileContent []byte, fileName string) error
- func (bs *BlockStorageImp) UploadFileWithRetry(fileContent []byte, fileName string, retry int) error
- type DKLSTssService
- func (t *DKLSTssService) BackupVault(vaultName, localPartyId, email, pluginId string, partiesJoined []string, ...) error
- func (t *DKLSTssService) GetExistingVault(vaultFileName, password string) (*vaultType.Vault, error)
- func (t *DKLSTssService) GetMPCKeygenWrapper(isEdDSA bool) *MPCWrapperImp
- func (t *DKLSTssService) ProcessDKLSKeygen(req vgtypes.VaultCreateRequest) (string, string, error)
- func (t *DKLSTssService) ProcessDKLSKeysign(req types.KeysignRequest) (map[string]tss.KeysignResponse, error)
- func (t *DKLSTssService) ProcessReshare(vault *vaultType.Vault, sessionID string, hexEncryptionKey string, ...) error
- func (t *DKLSTssService) SaveVaultToStorage(vault *vaultType.Vault, email, pluginId string) error
- type Handle
- type KeyGenerationTaskResult
- type LocalStateAccessorImp
- type LocalVaultStorage
- type LocalVaultStorageConfig
- type MPCKeygenWrapper
- type MPCKeyshareWrapper
- type MPCKeysignWrapper
- type MPCQcWrapper
- type MPCSetupWrapper
- type MPCWrapperImp
- func (w *MPCWrapperImp) DecodeKeyID(setup []byte) ([]byte, error)
- func (w *MPCWrapperImp) DecodeMessage(setup []byte) ([]byte, error)
- func (w *MPCWrapperImp) DecodePartyName(setup []byte, index int) ([]byte, error)
- func (w *MPCWrapperImp) DecodeSessionID(setup []byte) ([]byte, error)
- func (w *MPCWrapperImp) KeyRefreshSessionFromSetup(setup []byte, id []byte, oldKeyshare Handle) (Handle, error)
- func (w *MPCWrapperImp) KeygenSessionFinish(h Handle) (Handle, error)
- func (w *MPCWrapperImp) KeygenSessionFree(h Handle) error
- func (w *MPCWrapperImp) KeygenSessionFromSetup(setup []byte, id []byte) (Handle, error)
- func (w *MPCWrapperImp) KeygenSessionInputMessage(h Handle, message []byte) (bool, error)
- func (w *MPCWrapperImp) KeygenSessionMessageReceiver(h Handle, message []byte, index int) (string, error)
- func (w *MPCWrapperImp) KeygenSessionOutputMessage(h Handle) ([]byte, error)
- func (w *MPCWrapperImp) KeygenSetupMsgNew(threshold int, keyID []byte, ids []byte) ([]byte, error)
- func (w *MPCWrapperImp) KeyshareChainCode(share Handle) ([]byte, error)
- func (w *MPCWrapperImp) KeyshareDeriveChildPublicKey(share Handle, derivationPathStr []byte) ([]byte, error)
- func (w *MPCWrapperImp) KeyshareFree(share Handle) error
- func (w *MPCWrapperImp) KeyshareFromBytes(buf []byte) (Handle, error)
- func (w *MPCWrapperImp) KeyshareKeyID(share Handle) ([]byte, error)
- func (w *MPCWrapperImp) KeysharePublicKey(share Handle) ([]byte, error)
- func (w *MPCWrapperImp) KeyshareToBytes(share Handle) ([]byte, error)
- func (w *MPCWrapperImp) KeyshareToRefreshBytes(share Handle) ([]byte, error)
- func (w *MPCWrapperImp) MigrateSessionFromSetup(setup []byte, id []byte, publicKey []byte, rootChainCode []byte, ...) (Handle, error)
- func (w *MPCWrapperImp) QcSessionFinish(h Handle) (Handle, error)
- func (w *MPCWrapperImp) QcSessionFromSetup(setupMsg []byte, id string, keyshareHandle Handle) (Handle, error)
- func (w *MPCWrapperImp) QcSessionInputMessage(h Handle, message []byte) (bool, error)
- func (w *MPCWrapperImp) QcSessionMessageReceiver(h Handle, message []byte, index int) (string, error)
- func (w *MPCWrapperImp) QcSessionOutputMessage(h Handle) ([]byte, error)
- func (w *MPCWrapperImp) QcSetupMsgNew(keyshareHandle Handle, threshod int, ids []string, oldParties []int, ...) ([]byte, error)
- func (w *MPCWrapperImp) RefreshShareFromBytes(buf []byte) (Handle, error)
- func (w *MPCWrapperImp) RefreshShareToBytes(share Handle) ([]byte, error)
- func (w *MPCWrapperImp) SignSessionFinish(h Handle) ([]byte, error)
- func (w *MPCWrapperImp) SignSessionFree(h Handle) error
- func (w *MPCWrapperImp) SignSessionFromSetup(setup []byte, id []byte, shareOrPresign Handle) (Handle, error)
- func (w *MPCWrapperImp) SignSessionInputMessage(h Handle, message []byte) (bool, error)
- func (w *MPCWrapperImp) SignSessionMessageReceiver(h Handle, message []byte, index int) ([]byte, error)
- func (w *MPCWrapperImp) SignSessionOutputMessage(h Handle) ([]byte, error)
- func (w *MPCWrapperImp) SignSetupMsgNew(keyID []byte, chainPath []byte, messageHash []byte, ids []byte) ([]byte, error)
- type ManagementService
- type Storage
Constants ¶
View Source
const EmailQueueName = "vault:email_queue"
View Source
const EmailVaultBackupTypeName = "key:email"
Variables ¶
View Source
var TssKeyGenTimeout = errors.New("keygen timeout")
Functions ¶
This section is empty.
Types ¶
type BlockStorageImp ¶
type BlockStorageImp struct {
// contains filtered or unexported fields
}
func NewBlockStorageImp ¶
func NewBlockStorageImp(cfg vault_config.BlockStorage) (*BlockStorageImp, error)
func (*BlockStorageImp) DeleteFile ¶
func (bs *BlockStorageImp) DeleteFile(fileName string) error
func (*BlockStorageImp) FileExist ¶
func (bs *BlockStorageImp) FileExist(fileName string) (bool, error)
func (*BlockStorageImp) GetFile ¶
func (bs *BlockStorageImp) GetFile(fileName string) ([]byte, error)
func (*BlockStorageImp) GetVault ¶
func (bs *BlockStorageImp) GetVault(fileName string) ([]byte, error)
func (*BlockStorageImp) SaveVault ¶
func (bs *BlockStorageImp) SaveVault(file string, content []byte) error
func (*BlockStorageImp) UploadFile ¶
func (bs *BlockStorageImp) UploadFile(fileContent []byte, fileName string) error
func (*BlockStorageImp) UploadFileWithRetry ¶
func (bs *BlockStorageImp) UploadFileWithRetry(fileContent []byte, fileName string, retry int) error
type DKLSTssService ¶
type DKLSTssService struct {
// contains filtered or unexported fields
}
func NewDKLSTssService ¶
func NewDKLSTssService(cfg vault_config.Config, storage Storage, queueClient *asynq.Client) (*DKLSTssService, error)
func (*DKLSTssService) BackupVault ¶
func (t *DKLSTssService) BackupVault(vaultName, localPartyId, email, pluginId string, partiesJoined []string, ecdsaPubkey, eddsaPubkey string, hexChainCode string, localStateAccessor *LocalStateAccessorImp) error
func (*DKLSTssService) GetExistingVault ¶
func (t *DKLSTssService) GetExistingVault(vaultFileName, password string) (*vaultType.Vault, error)
func (*DKLSTssService) GetMPCKeygenWrapper ¶
func (t *DKLSTssService) GetMPCKeygenWrapper(isEdDSA bool) *MPCWrapperImp
func (*DKLSTssService) ProcessDKLSKeygen ¶
func (t *DKLSTssService) ProcessDKLSKeygen(req vgtypes.VaultCreateRequest) (string, string, error)
func (*DKLSTssService) ProcessDKLSKeysign ¶
func (t *DKLSTssService) ProcessDKLSKeysign(req types.KeysignRequest) (map[string]tss.KeysignResponse, error)
func (*DKLSTssService) ProcessReshare ¶
func (*DKLSTssService) SaveVaultToStorage ¶
func (t *DKLSTssService) SaveVaultToStorage(vault *vaultType.Vault, email, pluginId string) error
type KeyGenerationTaskResult ¶
KeyGenerationTaskResult is a struct that represents the result of a key generation task
type LocalStateAccessorImp ¶
type LocalStateAccessorImp struct {
Vault *vaultType.Vault
// contains filtered or unexported fields
}
func NewLocalStateAccessorImp ¶
func NewLocalStateAccessorImp(vault *vaultType.Vault) *LocalStateAccessorImp
NewLocalStateAccessorImp creates a new instance of LocalStateAccessorImp
func (*LocalStateAccessorImp) GetLocalCacheState ¶
func (l *LocalStateAccessorImp) GetLocalCacheState(pubKey string) (string, error)
func (*LocalStateAccessorImp) GetLocalState ¶
func (l *LocalStateAccessorImp) GetLocalState(pubKey string) (string, error)
func (*LocalStateAccessorImp) SaveLocalState ¶
func (l *LocalStateAccessorImp) SaveLocalState(pubKey, localState string) error
type LocalVaultStorage ¶
type LocalVaultStorage struct {
// contains filtered or unexported fields
}
func NewLocalVaultStorage ¶
func NewLocalVaultStorage(cfg LocalVaultStorageConfig) (*LocalVaultStorage, error)
func (*LocalVaultStorage) DeleteFile ¶
func (lvs *LocalVaultStorage) DeleteFile(fileName string) error
func (*LocalVaultStorage) Exist ¶
func (lvs *LocalVaultStorage) Exist(fileName string) (bool, error)
type LocalVaultStorageConfig ¶
type LocalVaultStorageConfig struct {
VaultFilePath string `mapstructure:"vault_file_path" json:"vault_file_path"`
}
type MPCKeygenWrapper ¶
type MPCKeygenWrapper interface {
KeygenSetupMsgNew(threshold int, keyID []byte, ids []byte) ([]byte, error)
KeygenSessionFromSetup(setup []byte, id []byte) (Handle, error)
KeyRefreshSessionFromSetup(setup []byte, id []byte, oldKeyshare Handle) (Handle, error)
KeygenSessionOutputMessage(session Handle) ([]byte, error)
KeygenSessionInputMessage(session Handle, message []byte) (bool, error)
KeygenSessionMessageReceiver(session Handle, message []byte, index int) (string, error)
KeygenSessionFinish(session Handle) (Handle, error)
KeygenSessionFree(session Handle) error
MigrateSessionFromSetup(setup []byte, id []byte, publicKey []byte, rootChainCode []byte, secretCoefficient []byte) (Handle, error)
}
type MPCKeyshareWrapper ¶
type MPCKeyshareWrapper interface {
}
type MPCKeysignWrapper ¶
type MPCKeysignWrapper interface {
SignSetupMsgNew(keyID []byte, chainPath []byte, messageHash []byte, ids []byte) ([]byte, error)
SignSessionFromSetup(setup []byte, id []byte, shareOrPresign Handle) (Handle, error)
SignSessionOutputMessage(session Handle) ([]byte, error)
SignSessionMessageReceiver(session Handle, message []byte, index int) ([]byte, error)
SignSessionInputMessage(session Handle, message []byte) (bool, error)
SignSessionFinish(session Handle) ([]byte, error)
SignSessionFree(session Handle) error
}
type MPCQcWrapper ¶
type MPCQcWrapper interface {
QcSetupMsgNew(keyshareHandle Handle, threshold int, ids []string, oldParties []int, newParties []int) ([]byte, error)
QcSessionFromSetup(setupMsg []byte, id string, keyshareHandle Handle) (Handle, error)
QcSessionOutputMessage(session Handle) ([]byte, error)
QcSessionMessageReceiver(session Handle, message []byte, index int) (string, error)
QcSessionInputMessage(session Handle, message []byte) (bool, error)
QcSessionFinish(session Handle) (Handle, error)
}
type MPCSetupWrapper ¶
type MPCWrapperImp ¶
type MPCWrapperImp struct {
// contains filtered or unexported fields
}
func NewMPCWrapperImp ¶
func NewMPCWrapperImp(isEdDSA bool) *MPCWrapperImp
func (*MPCWrapperImp) DecodeKeyID ¶
func (w *MPCWrapperImp) DecodeKeyID(setup []byte) ([]byte, error)
func (*MPCWrapperImp) DecodeMessage ¶
func (w *MPCWrapperImp) DecodeMessage(setup []byte) ([]byte, error)
func (*MPCWrapperImp) DecodePartyName ¶
func (w *MPCWrapperImp) DecodePartyName(setup []byte, index int) ([]byte, error)
func (*MPCWrapperImp) DecodeSessionID ¶
func (w *MPCWrapperImp) DecodeSessionID(setup []byte) ([]byte, error)
func (*MPCWrapperImp) KeyRefreshSessionFromSetup ¶
func (*MPCWrapperImp) KeygenSessionFinish ¶
func (w *MPCWrapperImp) KeygenSessionFinish(h Handle) (Handle, error)
func (*MPCWrapperImp) KeygenSessionFree ¶
func (w *MPCWrapperImp) KeygenSessionFree(h Handle) error
func (*MPCWrapperImp) KeygenSessionFromSetup ¶
func (w *MPCWrapperImp) KeygenSessionFromSetup(setup []byte, id []byte) (Handle, error)
func (*MPCWrapperImp) KeygenSessionInputMessage ¶
func (w *MPCWrapperImp) KeygenSessionInputMessage(h Handle, message []byte) (bool, error)
func (*MPCWrapperImp) KeygenSessionMessageReceiver ¶
func (*MPCWrapperImp) KeygenSessionOutputMessage ¶
func (w *MPCWrapperImp) KeygenSessionOutputMessage(h Handle) ([]byte, error)
func (*MPCWrapperImp) KeygenSetupMsgNew ¶
func (*MPCWrapperImp) KeyshareChainCode ¶
func (w *MPCWrapperImp) KeyshareChainCode(share Handle) ([]byte, error)
func (*MPCWrapperImp) KeyshareDeriveChildPublicKey ¶
func (w *MPCWrapperImp) KeyshareDeriveChildPublicKey(share Handle, derivationPathStr []byte) ([]byte, error)
func (*MPCWrapperImp) KeyshareFree ¶
func (w *MPCWrapperImp) KeyshareFree(share Handle) error
func (*MPCWrapperImp) KeyshareFromBytes ¶
func (w *MPCWrapperImp) KeyshareFromBytes(buf []byte) (Handle, error)
func (*MPCWrapperImp) KeyshareKeyID ¶
func (w *MPCWrapperImp) KeyshareKeyID(share Handle) ([]byte, error)
func (*MPCWrapperImp) KeysharePublicKey ¶
func (w *MPCWrapperImp) KeysharePublicKey(share Handle) ([]byte, error)
func (*MPCWrapperImp) KeyshareToBytes ¶
func (w *MPCWrapperImp) KeyshareToBytes(share Handle) ([]byte, error)
func (*MPCWrapperImp) KeyshareToRefreshBytes ¶
func (w *MPCWrapperImp) KeyshareToRefreshBytes(share Handle) ([]byte, error)
func (*MPCWrapperImp) MigrateSessionFromSetup ¶
func (*MPCWrapperImp) QcSessionFinish ¶
func (w *MPCWrapperImp) QcSessionFinish(h Handle) (Handle, error)
func (*MPCWrapperImp) QcSessionFromSetup ¶
func (*MPCWrapperImp) QcSessionInputMessage ¶
func (w *MPCWrapperImp) QcSessionInputMessage(h Handle, message []byte) (bool, error)
func (*MPCWrapperImp) QcSessionMessageReceiver ¶
func (*MPCWrapperImp) QcSessionOutputMessage ¶
func (w *MPCWrapperImp) QcSessionOutputMessage(h Handle) ([]byte, error)
func (*MPCWrapperImp) QcSetupMsgNew ¶
func (*MPCWrapperImp) RefreshShareFromBytes ¶
func (w *MPCWrapperImp) RefreshShareFromBytes(buf []byte) (Handle, error)
func (*MPCWrapperImp) RefreshShareToBytes ¶
func (w *MPCWrapperImp) RefreshShareToBytes(share Handle) ([]byte, error)
func (*MPCWrapperImp) SignSessionFinish ¶
func (w *MPCWrapperImp) SignSessionFinish(h Handle) ([]byte, error)
func (*MPCWrapperImp) SignSessionFree ¶
func (w *MPCWrapperImp) SignSessionFree(h Handle) error
func (*MPCWrapperImp) SignSessionFromSetup ¶
func (*MPCWrapperImp) SignSessionInputMessage ¶
func (w *MPCWrapperImp) SignSessionInputMessage(h Handle, message []byte) (bool, error)
func (*MPCWrapperImp) SignSessionMessageReceiver ¶
func (*MPCWrapperImp) SignSessionOutputMessage ¶
func (w *MPCWrapperImp) SignSessionOutputMessage(h Handle) ([]byte, error)
func (*MPCWrapperImp) SignSetupMsgNew ¶
type ManagementService ¶
type ManagementService struct {
// contains filtered or unexported fields
}
ManagementService is a struct that represents the vault management service it provides the following capatilities - Keygen -- create vault / reshare vault - Keysign -- sign a message
func NewManagementService ¶
func NewManagementService( cfg vault_config.Config, queueClient *asynq.Client, storage Storage, txIndexerService *tx_indexer.Service, ) (*ManagementService, error)
NewManagementService creates a new instance of the ManagementService
func (*ManagementService) HandleKeyGenerationDKLS ¶
func (*ManagementService) HandleKeySignDKLS ¶
func (*ManagementService) HandleReshareDKLS ¶
Click to show internal directories.
Click to hide internal directories.