Documentation ¶
Overview ¶
Package k1util provides functions to sign and verify Ethereum RSV style signatures.
Index ¶
- func PBPubKeyFromBytes(pubkey []byte) (cryptopb.PublicKey, error)
- func PubKeyBytesToCosmos(pubkey []byte) (cosmoscrypto.PubKey, error)
- func PubKeyFromBytes64(pubkey []byte) (*stdecdsa.PublicKey, error)
- func PubKeyPBToAddress(pubkey cryptopb.PublicKey) (common.Address, error)
- func PubKeyToAddress(pubkey crypto.PubKey) (common.Address, error)
- func PubKeyToBytes64(pubkey *stdecdsa.PublicKey) ([]byte, error)
- func PubKeyToCosmos(pubkey crypto.PubKey) (cosmoscrypto.PubKey, error)
- func Sign(key crypto.PrivKey, input [32]byte) ([65]byte, error)
- func StdPrivKeyFromComet(privkey crypto.PrivKey) (*stdecdsa.PrivateKey, error)
- func StdPrivKeyToComet(privkey *stdecdsa.PrivateKey) (crypto.PrivKey, error)
- func StdPubKeyToCosmos(pubkey *stdecdsa.PublicKey) (cosmoscrypto.PubKey, error)
- func Verify(address common.Address, hash [32]byte, sig [65]byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PubKeyBytesToCosmos ¶
func PubKeyBytesToCosmos(pubkey []byte) (cosmoscrypto.PubKey, error)
func PubKeyFromBytes64 ¶
PubKeyFromBytes64 returns the public key from the 64 byte uncompressed version. It adds the prefix (0x04 for uncompressed keys) to the input bytes.
func PubKeyPBToAddress ¶
PubKeyPBToAddress returns the Ethereum address for the given k1 public key.
func PubKeyToAddress ¶
PubKeyToAddress returns the Ethereum address for the given k1 public key.
func PubKeyToBytes64 ¶
PubKeyToBytes64 returns the 64 byte uncompressed version of the public key, by removing the prefix (0x04 for uncompressed keys).
func PubKeyToCosmos ¶
func PubKeyToCosmos(pubkey crypto.PubKey) (cosmoscrypto.PubKey, error)
func Sign ¶
Sign returns a signature from input data.
The produced signature is 65 bytes in the [R || S || V] format where V is 27 or 28.
func StdPrivKeyFromComet ¶
func StdPrivKeyFromComet(privkey crypto.PrivKey) (*stdecdsa.PrivateKey, error)
func StdPrivKeyToComet ¶
func StdPrivKeyToComet(privkey *stdecdsa.PrivateKey) (crypto.PrivKey, error)
func StdPubKeyToCosmos ¶
func StdPubKeyToCosmos(pubkey *stdecdsa.PublicKey) (cosmoscrypto.PubKey, error)
Types ¶
This section is empty.