Documentation
¶
Index ¶
- func DeserializeECDSASecp256k1Signature(sigStr []byte) (*crypto.MPCECDSASignature, error)
- func Keygen(current crypto.PartyID, threshold int, peers []crypto.PartyID) ([]*cmp.Config, error)
- func SerializeECDSASecp256k1Signature(sig *crypto.MPCECDSASignature) ([]byte, error)
- func SignCMP(configs []*cmp.Config, m []byte, peers []crypto.PartyID) ([]byte, error)
- func VerifyCMP(config *cmp.Config, m []byte, sig []byte) (bool, error)
- type KeygenOption
- type KeygenOpts
- type OnConfigGenerated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeECDSASecp256k1Signature ¶
func DeserializeECDSASecp256k1Signature(sigStr []byte) (*crypto.MPCECDSASignature, error)
- The R and S values must be in the valid range for secp256k1 scalars:
- Negative values are rejected
- Zero is rejected
- Values greater than or equal to the secp256k1 group order are rejected
func SerializeECDSASecp256k1Signature ¶
func SerializeECDSASecp256k1Signature(sig *crypto.MPCECDSASignature) ([]byte, error)
SerializeECDSASecp256k1Signature marshals an ECDSA signature to DER format for use with the CMP protocol
Types ¶
type KeygenOption ¶
type KeygenOption func(*KeygenOpts)
KeygenOption is a function that configures an account.
func WithPeers ¶
func WithPeers(peers ...string) KeygenOption
WithPeers sets the list of all parties that can sign transactions.
func WithSelfID ¶
func WithSelfID(selfID string) KeygenOption
WithSelfID sets the ID of the account that is used to sign transactions.
func WithThreshold ¶
func WithThreshold(threshold int) KeygenOption
WithThreshold sets the number of required signatures to authorize a transaction.
type KeygenOpts ¶
type KeygenOpts struct { // AccName is the name of the account. AccName string // Network is the network that is used to communicate with other parties. Network crypto.Network // Threshold is the number of required signatures to authorize a transaction. Threshold int // Self SelfID is the SelfID of the account that is used to sign transactions. SelfID crypto.PartyID // Group is the list of all parties that can sign transactions. Peers []crypto.PartyID // CoinType is the coin type of the account. CoinType crypto.CoinType // mtx is a mutex that is used to synchronize access to the doneConfChan. sync.Mutex // contains filtered or unexported fields }
KeygenOpts is the configuration of an account.
type OnConfigGenerated ¶ added in v0.4.3
OnConfigGenerated is a callback function that is called when a new account is generated.
Click to show internal directories.
Click to hide internal directories.