Documentation ¶
Overview ¶
Package secp256k1 contains methods and types for working with Ethereum and possibly other cryptocurrency keys that use the secp256k1 elliptic curve.
Index ¶
- Constants
- type PublicKey
- func (k *PublicKey) Bytes() []byte
- func (k *PublicKey) Compress() [33]byte
- func (k *PublicKey) Keccak256() [32]byte
- func (k *PublicKey) MarshalText() ([]byte, error)
- func (k *PublicKey) String() string
- func (k *PublicKey) UnmarshalText(keyData []byte) error
- func (k *PublicKey) X() [32]byte
- func (k *PublicKey) Y() [32]byte
Constants ¶
View Source
const ( //nolint:revive // https://github.com/bitcoin-core/secp256k1/blob/44c2452fd387f7ca604ab42d73746e7d3a44d8a2/include/secp256k1.h#L208 Secp256k1TagPubkeyEven = byte(2) Secp256k1TagPubkeyOdd = byte(3) //nolint:revive )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey represents a secp256k1 public key
func NewPublicKey ¶
NewPublicKey returns a new public key from the given (x, y) coordinates
func NewPublicKeyFromBigInt ¶
NewPublicKeyFromBigInt returns a new public key from the given (x, y) coordinates
func (*PublicKey) Keccak256 ¶
Keccak256 returns the heccak256 hash of the x and y coordinates concatenated
func (*PublicKey) MarshalText ¶
MarshalText converts the public key a string for JSON marshalling
func (*PublicKey) UnmarshalText ¶
UnmarshalText converts a 64 byte hex string, with or without a 0x prefix, into the PublicKey type during JSON unmarshalling.
Click to show internal directories.
Click to hide internal directories.