MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / generateKeyPair

Function generateKeyPair

crypto/secp256k1/secp256_test.go:19–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17const TestCount = 1000
18
19func generateKeyPair() (pubkey, privkey []byte) {
20 key, err := ecdsa.GenerateKey(S256(), rand.Reader)
21 if err != nil {
22 panic(err)
23 }
24 pubkey = elliptic.Marshal(S256(), key.X, key.Y)
25
26 privkey = make([]byte, 32)
27 blob := key.D.Bytes()
28 copy(privkey[32-len(blob):], blob)
29
30 return pubkey, privkey
31}
32
33func csprngEntropy(n int) []byte {
34 buf := make([]byte, n)

Callers 10

TestSignatureValidityFunction · 0.70
TestInvalidRecoveryIDFunction · 0.70
TestSignAndRecoverFunction · 0.70
TestSignDeterministicFunction · 0.70
BenchmarkSignFunction · 0.70
BenchmarkRecoverFunction · 0.70

Calls 3

MarshalMethod · 0.80
S256Function · 0.70
BytesMethod · 0.45

Tested by

no test coverage detected