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

11 lines
442 B
Go

package cybersecurity
import "crypto/ed25519"
// SignEd25519 signs msg with an Ed25519 private key and returns the 64-byte signature.
// priv must be a valid Ed25519 private key (64 bytes as returned by GenerateIdentity or ed25519.GenerateKey).
// This function is pure: same inputs always produce the same output (ed25519 is deterministic).
func SignEd25519(priv, msg []byte) []byte {
return ed25519.Sign(ed25519.PrivateKey(priv), msg)
}