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

Function generateKeyPair

crypto/asymmetric/signature_test.go:191–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

189}
190
191func generateKeyPair() (pubkey, privkey []byte) {
192 key, err := ecdsa.GenerateKey(secp256k1.S256(), crand.Reader)
193 if err != nil {
194 panic(err)
195 }
196 pubkey = elliptic.Marshal(secp256k1.S256(), key.X, key.Y)
197
198 privkey = make([]byte, 32)
199 blob := key.D.Bytes()
200 copy(privkey[32-len(blob):], blob)
201
202 return pubkey, privkey
203}
204
205func BenchmarkSign(b *testing.B) {
206 b.Run("Secp256k1", func(b *testing.B) {

Callers 2

BenchmarkSignFunction · 0.70
BenchmarkVerifyFunction · 0.70

Calls 3

S256Function · 0.92
MarshalMethod · 0.80
BytesMethod · 0.45

Tested by

no test coverage detected