grafana/k6 · error

curve is required

Error message

curve is required

What it means

Error "curve is required" thrown in grafana/k6.

Source

Thrown at internal/js/modules/k6/webcrypto/jwk.go:133

	// Key type
	Kty string `json:"kty"`
	// Canonical Curve
	Crv string `json:"crv"`
	// X coordinate
	X string `json:"x"`
	// Y coordinate
	Y string `json:"y"`
	// Private scalar
	D string `json:"d"`
}

func (jwk *ecJWK) validate() error {
	if jwk.Kty != JWKECKeyType {
		return fmt.Errorf("invalid key type: %s", jwk.Kty)
	}

	if jwk.Crv == "" {
		return errors.New("curve is required")
	}

	if jwk.X == "" {
		return errors.New("coordinate X is required")
	}

	if jwk.Y == "" {
		return errors.New("coordinate Y is required")
	}

	return nil
}

// encodeCurveBigInt encodes the private scalar D of an ECDSA key with padding.
func encodeCurveBigInt(data *big.Int, curveBits int) string {
	// Determine the expected byte length for the curve
	byteLength := curveBits / 8
	// Add one more byte if the bits are not a multiple of 8

View on GitHub (pinned to 93accf6570)

When it happens

Trigger: Thrown at internal/js/modules/k6/webcrypto/jwk.go:133 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15). Data as JSON: /api/errors/655965f359c13612. Report an issue: GitHub.