Documentation ¶
Index ¶
- Constants
- func FromECDSAPub(pub *ecdsa.PublicKey) []byte
- func GenerateKey(rand io.Reader) (priv []byte, x, y *big.Int, err error)
- func GeneratePrivateKey() (*ecdsa.PrivateKey, error)
- func NewPrivateKey(d *big.Int) *ecdsa.PrivateKey
- func NewPublicKey(x *big.Int, y *big.Int) *ecdsa.PublicKey
- func PrivKeyFromBytes(pk []byte) (*ecdsa.PrivateKey, *ecdsa.PublicKey)
- func PrivKeyFromScalar(s []byte) (*ecdsa.PrivateKey, *ecdsa.PublicKey)
- func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error)
Constants ¶
const PrivKeyBytesLen = 32
PrivKeyBytesLen defines the length in bytes of a serialized private key.
Variables ¶
This section is empty.
Functions ¶
func FromECDSAPub ¶
func GenerateKey ¶
GenerateKey generates a key using a random number generator, returning the private scalar and the corresponding public key points.
func GeneratePrivateKey ¶
func GeneratePrivateKey() (*ecdsa.PrivateKey, error)
GeneratePrivateKey is a wrapper for ecdsa.GenerateKey that returns a PrivateKey instead of the normal ecdsa.PrivateKey.
func NewPrivateKey ¶
func NewPrivateKey(d *big.Int) *ecdsa.PrivateKey
NewPrivateKey instantiates a new private key from a scalar encoded as a big integer.
func NewPublicKey ¶
NewPublicKey instantiates a new public key with the given X,Y coordinates.
func PrivKeyFromBytes ¶
func PrivKeyFromBytes(pk []byte) (*ecdsa.PrivateKey, *ecdsa.PublicKey)
PrivKeyFromBytes returns a private and public key for `curve' based on the private key passed as an argument as a byte slice.
func PrivKeyFromScalar ¶
func PrivKeyFromScalar(s []byte) (*ecdsa.PrivateKey, *ecdsa.PublicKey)
PrivKeyFromScalar is the same as PrivKeyFromBytes in secp256k1.
Types ¶
This section is empty.