Documentation ¶
Overview ¶
Package ed25519 provides an Ed25519 implementation backed by crypto/ed25519(https://pkg.go.dev/crypto/ed25519) std package, but using ed25519consensus(https://pkg.go.dev/github.com/hdevalence/ed25519consensus) package for signature verification, which conforms to [ZIP 215](https://zips.z.cash/zip-0215) specification, making it suitable for consensus-critical contexts, see [README from ed25519consensus](https://github.com/hdevalence/ed25519consensus) for the explanation.
It also provides an Ed25519-SHA3-512 implementation backed by [go-ed25519-sha3-512](https://pkg.go.dev/github.com/crpt/go-ed25519-sha3-512) package, which is a fork of crypto/ed25519(https://pkg.go.dev/crypto/ed25519) std package, modified to use SHA3-512 instead of SHA-512. using [go-ed25519consensus-sha3-512](https://pkg.go.dev/github.com/crpt/go-ed25519consensus-sha3-512) package for signature verification, which is a fork of ed25519consensus(https://pkg.go.dev/github.com/hdevalence/ed25519consensus) package, modified to use SHA3-512 instead of SHA-512. So it's also suitable for consensus-critical contexts.
Index ¶
Constants ¶
const ( // 32 PublicKeySize = ed25519.PublicKeySize // 64 PrivateKeySize = ed25519.PrivateKeySize // 64 SignatureSize = ed25519.SignatureSize // 64 AddressSize = PublicKeySize )
Variables ¶
var ( KeyTypeByte = byte(crpt.Ed25519) KeyTypeByte_SHA3_512 = byte(crpt.Ed25519_SHA3_512) ErrWrongPublicKeySize = fmt.Errorf("%w, should be 32 bytes", crpt.ErrWrongPublicKeySize) ErrWrongPrivateKeySize = fmt.Errorf("%w, should be 64 bytes", crpt.ErrWrongPrivateKeySize) ErrWrongSignatureSize = fmt.Errorf("%w, should be 64 bytes", crpt.ErrWrongSignatureSize) ErrNotEd25519PublicKey = errors.New("not a Ed25519 public key") ErrNotEd25519SHA3PublicKey = errors.New("not a Ed25519-SHA3-512 public key") ErrNotEd25519PrivateKey = errors.New("not a Ed25519 private key") ErrNotEd25519SHA3PrivateKey = errors.New("not a Ed25519-SHA3-512 private key") ErrNotEd25519Signature = errors.New("not a Ed25519 signature") ErrNotEd25519SHA3Signature = errors.New("not a Ed25519-SHA3-512 signature") )