Documentation ¶
Index ¶
- Constants
- func NewBatchVerifier() crypto.BatchVerifier
- type BatchVerifier
- type PrivKey
- func (privKey PrivKey) Bytes() []byte
- func (privKey PrivKey) Equals(other crypto.PrivKey) bool
- func (privKey PrivKey) MarshalJSON() ([]byte, error)
- func (privKey PrivKey) PubKey() crypto.PubKey
- func (privKey PrivKey) Sign(msg []byte) ([]byte, error)
- func (privKey PrivKey) Type() string
- func (PrivKey) TypeTag() string
- func (privKey *PrivKey) UnmarshalJSON(data []byte) error
- type PubKey
- func (pubKey PubKey) Address() crypto.Address
- func (pubKey PubKey) Bytes() []byte
- func (pubKey PubKey) Equals(other crypto.PubKey) bool
- func (pubKey PubKey) String() string
- func (pubKey PubKey) Type() string
- func (PubKey) TypeTag() string
- func (pubKey PubKey) VerifySignature(msg []byte, sigBytes []byte) bool
Constants ¶
View Source
const ( PrivKeyName = "tendermint/PrivKeySr25519" PubKeyName = "tendermint/PubKeySr25519" )
View Source
const ( // PrivKeySize is the size of a sr25519 signature in bytes. PrivKeySize = sr25519.MiniSecretKeySize KeyType = "sr25519" )
View Source
const ( // PubKeySize is the size of a sr25519 public key in bytes. PubKeySize = sr25519.PublicKeySize // SignatureSize is the size of a sr25519 signature in bytes. SignatureSize = sr25519.SignatureSize )
Variables ¶
This section is empty.
Functions ¶
func NewBatchVerifier ¶
func NewBatchVerifier() crypto.BatchVerifier
Types ¶
type BatchVerifier ¶
type BatchVerifier struct {
*sr25519.BatchVerifier
}
BatchVerifier implements batch verification for sr25519.
func (*BatchVerifier) Add ¶
func (b *BatchVerifier) Add(key crypto.PubKey, msg, signature []byte) error
func (*BatchVerifier) Verify ¶
func (b *BatchVerifier) Verify() (bool, []bool)
type PrivKey ¶
type PrivKey struct {
// contains filtered or unexported fields
}
PrivKey implements crypto.PrivKey.
func GenPrivKey ¶
func GenPrivKey() PrivKey
GenPrivKey generates a new sr25519 private key. It uses OS randomness in conjunction with the current global random seed in tendermint/libs/common to generate the private key.
func GenPrivKeyFromSecret ¶
GenPrivKeyFromSecret hashes the secret with SHA2, and uses that 32 byte output to create the private key. NOTE: secret should be the output of a KDF like bcrypt, if it's derived from user input.
func (PrivKey) Equals ¶
Equals - you probably don't need to use this. Runs in constant time based on length of the keys.
func (PrivKey) MarshalJSON ¶
func (PrivKey) PubKey ¶
PubKey gets the corresponding public key from the private key.
Panics if the private key is not initialized.
func (*PrivKey) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.