1 // csp is a package of cipher service provider
9 // var currentCrypt XXXXX
12 // currentCrypto map[string]XXXX
16 // currentCrypt = currentCrypto[config。?????]
19 type XPrvKeyer interface {
20 // XPub derives an extended public key from a given xprv.
22 // Derive generates a child xprv by recursively deriving
23 // non-hardened child xprvs over the list of selectors:
24 // `Derive([a,b,c,...]) == Child(a).Child(b).Child(c)...`
25 Derive(path [][]byte) XPrvKeyer
26 // Sign creates an EdDSA signature using expanded private key
27 // derived from the xprv.
28 Sign(msg []byte) []byte
31 type XPubKeyer interface {
32 // PublicKey extracts the public key from an xpub.
33 PublicKey() crypto.PublicKey
34 // Derive generates a child xpub by recursively deriving
35 // non-hardened child xpubs over the list of selectors:
36 // `Derive([a,b,c,...]) == Child(a).Child(b).Child(c)...`
37 Derive(path [][]byte) XPubKeyer
38 // Verify checks an EdDSA signature using public key
39 Verify(msg []byte, sig []byte) bool