Source File
key_core.go
Belonging Package
github.com/tmc/go-iroh/key
package keyimport ()// verify is the regeneratable core of [PublicKey.Verify]. It performs strict// Ed25519 verification, matching ed25519-dalek's verify_strict.func ( PublicKey) ( []byte, Signature) error {if !ed25519.Verify(.bytes[:], , .bytes[:]) {return ErrInvalidSignature}return nil}// sign is the regeneratable core of [SecretKey.Sign].func ( SecretKey) ( []byte) Signature {, := SignatureFromEd25519(ed25519.Sign(.signing, ))return}// stdBase32NoPad is RFC 4648 base32 without padding, used for the alternative// (non-hex) string form of a key. Decoding upper-cases the input first.var stdBase32NoPad = base32.StdEncoding.WithPadding(base32.NoPadding)func decodeStdBase32NoPad( string) ([]byte, error) {return stdBase32NoPad.DecodeString()}// zBase32 is the z-base-32 encoding (pkarr / human-oriented base32) used for// endpoint-id domain names. It uses a custom alphabet and no padding.var zBase32 = base32.NewEncoding(zBase32Alphabet).WithPadding(base32.NoPadding)func encodeZBase32( []byte) string { return zBase32.EncodeToString() }func decodeZBase32( string) ([]byte, error) { return zBase32.DecodeString() }
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |