Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hdkeychain: Use secp256k1 privkey to pubkey method.
This makes use of the PubKey method on secp256k1.PrivateKey to convert a private key to a public key instead of manually performing the conversion. This is desirable since secp256k1 provides the method specifically for this purpose and it also has the benefit of allowing secp256k1 to perform the task without round tripping through big integers which results in slightly faster derivation. The following benchmarks show a before and after comparison of the affected operations: benchmark old ns/op new ns/op delta ---------------------------------------------------------- BenchmarkDeriveHardened 3702 3671 -0.84% BenchmarkDeriveNormal 4053 3999 -1.33% benchmark old allocs new allocs delta ---------------------------------------------------------- BenchmarkDeriveHardened 14 14 +0.00% BenchmarkDeriveNormal 15 15 +0.00% benchmark old bytes new bytes delta ---------------------------------------------------------- BenchmarkDeriveHardened 1360 1360 +0.00% BenchmarkDeriveNormal 1409 1409 +0.00%
- Loading branch information