AlexxIT/go2rtc · error

ErrInvalidParams

ErrInvalidParams

Error message

ed25519: invalid params

What it means

Sentinel error ErrInvalidParams from the ed25519 helper package: Signature was called with a key whose length differs from ed25519.PrivateKeySize (64 bytes). ValidateSignature returns false (not this error) for bad public key/signature sizes. The chacha20poly1305 sibling package mirrors the pattern for its own key/nonce sizes.

Solutions

  1. Check key length before calling: len(key) == ed25519.PrivateKeySize (64)
  2. Compare against errors.Is(err, ErrInvalidParams) at call sites
  3. Regenerate or correctly decode (base64/hex) the key material being passed in
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at pkg/hap/ed25519/ed25519.go:8 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/676909dc227e5899. Report an issue: GitHub.

Appendix: source

Thrown at pkg/hap/ed25519/ed25519.go:8

package ed25519

import (
	"crypto/ed25519"
	"errors"
)

var ErrInvalidParams = errors.New("ed25519: invalid params")

func ValidateSignature(key, data, signature []byte) bool {
	if len(key) != ed25519.PublicKeySize || len(signature) != ed25519.SignatureSize {
		return false
	}

	return ed25519.Verify(key, data, signature)
}

func Signature(key, data []byte) ([]byte, error) {
	if len(key) != ed25519.PrivateKeySize {
		return nil, ErrInvalidParams
	}

	return ed25519.Sign(key, data), nil
}

View on GitHub (pinned to c245815e75)