Documentation ¶
Index ¶
- Constants
- Variables
- type PrivKey
- func (privKey PrivKey) Bytes() []byte
- func (*PrivKey) Descriptor() ([]byte, []int)
- func (privKey PrivKey) Equals(other cryptotypes.LedgerPrivKey) bool
- func (m *PrivKey) GetKey() []byte
- func (m *PrivKey) Marshal() (dAtA []byte, err error)
- func (privKey PrivKey) MarshalAmino() ([]byte, error)
- func (privKey PrivKey) MarshalAminoJSON() ([]byte, error)
- func (m *PrivKey) MarshalTo(dAtA []byte) (int, error)
- func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PrivKey) ProtoMessage()
- func (privKey PrivKey) PubKey() cryptotypes.PubKey
- func (m *PrivKey) Reset()
- func (privKey PrivKey) Sign(msg []byte) ([]byte, error)
- func (m *PrivKey) Size() (n int)
- func (m *PrivKey) String() string
- func (PrivKey) Type() string
- func (m *PrivKey) Unmarshal(dAtA []byte) error
- func (privKey *PrivKey) UnmarshalAmino(bz []byte) error
- func (privKey *PrivKey) UnmarshalAminoJSON(bz []byte) error
- func (m *PrivKey) XXX_DiscardUnknown()
- func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PrivKey) XXX_Merge(src proto.Message)
- func (m *PrivKey) XXX_Size() int
- func (m *PrivKey) XXX_Unmarshal(b []byte) error
- type PubKey
- func (pubKey PubKey) Address() crypto.Address
- func (pubKey PubKey) Bytes() []byte
- func (*PubKey) Descriptor() ([]byte, []int)
- func (pubKey PubKey) Equals(other cryptotypes.PubKey) bool
- func (m *PubKey) GetKey() []byte
- func (m *PubKey) Marshal() (dAtA []byte, err error)
- func (m *PubKey) MarshalTo(dAtA []byte) (int, error)
- func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PubKey) ProtoMessage()
- func (m *PubKey) Reset()
- func (m *PubKey) Size() (n int)
- func (pubKey PubKey) String() string
- func (PubKey) Type() string
- func (m *PubKey) Unmarshal(dAtA []byte) error
- func (pubKey PubKey) VerifySignature(msg, sig []byte) bool
- func (m *PubKey) XXX_DiscardUnknown()
- func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PubKey) XXX_Merge(src proto.Message)
- func (m *PubKey) XXX_Size() int
- func (m *PubKey) XXX_Unmarshal(b []byte) error
Constants ¶
const ( // PrivKeyName is the name of the private key as it is stored in the keystore. PrivKeyName = "cometbft/PrivKeyBls12_381" // PubKeyName is the name of the public key as it is stored in the keystore. PubKeyName = "cometbft/PubKeyBls12_381" // PubKeySize is the size, in bytes, of public keys as used in this package. PubKeySize = 32 // PrivKeySize is the size, in bytes, of private keys as used in this package. PrivKeySize = 64 // SignatureLength defines the byte length of a BLS signature. SignatureLength = 96 // SeedSize is the size, in bytes, of private key seeds. These are the // private key representations used by RFC 8032. SeedSize = 32 // MaxMsgLen defines the maximum length of the message bytes as passed to Sign. MaxMsgLen = 32 // KeyType is the type of key this package provides. KeyType = "bls12381" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type PrivKey ¶
type PrivKey struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
}
PrivKey defines a ed25519 private key. NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context.
func NewPrivateKeyFromBytes ¶
NewPrivateKeyFromBytes build a new key from the given bytes.
func (*PrivKey) Descriptor ¶
func (PrivKey) Equals ¶
func (privKey PrivKey) Equals(other cryptotypes.LedgerPrivKey) bool
Equals returns true if two keys are equal and false otherwise.
func (PrivKey) MarshalAmino ¶
MarshalAmino overrides Amino binary marshaling.
func (PrivKey) MarshalAminoJSON ¶
MarshalAminoJSON overrides Amino JSON marshaling.
func (*PrivKey) MarshalToSizedBuffer ¶
func (*PrivKey) ProtoMessage ¶
func (*PrivKey) ProtoMessage()
func (PrivKey) PubKey ¶
func (privKey PrivKey) PubKey() cryptotypes.PubKey
PubKey returns the private key's public key. If the privkey is not valid it returns a nil value.
func (PrivKey) Sign ¶
Sign signs the given byte array. If msg is larger than MaxMsgLen, SHA256 sum will be signed instead of the raw bytes.
func (*PrivKey) UnmarshalAmino ¶
UnmarshalAmino overrides Amino binary marshaling.
func (*PrivKey) UnmarshalAminoJSON ¶
UnmarshalAminoJSON overrides Amino JSON marshaling.
func (*PrivKey) XXX_DiscardUnknown ¶
func (m *PrivKey) XXX_DiscardUnknown()
func (*PrivKey) XXX_Marshal ¶
func (*PrivKey) XXX_Unmarshal ¶
type PubKey ¶
type PubKey struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
}
PubKey is an ed25519 public key for handling Tendermint keys in SDK. It's needed for Any serialization and SDK compatibility. It must not be used in a non Tendermint key context because it doesn't implement ADR-28. Nevertheless, you will like to use ed25519 in app user level then you must create a new proto message and follow ADR-28 for Address construction.
func (PubKey) Address ¶
Address returns the address of the key.
The function will panic if the public key is invalid.
func (*PubKey) Descriptor ¶
func (PubKey) Equals ¶
func (pubKey PubKey) Equals(other cryptotypes.PubKey) bool
Equals returns true if the other's type is the same and their bytes are deeply equal.
func (*PubKey) MarshalToSizedBuffer ¶
func (*PubKey) ProtoMessage ¶
func (*PubKey) ProtoMessage()
func (PubKey) VerifySignature ¶
VerifySignature verifies the given signature.
func (*PubKey) XXX_DiscardUnknown ¶
func (m *PubKey) XXX_DiscardUnknown()