Documentation ¶
Index ¶
- func DeterministicNewPrivateKey(curve elliptic.Curve, rand io.Reader) (*btcSecp256k1.PrivateKey, error)
- func EncodeUint64(val uint64) []byte
- func ExtractSignerAddress(data Signable) (sdk.AccAddress, error)
- func GenerateFloatingKey() (secretKey *btcSecp256k1.PrivateKey, addr sdk.AccAddress)
- func GetKeyName(clientCtx client.Context) (string, error)
- func GetPrivKey(clientCtx client.Context, keyName string) (*btcSecp256k1.PrivateKey, error)
- func HashMsg(msgData []byte) []byte
- func Join(s [][]byte) []byte
- func RecoverPubKey(data Signable) (secp256k1.PubKey, error)
- func Sign(pkey *btcSecp256k1.PrivateKey, data Signable) ([]byte, error)
- type Account
- type Signable
- type ZeroReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeterministicNewPrivateKey ¶
func DeterministicNewPrivateKey(curve elliptic.Curve, rand io.Reader) (*btcSecp256k1.PrivateKey, error)
func EncodeUint64 ¶
EncodeUint64 encodes a uint64 value to a byte array
func ExtractSignerAddress ¶
func ExtractSignerAddress(data Signable) (sdk.AccAddress, error)
ExtractSignerAddress extracts the signer address of data
func GenerateFloatingKey ¶
func GenerateFloatingKey() (secretKey *btcSecp256k1.PrivateKey, addr sdk.AccAddress)
GenerateFloatingKey creates a new private key with an account address derived from the corresponding public key
func GetPrivKey ¶
func GetPrivKey(clientCtx client.Context, keyName string) (*btcSecp256k1.PrivateKey, error)
func Join ¶
Join() is faster than bytes.Join because it does what bytes.Join() does without appending (empty) separators
func RecoverPubKey ¶
RecoverPubKey recovers the public key from data's signature
func Sign ¶
func Sign(pkey *btcSecp256k1.PrivateKey, data Signable) ([]byte, error)
Sign creates a signature for a struct. The prepareFunc prepares the struct before extracting the data for the signature
Types ¶
type Account ¶
type Account struct { SK *btcSecp256k1.PrivateKey PubKey cryptotypes.PubKey Addr sdk.AccAddress ConsKey cryptotypes.PrivKey // contains filtered or unexported fields }
func GenerateDeterministicFloatingKey ¶
GenerateDeterministicFloatingKey creates a new private key with an account address derived from the corresponding public key using a rand source
type ZeroReader ¶
type ZeroReader struct { Seed byte // contains filtered or unexported fields }
func NewZeroReader ¶
func NewZeroReader(seed int64) *ZeroReader
func (*ZeroReader) Inc ¶
func (z *ZeroReader) Inc()