Documentation ¶
Index ¶
Constants ¶
const ( PrivKeyName = "tendermint/PrivKeySr25519" PubKeyName = "tendermint/PubKeySr25519" // SignatureSize is the size of an Edwards25519 signature. Namely the size of a compressed // Sr25519 point, and a field element. Both of which are 32 bytes. SignatureSize = 64 )
const ( PubKeySize = 32 KeyType = "sr25519" )
PubKeySize is the number of bytes in an Sr25519 public key.
const PrivKeySize = 32
PrivKeySize is the number of bytes in an Sr25519 private key.
Variables ¶
This section is empty.
Functions ¶
func NewBatchVerifier ¶
func NewBatchVerifier() crypto.BatchVerifier
Types ¶
type BatchVerifier ¶
type BatchVerifier struct {
*schnorrkel.BatchVerifier
}
BatchVerifier implements batch verification for sr25519. https://github.com/ChainSafe/go-schnorrkel is used for batch verification
func (BatchVerifier) Verify ¶
func (b BatchVerifier) Verify() bool
type PrivKey ¶
type PrivKey []byte
PrivKeySr25519 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.
type PubKey ¶
type PubKey []byte
PubKeySr25519 implements crypto.PubKey for the Sr25519 signature scheme.