Fantom-foundation/go-lachesis

View on GitHub
crypto/fake.go

Summary

Maintainability
A
0 mins
Test Coverage
package crypto

import (
    "crypto/ecdsa"
    "math/rand"

    "github.com/ethereum/go-ethereum/crypto"
)

// FakeKey gets n-th fake private key.
func FakeKey(n int) *ecdsa.PrivateKey {
    reader := rand.New(rand.NewSource(int64(n)))

    key, err := ecdsa.GenerateKey(crypto.S256(), reader)
    if err != nil {
        panic(err)
    }

    return key
}