12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- package ed25519
- import (
- "crypto/ed25519"
- "io"
- )
- const (
-
- PublicKeySize = 32
-
- PrivateKeySize = 64
-
- SignatureSize = 64
-
- SeedSize = 32
- )
- type PublicKey = ed25519.PublicKey
- type PrivateKey = ed25519.PrivateKey
- func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) {
- return ed25519.GenerateKey(rand)
- }
- func NewKeyFromSeed(seed []byte) PrivateKey {
- return ed25519.NewKeyFromSeed(seed)
- }
- func Sign(privateKey PrivateKey, message []byte) []byte {
- return ed25519.Sign(privateKey, message)
- }
- func Verify(publicKey PublicKey, message, sig []byte) bool {
- return ed25519.Verify(publicKey, message, sig)
- }
|