conversion

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 21 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccPubKeysFromPartyIDs

func AccPubKeysFromPartyIDs(partyIDs []string, partyIDMap map[string]*btss.PartyID) ([]string, error)

func BytesToHashString

func BytesToHashString(msg []byte) (string, error)

func CheckKeyOnCurve

func CheckKeyOnCurve(pk string) (bool, error)

func GetParties

func GetParties(keys []string, localPartyKey string) ([]*btss.PartyID, *btss.PartyID, error)

func GetPeerIDFromPartyID

func GetPeerIDFromPartyID(partyID *btss.PartyID) (peer.ID, error)

func GetPeerIDFromPubKey

func GetPeerIDFromPubKey(pubkey string) (peer.ID, error)

GetPeerIDFromPubKey get the peer.ID from bech32 format node pub key

func GetPeerIDFromSecp256PubKey

func GetPeerIDFromSecp256PubKey(pk secp256k1.PubKeySecp256k1) (peer.ID, error)

GetPeerIDFromSecp256PubKey convert the given pubkey into a peer.ID

func GetPeerIDs

func GetPeerIDs(pubkeys []string) ([]peer.ID, error)

GetPeerIDs return a slice of peer id

func GetPeerIDsFromPubKeys

func GetPeerIDsFromPubKeys(pubkeys []string) ([]string, error)

GetPeerIDsFromPubKeys convert a list of node pub key to their peer.ID

func GetPeersID

func GetPeersID(partyIDtoP2PID map[string]peer.ID, localPeerID string) []peer.ID

func GetPreviousKeySignUicast

func GetPreviousKeySignUicast(current string) string

func GetPriKey

func GetPriKey(priKeyString string) (tcrypto.PrivKey, error)

func GetPriKeyRawBytes

func GetPriKeyRawBytes(priKey tcrypto.PrivKey) ([]byte, error)

func GetPubKeyFromPeerID

func GetPubKeyFromPeerID(pID string) (string, error)

GetPubKeyFromPeerID extract the pub key from PeerID

func GetPubKeysFromPeerIDs

func GetPubKeysFromPeerIDs(peers []string) ([]string, error)

GetPubKeysFromPeerIDs given a list of peer ids, and get a list og pub keys.

func GetRandomPeerID

func GetRandomPeerID() peer.ID

GetRandomPeerID for test

func GetRandomPubKey

func GetRandomPubKey() string

GetRandomPubKey for test

func GetTssPubKey

func GetTssPubKey(pubKeyPoint *crypto.ECPoint) (string, types.AccAddress, error)

func PartyIDtoPubKey

func PartyIDtoPubKey(party *btss.PartyID) (string, error)

func RandStringBytesMask

func RandStringBytesMask(n int) string

func SetupBech32Prefix

func SetupBech32Prefix()

func SetupIDMaps

func SetupIDMaps(parties map[string]*btss.PartyID, partyIDtoP2PID map[string]peer.ID) error

func SetupPartyIDMap

func SetupPartyIDMap(partiesID []*btss.PartyID) map[string]*btss.PartyID

Types

This section is empty.

Jump to

Keyboard shortcuts

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