MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / GenSecp256k1KeyPair

Function GenSecp256k1KeyPair

crypto/asymmetric/keypair.go:171–184  ·  view source on GitHub ↗

GenSecp256k1KeyPair generate Secp256k1(used by Bitcoin) key pair.

()

Source from the content-addressed store, hash-verified

169
170// GenSecp256k1KeyPair generate Secp256k1(used by Bitcoin) key pair.
171func GenSecp256k1KeyPair() (
172 privateKey *PrivateKey,
173 publicKey *PublicKey,
174 err error) {
175
176 privateKeyEc, err := ec.NewPrivateKey(ec.S256())
177 if err != nil {
178 log.WithError(err).Error("private key generation failed")
179 return nil, nil, err
180 }
181 publicKey = (*PublicKey)(privateKeyEc.PubKey())
182 privateKey = (*PrivateKey)(privateKeyEc)
183 return
184}
185
186// GetPubKeyNonce will make his best effort to find a difficult enough
187// nonce.

Callers 15

TestChainFunction · 0.92
TestMetaStateFunction · 0.92
generateRandomTransferFunction · 0.92
generateRandomBlockFunction · 0.92
setupFunction · 0.92
TestTxTransferFunction · 0.92
TestBaseAccountFunction · 0.92
TestIssueKeysFunction · 0.92
TestTxCreateDatabaseFunction · 0.92
CreateRandomBlockFunction · 0.92
BenchmarkEncodeFunction · 0.92
TestTypesFunction · 0.92

Calls 3

PubKeyMethod · 0.95
WithErrorFunction · 0.92
ErrorMethod · 0.80

Tested by 15

TestChainFunction · 0.74
TestMetaStateFunction · 0.74
generateRandomTransferFunction · 0.74
generateRandomBlockFunction · 0.74
setupFunction · 0.74
TestTxTransferFunction · 0.74
TestBaseAccountFunction · 0.74
TestIssueKeysFunction · 0.74
TestTxCreateDatabaseFunction · 0.74
BenchmarkEncodeFunction · 0.74
TestTypesFunction · 0.74
TestCipheringBasicFunction · 0.74