Documentation ¶
Index ¶
- func BytesToHashString(msg []byte) (string, error)
- func CheckKeyOnCurve(pkData []byte) (bool, error)
- func CheckUnicast(round RoundInfo) bool
- func GenerateSignature(msg []byte, msgID string, privKey crypto.PrivKey) ([]byte, error)
- func GetBroadcastMessageType(msgType message.TssMsgType) message.TssMsgType
- func GetECDSAPubKeyFromPubKeyData(pkData []byte) (*ecdsa.PublicKey, error)
- func GetPIDFromPartyID(partyID *btss.PartyID) (peer.ID, error)
- func GetPIDFromPubKey(pk crypto.PubKey) (peer.ID, error)
- func GetPIDFromPubKeyData(pk []byte) (peer.ID, error)
- func GetPIDsFromPubKeys(pks [][]byte) ([]peer.ID, error)
- func GetParties(keys []crypto.PubKey, localPK crypto.PubKey, peerMap map[string]*peer.AddrInfo) ([]*btss.PartyID, *btss.PartyID, error)
- func GetPatyIDInfoMap(partiesID []*btss.PartyID) (map[string]*btss.PartyID, error)
- func GetPreviousKeySignUicast(current string) string
- func GetPubKeyDataFromPartyID(partyID *btss.PartyID) ([]byte, error)
- func GetPubKeyDatasFromPartyIDs(partyIDs []*btss.PartyID) ([][]byte, error)
- func GetPubKeyDatasMapFromPartyIDs(partyIDs []*btss.PartyID) (map[string][]byte, error)
- func GetPubKeyFromPartyID(partyID *btss.PartyID) (crypto.PubKey, error)
- func GetPubKeyFromPubKeyData(pk []byte) (crypto.PubKey, error)
- func GetPubKeyInfoFromECDSAPubkey(ecdsaPk *ecdsa.PublicKey) (string, []byte, error)
- func GetPubKeysFromPartyIDs(partyIDs []*btss.PartyID) ([]crypto.PubKey, error)
- func GetPubKeysFromPubKeyDatas(pksData [][]byte) ([]crypto.PubKey, error)
- func GetTssPubKey(pubKeyPoint *bcrypto.ECPoint) (*ecdsa.PublicKey, error)
- func MsgToHashInt(msg []byte) (*big.Int, error)
- func MsgToHashString(msg []byte) (string, error)
- func SortPubKey(keys []crypto.PubKey)
- func VerifySignature(pubKey crypto.PubKey, message, sig []byte, msgID string) (bool, error)
- type PartyInfo
- type RoundInfo
- type Signature
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToHashString ¶
func CheckKeyOnCurve ¶
CheckKeyOnCurve check if a SECP256K1 public key is on the elliptic curve
func CheckUnicast ¶
due to the nature of tss, we may find the invalid share of the previous round only when we get the shares from the peers in the current round. So, when we identify an error in this round, we check whether the previous round is the unicast
func GenerateSignature ¶
func GetBroadcastMessageType ¶
func GetBroadcastMessageType(msgType message.TssMsgType) message.TssMsgType
GetBroadcastMessageType gets the broadcast message type of the message
func GetECDSAPubKeyFromPubKeyData ¶
pkData -> ecdsa.PublicKey
func GetPIDFromPartyID ¶
partyID -> pid
func GetPIDsFromPubKeys ¶
[]pkData -> []peer.ID
func GetParties ¶
func GetParties(keys []crypto.PubKey, localPK crypto.PubKey, peerMap map[string]*peer.AddrInfo) ([]*btss.PartyID, *btss.PartyID, error)
GetParties get parties and localParty according the parties pubkey and peersInfo. PeersInfo is needed to match the partyid.id with the serial number ID of the P2P Peer. []pubkeys, pubkey, peersInfo -> []partyIDs, partyID
func GetPatyIDInfoMap ¶
[]partyIDs -> map[partyID.id][partyID]
func GetPreviousKeySignUicast ¶
GetPreviousKeySignUicast eets the last unicast message for the current message
func GetPubKeyDataFromPartyID ¶
partyID -> pubkeyData
func GetPubKeyDatasFromPartyIDs ¶
[]partyID -> []pubkeyData
func GetPubKeyDatasMapFromPartyIDs ¶
[]partyID -> map[partyID.id][pubkeyData]
func GetPubKeyFromPartyID ¶
partyID -> pubkey
func GetPubKeyFromPubKeyData ¶
pkData -> pubkey
func GetPubKeyInfoFromECDSAPubkey ¶
ecdsa.PublicKey -> addr, byte
func GetPubKeysFromPartyIDs ¶
[]partyID -> []pubkey
func GetPubKeysFromPubKeyDatas ¶
[]pkData -> []pubkey
func GetTssPubKey ¶
ECPoint -> ecdsa.PublicKey
func MsgToHashString ¶
func SortPubKey ¶
Types ¶
type PartyInfo ¶
type PartyInfo struct { // Message identifier -> localParty of the message // - only one in keygen // - maybe some in keysign. Each message to be signed corresponds to a corresponding current participant PartyMap *sync.Map // partyID.id -> partyID PartyIDMap map[string]*btss.PartyID }
PartyInfo the information used by tss key gen and key sign
type Signature ¶
type Signature struct { Msg string `json:"signed_msg"` R string `json:"r"` S string `json:"s"` RecoveryID string `json:"recovery_id"` SignEthData []byte `json:"sign_eth_data"` }
func BatchSignatures ¶
func BatchSignatures(sigs []*bcommon.SignatureData, msgsToSign [][]byte) []Signature
BatchSignatures package the signature list and message list as message signature list