Documentation ¶
Index ¶
- func Contains(s []string, searchterm string) bool
- func GetDERSignature(r, s *big.Int) ([]byte, error)
- func GetDerivePathBytes(derivePath string) ([]uint32, error)
- func GetDerivedPubKey(hexPubKey, hexChainCode, path string, isEdDSA bool) (string, error)
- func GetHexEncodedPubKey(pubKey *tcrypto.ECPoint) (string, error)
- func GetThreshold(value int) (int, error)
- func HashToInt(hash []byte, c elliptic.Curve) *big.Int
- type KeygenRequest
- type KeygenResponse
- type KeysignRequest
- type KeysignResponse
- type LocalState
- type LocalStateAccessor
- type MessageFromTss
- type Messenger
- type ReshareRequest
- type ReshareResponse
- type Service
- type ServiceImpl
- func (s *ServiceImpl) ApplyData(msg string) error
- func (s *ServiceImpl) KeygenECDSA(req *KeygenRequest) (*KeygenResponse, error)
- func (s *ServiceImpl) KeygenEdDSA(req *KeygenRequest) (*KeygenResponse, error)
- func (s *ServiceImpl) KeysignECDSA(req *KeysignRequest) (*KeysignResponse, error)
- func (s *ServiceImpl) KeysignEdDSA(req *KeysignRequest) (*KeysignResponse, error)
- func (s *ServiceImpl) ReshareECDSA(req *ReshareRequest) (*ReshareResponse, error)
- func (s *ServiceImpl) ResharingEdDSA(req *ReshareRequest) (*ReshareResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains checks if a given string slice contains a specific search term. It iterates through the slice and returns true if the search term is found, false otherwise.
func GetDerivePathBytes ¶
func GetDerivedPubKey ¶
func GetHexEncodedPubKey ¶
GetHexEncodedPubKey returns the hexadecimal encoded string representation of an ECDSA/EDDSA public key. It takes a pointer to an ECPoint as input and returns the encoded string and an error. If the ECPoint is nil, it returns an empty string and an error indicating a nil ECPoint. If the ECPoint is not on the curve, it returns an empty string and an error indicating an invalid ECPoint.
func GetThreshold ¶
GetThreshold calculates the threshold value based on the input value. It takes an integer value as input and returns the threshold value and an error. If the input value is negative, it returns an error with the message "negative input".
func HashToInt ¶
HashToInt converts a byte slice hash to a big.Int value using the provided elliptic curve. If the length of the hash is greater than the orderBytes of the curve, it truncates the hash. It then performs a right shift on the resulting big.Int value to ensure it fits within the orderBits of the curve. The converted big.Int value is returned.
Types ¶
type KeygenRequest ¶
type KeygenRequest struct { LocalPartyID string AllParties string ChainCodeHex string // hex encoded chain code }
func (KeygenRequest) GetAllParties ¶
func (r KeygenRequest) GetAllParties() []string
type KeygenResponse ¶
type KeygenResponse struct {
PubKey string `json:"pub_key"`
}
type KeysignRequest ¶
type KeysignRequest struct { PubKey string `json:"pub_key"` MessageToSign string `json:"message_to_sign"` // base64 encoded message that need to be signed KeysignCommitteeKeys string `json:"keysign_committee_keys"` LocalPartyKey string `json:"local_party_key"` DerivePath string `json:"derive_path"` }
func (KeysignRequest) GetKeysignCommitteeKeys ¶
func (r KeysignRequest) GetKeysignCommitteeKeys() []string
type KeysignResponse ¶
type LocalState ¶
type LocalState struct { PubKey string `json:"pub_key"` ECDSALocalData keygen.LocalPartySaveData `json:"ecdsa_local_data"` EDDSALocalData eddsaKeygen.LocalPartySaveData `json:"eddsa_local_data"` KeygenCommitteeKeys []string `json:"keygen_committee_keys"` LocalPartyKey string `json:"local_party_key"` ChainCodeHex string `json:"chain_code_hex"` }
LocalState represent the information that will be saved locally
type LocalStateAccessor ¶
type MessageFromTss ¶
type ReshareRequest ¶
type ReshareRequest struct {}
ReshareRequest is used to request a reshare
func (ReshareRequest) GetNewParties ¶
func (r ReshareRequest) GetNewParties() []string
func (ReshareRequest) GetOldParties ¶
func (r ReshareRequest) GetOldParties() []string
type ReshareResponse ¶
type ReshareResponse struct {}
type Service ¶
type Service interface { // KeygenECDSA generates a new ECDSA keypair KeygenECDSA(req *KeygenRequest) (*KeygenResponse, error) // KeygenEDDSA generates a new EDDSA keypair KeygenEdDSA(req *KeygenRequest) (*KeygenResponse, error) // KeysignECDSA signs a message using ECDSA KeysignECDSA(req *KeysignRequest) (*KeysignResponse, error) // KeysignEDDSA signs a message using EDDSA KeysignEdDSA(req *KeysignRequest) (*KeysignResponse, error) // ApplyData applies the keygen data to the service ApplyData(string) error }
type ServiceImpl ¶
type ServiceImpl struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(msg Messenger, stateAccessor LocalStateAccessor, createPreParam bool) (*ServiceImpl, error)
NewService returns a new instance of the TSS service
func (*ServiceImpl) ApplyData ¶
func (s *ServiceImpl) ApplyData(msg string) error
ApplyData accept the data from other peers , usually the communication is coordinate by the library user
func (*ServiceImpl) KeygenECDSA ¶
func (s *ServiceImpl) KeygenECDSA(req *KeygenRequest) (*KeygenResponse, error)
func (*ServiceImpl) KeygenEdDSA ¶
func (s *ServiceImpl) KeygenEdDSA(req *KeygenRequest) (*KeygenResponse, error)
func (*ServiceImpl) KeysignECDSA ¶
func (s *ServiceImpl) KeysignECDSA(req *KeysignRequest) (*KeysignResponse, error)
func (*ServiceImpl) KeysignEdDSA ¶
func (s *ServiceImpl) KeysignEdDSA(req *KeysignRequest) (*KeysignResponse, error)
func (*ServiceImpl) ReshareECDSA ¶
func (s *ServiceImpl) ReshareECDSA(req *ReshareRequest) (*ReshareResponse, error)
func (*ServiceImpl) ResharingEdDSA ¶
func (s *ServiceImpl) ResharingEdDSA(req *ReshareRequest) (*ReshareResponse, error)