// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: frost.proto

package frost

import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"sort"
	"strings"
	"time"
	"unicode/utf8"

	"google.golang.org/protobuf/types/known/anypb"
)

// ensure the imports are used
var (
	_ = bytes.MinRead
	_ = errors.New("")
	_ = fmt.Print
	_ = utf8.UTFMax
	_ = (*regexp.Regexp)(nil)
	_ = (*strings.Reader)(nil)
	_ = net.IPv4len
	_ = time.Duration(0)
	_ = (*url.URL)(nil)
	_ = (*mail.Address)(nil)
	_ = anypb.Any{}
	_ = sort.Sort
)

// Validate checks the field values on EchoRequest with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *EchoRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on EchoRequest with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in EchoRequestMultiError, or
// nil if none found.
func (m *EchoRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *EchoRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Message

	if len(errors) > 0 {
		return EchoRequestMultiError(errors)
	}

	return nil
}

// EchoRequestMultiError is an error wrapping multiple validation errors
// returned by EchoRequest.ValidateAll() if the designated constraints aren't met.
type EchoRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m EchoRequestMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m EchoRequestMultiError) AllErrors() []error { return m }

// EchoRequestValidationError is the validation error returned by
// EchoRequest.Validate if the designated constraints aren't met.
type EchoRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e EchoRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e EchoRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e EchoRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e EchoRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e EchoRequestValidationError) ErrorName() string { return "EchoRequestValidationError" }

// Error satisfies the builtin error interface
func (e EchoRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sEchoRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = EchoRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = EchoRequestValidationError{}

// Validate checks the field values on EchoResponse with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *EchoResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on EchoResponse with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in EchoResponseMultiError, or
// nil if none found.
func (m *EchoResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *EchoResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Message

	if len(errors) > 0 {
		return EchoResponseMultiError(errors)
	}

	return nil
}

// EchoResponseMultiError is an error wrapping multiple validation errors
// returned by EchoResponse.ValidateAll() if the designated constraints aren't met.
type EchoResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m EchoResponseMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m EchoResponseMultiError) AllErrors() []error { return m }

// EchoResponseValidationError is the validation error returned by
// EchoResponse.Validate if the designated constraints aren't met.
type EchoResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e EchoResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e EchoResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e EchoResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e EchoResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e EchoResponseValidationError) ErrorName() string { return "EchoResponseValidationError" }

// Error satisfies the builtin error interface
func (e EchoResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sEchoResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = EchoResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = EchoResponseValidationError{}

// Validate checks the field values on DkgRound1Request with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *DkgRound1Request) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DkgRound1Request with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DkgRound1RequestMultiError, or nil if none found.
func (m *DkgRound1Request) ValidateAll() error {
	return m.validate(true)
}

func (m *DkgRound1Request) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for RequestId

	// no validation rules for Identifier

	// no validation rules for MaxSigners

	// no validation rules for MinSigners

	// no validation rules for KeyCount

	if len(errors) > 0 {
		return DkgRound1RequestMultiError(errors)
	}

	return nil
}

// DkgRound1RequestMultiError is an error wrapping multiple validation errors
// returned by DkgRound1Request.ValidateAll() if the designated constraints
// aren't met.
type DkgRound1RequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DkgRound1RequestMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DkgRound1RequestMultiError) AllErrors() []error { return m }

// DkgRound1RequestValidationError is the validation error returned by
// DkgRound1Request.Validate if the designated constraints aren't met.
type DkgRound1RequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DkgRound1RequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DkgRound1RequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DkgRound1RequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DkgRound1RequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DkgRound1RequestValidationError) ErrorName() string { return "DkgRound1RequestValidationError" }

// Error satisfies the builtin error interface
func (e DkgRound1RequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDkgRound1Request.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DkgRound1RequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DkgRound1RequestValidationError{}

// Validate checks the field values on DkgRound1Response with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *DkgRound1Response) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DkgRound1Response with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DkgRound1ResponseMultiError, or nil if none found.
func (m *DkgRound1Response) ValidateAll() error {
	return m.validate(true)
}

func (m *DkgRound1Response) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if len(errors) > 0 {
		return DkgRound1ResponseMultiError(errors)
	}

	return nil
}

// DkgRound1ResponseMultiError is an error wrapping multiple validation errors
// returned by DkgRound1Response.ValidateAll() if the designated constraints
// aren't met.
type DkgRound1ResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DkgRound1ResponseMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DkgRound1ResponseMultiError) AllErrors() []error { return m }

// DkgRound1ResponseValidationError is the validation error returned by
// DkgRound1Response.Validate if the designated constraints aren't met.
type DkgRound1ResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DkgRound1ResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DkgRound1ResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DkgRound1ResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DkgRound1ResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DkgRound1ResponseValidationError) ErrorName() string {
	return "DkgRound1ResponseValidationError"
}

// Error satisfies the builtin error interface
func (e DkgRound1ResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDkgRound1Response.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DkgRound1ResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DkgRound1ResponseValidationError{}

// Validate checks the field values on DkgRound2Request with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *DkgRound2Request) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DkgRound2Request with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DkgRound2RequestMultiError, or nil if none found.
func (m *DkgRound2Request) ValidateAll() error {
	return m.validate(true)
}

func (m *DkgRound2Request) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for RequestId

	for idx, item := range m.GetRound1PackagesMaps() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, DkgRound2RequestValidationError{
						field:  fmt.Sprintf("Round1PackagesMaps[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, DkgRound2RequestValidationError{
						field:  fmt.Sprintf("Round1PackagesMaps[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return DkgRound2RequestValidationError{
					field:  fmt.Sprintf("Round1PackagesMaps[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return DkgRound2RequestMultiError(errors)
	}

	return nil
}

// DkgRound2RequestMultiError is an error wrapping multiple validation errors
// returned by DkgRound2Request.ValidateAll() if the designated constraints
// aren't met.
type DkgRound2RequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DkgRound2RequestMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DkgRound2RequestMultiError) AllErrors() []error { return m }

// DkgRound2RequestValidationError is the validation error returned by
// DkgRound2Request.Validate if the designated constraints aren't met.
type DkgRound2RequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DkgRound2RequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DkgRound2RequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DkgRound2RequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DkgRound2RequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DkgRound2RequestValidationError) ErrorName() string { return "DkgRound2RequestValidationError" }

// Error satisfies the builtin error interface
func (e DkgRound2RequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDkgRound2Request.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DkgRound2RequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DkgRound2RequestValidationError{}

// Validate checks the field values on DkgRound2Response with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *DkgRound2Response) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DkgRound2Response with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DkgRound2ResponseMultiError, or nil if none found.
func (m *DkgRound2Response) ValidateAll() error {
	return m.validate(true)
}

func (m *DkgRound2Response) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	for idx, item := range m.GetRound2Packages() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, DkgRound2ResponseValidationError{
						field:  fmt.Sprintf("Round2Packages[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, DkgRound2ResponseValidationError{
						field:  fmt.Sprintf("Round2Packages[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return DkgRound2ResponseValidationError{
					field:  fmt.Sprintf("Round2Packages[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return DkgRound2ResponseMultiError(errors)
	}

	return nil
}

// DkgRound2ResponseMultiError is an error wrapping multiple validation errors
// returned by DkgRound2Response.ValidateAll() if the designated constraints
// aren't met.
type DkgRound2ResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DkgRound2ResponseMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DkgRound2ResponseMultiError) AllErrors() []error { return m }

// DkgRound2ResponseValidationError is the validation error returned by
// DkgRound2Response.Validate if the designated constraints aren't met.
type DkgRound2ResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DkgRound2ResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DkgRound2ResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DkgRound2ResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DkgRound2ResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DkgRound2ResponseValidationError) ErrorName() string {
	return "DkgRound2ResponseValidationError"
}

// Error satisfies the builtin error interface
func (e DkgRound2ResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDkgRound2Response.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DkgRound2ResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DkgRound2ResponseValidationError{}

// Validate checks the field values on DkgRound3Request with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *DkgRound3Request) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DkgRound3Request with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DkgRound3RequestMultiError, or nil if none found.
func (m *DkgRound3Request) ValidateAll() error {
	return m.validate(true)
}

func (m *DkgRound3Request) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for RequestId

	for idx, item := range m.GetRound1PackagesMaps() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, DkgRound3RequestValidationError{
						field:  fmt.Sprintf("Round1PackagesMaps[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, DkgRound3RequestValidationError{
						field:  fmt.Sprintf("Round1PackagesMaps[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return DkgRound3RequestValidationError{
					field:  fmt.Sprintf("Round1PackagesMaps[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	for idx, item := range m.GetRound2PackagesMaps() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, DkgRound3RequestValidationError{
						field:  fmt.Sprintf("Round2PackagesMaps[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, DkgRound3RequestValidationError{
						field:  fmt.Sprintf("Round2PackagesMaps[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return DkgRound3RequestValidationError{
					field:  fmt.Sprintf("Round2PackagesMaps[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return DkgRound3RequestMultiError(errors)
	}

	return nil
}

// DkgRound3RequestMultiError is an error wrapping multiple validation errors
// returned by DkgRound3Request.ValidateAll() if the designated constraints
// aren't met.
type DkgRound3RequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DkgRound3RequestMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DkgRound3RequestMultiError) AllErrors() []error { return m }

// DkgRound3RequestValidationError is the validation error returned by
// DkgRound3Request.Validate if the designated constraints aren't met.
type DkgRound3RequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DkgRound3RequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DkgRound3RequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DkgRound3RequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DkgRound3RequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DkgRound3RequestValidationError) ErrorName() string { return "DkgRound3RequestValidationError" }

// Error satisfies the builtin error interface
func (e DkgRound3RequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDkgRound3Request.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DkgRound3RequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DkgRound3RequestValidationError{}

// Validate checks the field values on KeyPackage with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *KeyPackage) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on KeyPackage with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in KeyPackageMultiError, or
// nil if none found.
func (m *KeyPackage) ValidateAll() error {
	return m.validate(true)
}

func (m *KeyPackage) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Identifier

	// no validation rules for SecretShare

	// no validation rules for PublicShares

	// no validation rules for PublicKey

	// no validation rules for MinSigners

	if len(errors) > 0 {
		return KeyPackageMultiError(errors)
	}

	return nil
}

// KeyPackageMultiError is an error wrapping multiple validation errors
// returned by KeyPackage.ValidateAll() if the designated constraints aren't met.
type KeyPackageMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m KeyPackageMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m KeyPackageMultiError) AllErrors() []error { return m }

// KeyPackageValidationError is the validation error returned by
// KeyPackage.Validate if the designated constraints aren't met.
type KeyPackageValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e KeyPackageValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e KeyPackageValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e KeyPackageValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e KeyPackageValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e KeyPackageValidationError) ErrorName() string { return "KeyPackageValidationError" }

// Error satisfies the builtin error interface
func (e KeyPackageValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sKeyPackage.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = KeyPackageValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = KeyPackageValidationError{}

// Validate checks the field values on DkgRound3Response with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *DkgRound3Response) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DkgRound3Response with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DkgRound3ResponseMultiError, or nil if none found.
func (m *DkgRound3Response) ValidateAll() error {
	return m.validate(true)
}

func (m *DkgRound3Response) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	for idx, item := range m.GetKeyPackages() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, DkgRound3ResponseValidationError{
						field:  fmt.Sprintf("KeyPackages[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, DkgRound3ResponseValidationError{
						field:  fmt.Sprintf("KeyPackages[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return DkgRound3ResponseValidationError{
					field:  fmt.Sprintf("KeyPackages[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return DkgRound3ResponseMultiError(errors)
	}

	return nil
}

// DkgRound3ResponseMultiError is an error wrapping multiple validation errors
// returned by DkgRound3Response.ValidateAll() if the designated constraints
// aren't met.
type DkgRound3ResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DkgRound3ResponseMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DkgRound3ResponseMultiError) AllErrors() []error { return m }

// DkgRound3ResponseValidationError is the validation error returned by
// DkgRound3Response.Validate if the designated constraints aren't met.
type DkgRound3ResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DkgRound3ResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DkgRound3ResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DkgRound3ResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DkgRound3ResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DkgRound3ResponseValidationError) ErrorName() string {
	return "DkgRound3ResponseValidationError"
}

// Error satisfies the builtin error interface
func (e DkgRound3ResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDkgRound3Response.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DkgRound3ResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DkgRound3ResponseValidationError{}

// Validate checks the field values on SigningNonce with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *SigningNonce) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SigningNonce with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in SigningNonceMultiError, or
// nil if none found.
func (m *SigningNonce) ValidateAll() error {
	return m.validate(true)
}

func (m *SigningNonce) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Hiding

	// no validation rules for Binding

	if len(errors) > 0 {
		return SigningNonceMultiError(errors)
	}

	return nil
}

// SigningNonceMultiError is an error wrapping multiple validation errors
// returned by SigningNonce.ValidateAll() if the designated constraints aren't met.
type SigningNonceMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SigningNonceMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m SigningNonceMultiError) AllErrors() []error { return m }

// SigningNonceValidationError is the validation error returned by
// SigningNonce.Validate if the designated constraints aren't met.
type SigningNonceValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SigningNonceValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SigningNonceValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SigningNonceValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SigningNonceValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SigningNonceValidationError) ErrorName() string { return "SigningNonceValidationError" }

// Error satisfies the builtin error interface
func (e SigningNonceValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sSigningNonce.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SigningNonceValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SigningNonceValidationError{}

// Validate checks the field values on FrostNonceRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *FrostNonceRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on FrostNonceRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FrostNonceRequestMultiError, or nil if none found.
func (m *FrostNonceRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *FrostNonceRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	for idx, item := range m.GetKeyPackages() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, FrostNonceRequestValidationError{
						field:  fmt.Sprintf("KeyPackages[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, FrostNonceRequestValidationError{
						field:  fmt.Sprintf("KeyPackages[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return FrostNonceRequestValidationError{
					field:  fmt.Sprintf("KeyPackages[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return FrostNonceRequestMultiError(errors)
	}

	return nil
}

// FrostNonceRequestMultiError is an error wrapping multiple validation errors
// returned by FrostNonceRequest.ValidateAll() if the designated constraints
// aren't met.
type FrostNonceRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m FrostNonceRequestMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m FrostNonceRequestMultiError) AllErrors() []error { return m }

// FrostNonceRequestValidationError is the validation error returned by
// FrostNonceRequest.Validate if the designated constraints aren't met.
type FrostNonceRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e FrostNonceRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e FrostNonceRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e FrostNonceRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e FrostNonceRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e FrostNonceRequestValidationError) ErrorName() string {
	return "FrostNonceRequestValidationError"
}

// Error satisfies the builtin error interface
func (e FrostNonceRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sFrostNonceRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = FrostNonceRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = FrostNonceRequestValidationError{}

// Validate checks the field values on SigningNonceResult with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *SigningNonceResult) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SigningNonceResult with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// SigningNonceResultMultiError, or nil if none found.
func (m *SigningNonceResult) ValidateAll() error {
	return m.validate(true)
}

func (m *SigningNonceResult) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if all {
		switch v := interface{}(m.GetNonces()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, SigningNonceResultValidationError{
					field:  "Nonces",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, SigningNonceResultValidationError{
					field:  "Nonces",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetNonces()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return SigningNonceResultValidationError{
				field:  "Nonces",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	if all {
		switch v := interface{}(m.GetCommitments()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, SigningNonceResultValidationError{
					field:  "Commitments",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, SigningNonceResultValidationError{
					field:  "Commitments",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetCommitments()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return SigningNonceResultValidationError{
				field:  "Commitments",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	if len(errors) > 0 {
		return SigningNonceResultMultiError(errors)
	}

	return nil
}

// SigningNonceResultMultiError is an error wrapping multiple validation errors
// returned by SigningNonceResult.ValidateAll() if the designated constraints
// aren't met.
type SigningNonceResultMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SigningNonceResultMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m SigningNonceResultMultiError) AllErrors() []error { return m }

// SigningNonceResultValidationError is the validation error returned by
// SigningNonceResult.Validate if the designated constraints aren't met.
type SigningNonceResultValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SigningNonceResultValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SigningNonceResultValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SigningNonceResultValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SigningNonceResultValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SigningNonceResultValidationError) ErrorName() string {
	return "SigningNonceResultValidationError"
}

// Error satisfies the builtin error interface
func (e SigningNonceResultValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sSigningNonceResult.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SigningNonceResultValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SigningNonceResultValidationError{}

// Validate checks the field values on FrostNonceResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FrostNonceResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on FrostNonceResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FrostNonceResponseMultiError, or nil if none found.
func (m *FrostNonceResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *FrostNonceResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	for idx, item := range m.GetResults() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, FrostNonceResponseValidationError{
						field:  fmt.Sprintf("Results[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, FrostNonceResponseValidationError{
						field:  fmt.Sprintf("Results[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return FrostNonceResponseValidationError{
					field:  fmt.Sprintf("Results[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return FrostNonceResponseMultiError(errors)
	}

	return nil
}

// FrostNonceResponseMultiError is an error wrapping multiple validation errors
// returned by FrostNonceResponse.ValidateAll() if the designated constraints
// aren't met.
type FrostNonceResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m FrostNonceResponseMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m FrostNonceResponseMultiError) AllErrors() []error { return m }

// FrostNonceResponseValidationError is the validation error returned by
// FrostNonceResponse.Validate if the designated constraints aren't met.
type FrostNonceResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e FrostNonceResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e FrostNonceResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e FrostNonceResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e FrostNonceResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e FrostNonceResponseValidationError) ErrorName() string {
	return "FrostNonceResponseValidationError"
}

// Error satisfies the builtin error interface
func (e FrostNonceResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sFrostNonceResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = FrostNonceResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = FrostNonceResponseValidationError{}

// Validate checks the field values on FrostSigningJob with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *FrostSigningJob) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on FrostSigningJob with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FrostSigningJobMultiError, or nil if none found.
func (m *FrostSigningJob) ValidateAll() error {
	return m.validate(true)
}

func (m *FrostSigningJob) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for JobId

	// no validation rules for Message

	if all {
		switch v := interface{}(m.GetKeyPackage()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, FrostSigningJobValidationError{
					field:  "KeyPackage",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, FrostSigningJobValidationError{
					field:  "KeyPackage",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetKeyPackage()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return FrostSigningJobValidationError{
				field:  "KeyPackage",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	// no validation rules for VerifyingKey

	if all {
		switch v := interface{}(m.GetNonce()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, FrostSigningJobValidationError{
					field:  "Nonce",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, FrostSigningJobValidationError{
					field:  "Nonce",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetNonce()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return FrostSigningJobValidationError{
				field:  "Nonce",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	{
		sorted_keys := make([]string, len(m.GetCommitments()))
		i := 0
		for key := range m.GetCommitments() {
			sorted_keys[i] = key
			i++
		}
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
		for _, key := range sorted_keys {
			val := m.GetCommitments()[key]
			_ = val

			// no validation rules for Commitments[key]

			if all {
				switch v := interface{}(val).(type) {
				case interface{ ValidateAll() error }:
					if err := v.ValidateAll(); err != nil {
						errors = append(errors, FrostSigningJobValidationError{
							field:  fmt.Sprintf("Commitments[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				case interface{ Validate() error }:
					if err := v.Validate(); err != nil {
						errors = append(errors, FrostSigningJobValidationError{
							field:  fmt.Sprintf("Commitments[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				}
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
				if err := v.Validate(); err != nil {
					return FrostSigningJobValidationError{
						field:  fmt.Sprintf("Commitments[%v]", key),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}

		}
	}

	if all {
		switch v := interface{}(m.GetUserCommitments()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, FrostSigningJobValidationError{
					field:  "UserCommitments",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, FrostSigningJobValidationError{
					field:  "UserCommitments",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetUserCommitments()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return FrostSigningJobValidationError{
				field:  "UserCommitments",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	// no validation rules for AdaptorPublicKey

	if len(errors) > 0 {
		return FrostSigningJobMultiError(errors)
	}

	return nil
}

// FrostSigningJobMultiError is an error wrapping multiple validation errors
// returned by FrostSigningJob.ValidateAll() if the designated constraints
// aren't met.
type FrostSigningJobMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m FrostSigningJobMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m FrostSigningJobMultiError) AllErrors() []error { return m }

// FrostSigningJobValidationError is the validation error returned by
// FrostSigningJob.Validate if the designated constraints aren't met.
type FrostSigningJobValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e FrostSigningJobValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e FrostSigningJobValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e FrostSigningJobValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e FrostSigningJobValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e FrostSigningJobValidationError) ErrorName() string { return "FrostSigningJobValidationError" }

// Error satisfies the builtin error interface
func (e FrostSigningJobValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sFrostSigningJob.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = FrostSigningJobValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = FrostSigningJobValidationError{}

// Validate checks the field values on SignFrostRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *SignFrostRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SignFrostRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// SignFrostRequestMultiError, or nil if none found.
func (m *SignFrostRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *SignFrostRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	for idx, item := range m.GetSigningJobs() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, SignFrostRequestValidationError{
						field:  fmt.Sprintf("SigningJobs[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, SignFrostRequestValidationError{
						field:  fmt.Sprintf("SigningJobs[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return SignFrostRequestValidationError{
					field:  fmt.Sprintf("SigningJobs[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for Role

	if len(errors) > 0 {
		return SignFrostRequestMultiError(errors)
	}

	return nil
}

// SignFrostRequestMultiError is an error wrapping multiple validation errors
// returned by SignFrostRequest.ValidateAll() if the designated constraints
// aren't met.
type SignFrostRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SignFrostRequestMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m SignFrostRequestMultiError) AllErrors() []error { return m }

// SignFrostRequestValidationError is the validation error returned by
// SignFrostRequest.Validate if the designated constraints aren't met.
type SignFrostRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SignFrostRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SignFrostRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SignFrostRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SignFrostRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SignFrostRequestValidationError) ErrorName() string { return "SignFrostRequestValidationError" }

// Error satisfies the builtin error interface
func (e SignFrostRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sSignFrostRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SignFrostRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SignFrostRequestValidationError{}

// Validate checks the field values on SignFrostResponse with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *SignFrostResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SignFrostResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// SignFrostResponseMultiError, or nil if none found.
func (m *SignFrostResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *SignFrostResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	{
		sorted_keys := make([]string, len(m.GetResults()))
		i := 0
		for key := range m.GetResults() {
			sorted_keys[i] = key
			i++
		}
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
		for _, key := range sorted_keys {
			val := m.GetResults()[key]
			_ = val

			// no validation rules for Results[key]

			if all {
				switch v := interface{}(val).(type) {
				case interface{ ValidateAll() error }:
					if err := v.ValidateAll(); err != nil {
						errors = append(errors, SignFrostResponseValidationError{
							field:  fmt.Sprintf("Results[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				case interface{ Validate() error }:
					if err := v.Validate(); err != nil {
						errors = append(errors, SignFrostResponseValidationError{
							field:  fmt.Sprintf("Results[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				}
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
				if err := v.Validate(); err != nil {
					return SignFrostResponseValidationError{
						field:  fmt.Sprintf("Results[%v]", key),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}

		}
	}

	if len(errors) > 0 {
		return SignFrostResponseMultiError(errors)
	}

	return nil
}

// SignFrostResponseMultiError is an error wrapping multiple validation errors
// returned by SignFrostResponse.ValidateAll() if the designated constraints
// aren't met.
type SignFrostResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SignFrostResponseMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m SignFrostResponseMultiError) AllErrors() []error { return m }

// SignFrostResponseValidationError is the validation error returned by
// SignFrostResponse.Validate if the designated constraints aren't met.
type SignFrostResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SignFrostResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SignFrostResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SignFrostResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SignFrostResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SignFrostResponseValidationError) ErrorName() string {
	return "SignFrostResponseValidationError"
}

// Error satisfies the builtin error interface
func (e SignFrostResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sSignFrostResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SignFrostResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SignFrostResponseValidationError{}

// Validate checks the field values on AggregateFrostRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AggregateFrostRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AggregateFrostRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AggregateFrostRequestMultiError, or nil if none found.
func (m *AggregateFrostRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *AggregateFrostRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Message

	// no validation rules for SignatureShares

	// no validation rules for PublicShares

	// no validation rules for VerifyingKey

	{
		sorted_keys := make([]string, len(m.GetCommitments()))
		i := 0
		for key := range m.GetCommitments() {
			sorted_keys[i] = key
			i++
		}
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
		for _, key := range sorted_keys {
			val := m.GetCommitments()[key]
			_ = val

			// no validation rules for Commitments[key]

			if all {
				switch v := interface{}(val).(type) {
				case interface{ ValidateAll() error }:
					if err := v.ValidateAll(); err != nil {
						errors = append(errors, AggregateFrostRequestValidationError{
							field:  fmt.Sprintf("Commitments[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				case interface{ Validate() error }:
					if err := v.Validate(); err != nil {
						errors = append(errors, AggregateFrostRequestValidationError{
							field:  fmt.Sprintf("Commitments[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				}
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
				if err := v.Validate(); err != nil {
					return AggregateFrostRequestValidationError{
						field:  fmt.Sprintf("Commitments[%v]", key),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}

		}
	}

	if all {
		switch v := interface{}(m.GetUserCommitments()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, AggregateFrostRequestValidationError{
					field:  "UserCommitments",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, AggregateFrostRequestValidationError{
					field:  "UserCommitments",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetUserCommitments()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return AggregateFrostRequestValidationError{
				field:  "UserCommitments",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	// no validation rules for UserPublicKey

	// no validation rules for UserSignatureShare

	// no validation rules for AdaptorPublicKey

	if len(errors) > 0 {
		return AggregateFrostRequestMultiError(errors)
	}

	return nil
}

// AggregateFrostRequestMultiError is an error wrapping multiple validation
// errors returned by AggregateFrostRequest.ValidateAll() if the designated
// constraints aren't met.
type AggregateFrostRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AggregateFrostRequestMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AggregateFrostRequestMultiError) AllErrors() []error { return m }

// AggregateFrostRequestValidationError is the validation error returned by
// AggregateFrostRequest.Validate if the designated constraints aren't met.
type AggregateFrostRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AggregateFrostRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AggregateFrostRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AggregateFrostRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AggregateFrostRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AggregateFrostRequestValidationError) ErrorName() string {
	return "AggregateFrostRequestValidationError"
}

// Error satisfies the builtin error interface
func (e AggregateFrostRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAggregateFrostRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AggregateFrostRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AggregateFrostRequestValidationError{}

// Validate checks the field values on AggregateFrostResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AggregateFrostResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AggregateFrostResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AggregateFrostResponseMultiError, or nil if none found.
func (m *AggregateFrostResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *AggregateFrostResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Signature

	if len(errors) > 0 {
		return AggregateFrostResponseMultiError(errors)
	}

	return nil
}

// AggregateFrostResponseMultiError is an error wrapping multiple validation
// errors returned by AggregateFrostResponse.ValidateAll() if the designated
// constraints aren't met.
type AggregateFrostResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AggregateFrostResponseMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AggregateFrostResponseMultiError) AllErrors() []error { return m }

// AggregateFrostResponseValidationError is the validation error returned by
// AggregateFrostResponse.Validate if the designated constraints aren't met.
type AggregateFrostResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AggregateFrostResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AggregateFrostResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AggregateFrostResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AggregateFrostResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AggregateFrostResponseValidationError) ErrorName() string {
	return "AggregateFrostResponseValidationError"
}

// Error satisfies the builtin error interface
func (e AggregateFrostResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAggregateFrostResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AggregateFrostResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AggregateFrostResponseValidationError{}

// Validate checks the field values on ValidateSignatureShareRequest with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *ValidateSignatureShareRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ValidateSignatureShareRequest with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// ValidateSignatureShareRequestMultiError, or nil if none found.
func (m *ValidateSignatureShareRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *ValidateSignatureShareRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Identifier

	// no validation rules for Role

	// no validation rules for Message

	// no validation rules for SignatureShare

	// no validation rules for PublicShare

	// no validation rules for VerifyingKey

	{
		sorted_keys := make([]string, len(m.GetCommitments()))
		i := 0
		for key := range m.GetCommitments() {
			sorted_keys[i] = key
			i++
		}
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
		for _, key := range sorted_keys {
			val := m.GetCommitments()[key]
			_ = val

			// no validation rules for Commitments[key]

			if all {
				switch v := interface{}(val).(type) {
				case interface{ ValidateAll() error }:
					if err := v.ValidateAll(); err != nil {
						errors = append(errors, ValidateSignatureShareRequestValidationError{
							field:  fmt.Sprintf("Commitments[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				case interface{ Validate() error }:
					if err := v.Validate(); err != nil {
						errors = append(errors, ValidateSignatureShareRequestValidationError{
							field:  fmt.Sprintf("Commitments[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				}
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
				if err := v.Validate(); err != nil {
					return ValidateSignatureShareRequestValidationError{
						field:  fmt.Sprintf("Commitments[%v]", key),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}

		}
	}

	if all {
		switch v := interface{}(m.GetUserCommitments()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, ValidateSignatureShareRequestValidationError{
					field:  "UserCommitments",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, ValidateSignatureShareRequestValidationError{
					field:  "UserCommitments",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetUserCommitments()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return ValidateSignatureShareRequestValidationError{
				field:  "UserCommitments",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	if len(errors) > 0 {
		return ValidateSignatureShareRequestMultiError(errors)
	}

	return nil
}

// ValidateSignatureShareRequestMultiError is an error wrapping multiple
// validation errors returned by ValidateSignatureShareRequest.ValidateAll()
// if the designated constraints aren't met.
type ValidateSignatureShareRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m ValidateSignatureShareRequestMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ValidateSignatureShareRequestMultiError) AllErrors() []error { return m }

// ValidateSignatureShareRequestValidationError is the validation error
// returned by ValidateSignatureShareRequest.Validate if the designated
// constraints aren't met.
type ValidateSignatureShareRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e ValidateSignatureShareRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e ValidateSignatureShareRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e ValidateSignatureShareRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e ValidateSignatureShareRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e ValidateSignatureShareRequestValidationError) ErrorName() string {
	return "ValidateSignatureShareRequestValidationError"
}

// Error satisfies the builtin error interface
func (e ValidateSignatureShareRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sValidateSignatureShareRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ValidateSignatureShareRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ValidateSignatureShareRequestValidationError{}
