Files
fn_registry/functions/cybersecurity/verify_ed25519.go
T
2026-06-04 23:44:39 +02:00

11 lines
417 B
Go

package cybersecurity
import "crypto/ed25519"
// VerifyEd25519 reports whether sig is a valid Ed25519 signature of msg under pub.
// pub must be a valid Ed25519 public key (32 bytes as returned by GenerateIdentity).
// Returns true only if the signature is authentic; false on any mismatch or invalid input.
func VerifyEd25519(pub, msg, sig []byte) bool {
return ed25519.Verify(ed25519.PublicKey(pub), msg, sig)
}