Пример #1
0
// Create a new PrivateKey based on a random element on the field of a curve.
func NewKeyFromInt(c *bitelliptic.BitCurve, k *big.Int) *PrivateKey {
	priv := new(PrivateKey)
	priv.PublicKey.BitCurve = c
	priv.D = k
	priv.PublicKey.X, priv.PublicKey.Y = c.ScalarBaseMult(k.Bytes())
	return priv
}