mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-19 22:42:24 +00:00
c5c1689591
* crypto/secp256k1: Add godocs, remove indirection in privkeys The following was previously done for creating secp256k1 private keys: First obtain privkey bytes. Then create a private key in the underlying library, with scalar exponent equal to privKeyBytes. (The method called was secp256k1.PrivKeyFromBytes, https://github.com/btcsuite/btcd/blob/fb90c334dffc6c91843d8d36ac31e7f7eb6c7594/btcec/privkey.go#L21) Then the private key was serialized using the underlying library, which just returns back the bytes that comprised the scalar exponent, but padded to be exactly 32 bytes. https://github.com/btcsuite/btcd/blob/fb90c334dffc6c91843d8d36ac31e7f7eb6c7594/btcec/privkey.go#L70 Thus the entire indirection of calling the underlying library can be avoided by just ensuring that we pass in a 32 byte value. A test case has even be written to show this more clearly in review. * crypto/secp256k1: Address PR comments Squash this commit * crypto: Remove note about re-registering amino paths when unnecessary. This commit should be squashed.