Documentation ¶
Index ¶
Constants ¶
const ( EcdsaPrivKeyAminoRoute = "true/PrivKeyTrue" EcdsaPubKeyAminoRoute = "true/PubKeyTrue" // Size of an Edwards25519 signature. Namely the size of a compressed // Edwards25519 point, and a field element. Both of which are 32 bytes. SignatureEd25519Size = 64 )
-------------------------------------
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrivKey ¶
type PrivKey interface { Bytes() []byte Sign(msg []byte) ([]byte, error) PubKey() PubKey Equals(PrivKey) bool }
PrivKey is private key interface
type PrivKeyTrue ¶
type PrivKeyTrue ecdsa.PrivateKey
PrivKeyTrue implements PrivKey.
func (PrivKeyTrue) Bytes ¶
func (priv PrivKeyTrue) Bytes() []byte
Bytes marshals the privkey using amino encoding.
func (PrivKeyTrue) Equals ¶
func (priv PrivKeyTrue) Equals(other PrivKey) bool
Equals - you probably don't need to use this. Runs in constant time based on length of the keys.
func (PrivKeyTrue) PubKey ¶
func (priv PrivKeyTrue) PubKey() PubKey
PubKey gets the corresponding public key from the private key.
type PubKey ¶
type PubKey interface { Address() help.Address Bytes() []byte VerifyBytes(msg []byte, sig []byte) bool Equals(PubKey) bool }
PubKey An address is a []byte, but hex-encoded even in JSON. []byte leaves us the option to change the address length. Use an alias so Unmarshal methods (with ptr receivers) are available too.
type PubKeyTrue ¶
PubKeyTrue implements PubKey for the ecdsa.PublicKey signature scheme.
func (PubKeyTrue) Address ¶
func (pub PubKeyTrue) Address() help.Address
Address is the Keccak256 of the raw pubkey bytes.
func (PubKeyTrue) Bytes ¶
func (pub PubKeyTrue) Bytes() []byte
Bytes marshals the PubKey using amino encoding.
func (PubKeyTrue) Equals ¶
func (pub PubKeyTrue) Equals(other PubKey) bool
Equals is comp public key
func (PubKeyTrue) String ¶
func (pub PubKeyTrue) String() string
func (PubKeyTrue) VerifyBytes ¶
func (pub PubKeyTrue) VerifyBytes(msg []byte, sig []byte) bool
VerifyBytes is check msg