2 go-crypto is a customized/convenience cryptography package
3 for supporting Tendermint.
5 It wraps select functionality of equivalent functions in the
6 Go standard library, for easy usage with our libraries.
10 All key generation functions return an instance of the PrivKey interface
11 which implements methods
13 AssertIsPrivKeyInner()
15 Sign(msg []byte) Signature
20 From the above method we can:
21 a) Retrieve the public key if needed
23 pubKey := key.PubKey()
26 privKey, err := crypto.GenPrivKeyEd25519()
30 pubKey := privKey.PubKey()
32 // And then you can use the private and public key
33 doSomething(privKey, pubKey)
36 We also provide hashing wrappers around algorithms:
39 sum := crypto.Sha256([]byte("This is Tendermint"))
40 fmt.Printf("%x\n", sum)
43 sum := crypto.Ripemd160([]byte("This is consensus"))
44 fmt.Printf("%x\n", sum)
48 // TODO: Add more docs in here