Files
aperture/internal/test/keys.go
Oliver Gugger 3b73ac96cb mod+lsat+test: copy test code to get rid of loop
To get rid of the loop dependency, we copy the test code that we rely on
and fix some imports.
2020-08-11 10:03:34 +02:00

18 lines
461 B
Go

package test
import (
"github.com/btcsuite/btcd/btcec"
)
// CreateKey returns a deterministically generated key pair.
func CreateKey(index int32) (*btcec.PrivateKey, *btcec.PublicKey) {
// Avoid all zeros, because it results in an invalid key.
privKey, pubKey := btcec.PrivKeyFromBytes(btcec.S256(),
[]byte{0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, byte(index + 1)})
return privKey, pubKey
}