const ( PrivKeyAminoName = "tendermint/PrivKeyEd25519" PubKeyAminoName = "tendermint/PubKeyEd25519" // Size of an Edwards25519 signature. Namely the size of a compressed // Edwards25519 point, and a field element. Both of which are 32 bytes. SignatureSize = 64 )
const PubKeyEd25519Size = 32
PubKeyEd25519Size is the number of bytes in an Ed25519 signature.
PrivKeyEd25519 implements crypto.PrivKey.
GenPrivKey generates a new ed25519 private key. It uses OS randomness in conjunction with the current global random seed in tendermint/libs/common to generate the private key.
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.
Bytes marshals the privkey using amino encoding.
Equals - you probably don't need to use this. Runs in constant time based on length of the keys.
PubKey gets the corresponding public key from the private key.
Sign produces a signature on the provided message. This assumes the privkey is wellformed in the golang format. The first 32 bytes should be random, corresponding to the normal ed25519 private key. The latter 32 bytes should be the compressed public key. If these conditions aren't met, Sign will panic or produce an incorrect signature.
PubKeyEd25519 implements crypto.PubKey for the Ed25519 signature scheme.
Address is the SHA256-20 of the raw pubkey bytes.
Bytes marshals the PubKey using amino encoding.