in client/internal/secret_sharing/internal/shamirgeneric/shamir_generic.go [197:214]
func validateSplitInput(metadata secrets.Metadata, secret []byte, gf field.GaloisField) error {
if len(secret) == 0 {
return fmt.Errorf("secret must not be nil")
}
if metadata.NumShares < 2 {
return fmt.Errorf("numShares must be larger than 1")
}
if metadata.Threshold < 2 {
return fmt.Errorf("threshold must be larger than 1")
}
if metadata.Threshold > metadata.NumShares {
return fmt.Errorf("threshold should be smaller than or equal to numShares")
}
if metadata.Field != gf.FieldID() {
return fmt.Errorf("field ID mismatch")
}
return nil
}