func (d DH) Check() ([]error, bool) {
	var (
		result = []error{}
		ok     = true
	)

	i := d.check()

	if i&dhCheckPNotPrime > 0 {
		result = append(result, errors.New("WARNING: p value is not prime"))
		ok = false
	}

	if i&dhCheckPNotSafePrime > 0 {
		result = append(result, errors.New("WARNING: p value is not a safe prime"))
		ok = false
	}

	if i&dhCheckQNotPrime > 0 {
		result = append(result, errors.New("WARNING: q value is not a prime"))
		ok = false
	}

	if i&dhCheckInvalidQValue > 0 {
		result = append(result, errors.New("WARNING: q value is invalid"))
		ok = false
	}

	if i&dhCheckInvalidJValue > 0 {
		result = append(result, errors.New("WARNING: j value is invalid"))
		ok = false
	}

	if i&dhUnableToCheckGenerator > 0 {
		result = append(result, errors.New("WARNING: unable to check the generator value"))
		ok = false
	}

	if i&dhNotSuitableGenerator > 0 {
		result = append(result, errors.New("WARNING: the g value is not a generator"))
		ok = false
	}

	if i == 0 {
		result = append(result, ErrAllParametersOK)
	}

	return result, ok
}
// Check returns a number of errors and an "ok" bool. If the "ok" bool is set to true, still one
// error is returned: ErrAllParametersOK. If "ok" is false, the error list will contain at least
// one error not being equal to ErrAllParametersOK.
Check returns a number of errors and an "ok" bool. If the "ok" bool is set to true, still one
error is returned: ErrAllParametersOK. If "ok" is false, the error list will contain at least
one error not being equal to ErrAllParametersOK.
// Check returns a number of errors and an " ok " bool . If the " ok " bool is set to true still one // error is returned : ErrAllParametersOK . If " ok " is false the error list will contain at least // one error not being equal to ErrAllParametersOK .
func (d DH) Check() ([]error, bool) {
	var (
		result = []error{}
		ok     = true
	)
	i := d.check()
	if i&dhCheckPNotPrime > 0 {
		result = append(result, errors.New("WARNING: p value is not prime"))
		ok = false
	}
	if i&dhCheckPNotSafePrime > 0 {
		result = append(result, errors.New("WARNING: p value is not a safe prime"))
		ok = false
	}
	if i&dhCheckQNotPrime > 0 {
		result = append(result, errors.New("WARNING: q value is not a prime"))
		ok = false
	}
	if i&dhCheckInvalidQValue > 0 {
		result = append(result, errors.New("WARNING: q value is invalid"))
		ok = false
	}
	if i&dhCheckInvalidJValue > 0 {
		result = append(result, errors.New("WARNING: j value is invalid"))
		ok = false
	}
	if i&dhUnableToCheckGenerator > 0 {
		result = append(result, errors.New("WARNING: unable to check the generator value"))
		ok = false
	}
	if i&dhNotSuitableGenerator > 0 {
		result = append(result, errors.New("WARNING: the g value is not a generator"))
		ok = false
	}
	if i == 0 {
		result = append(result, ErrAllParametersOK)
	}
	return result, ok
}
func ( d DH ) Check ( ) ( [ ] error , bool ) { var ( result = [ ] error { } ok = true ) i := d . check ( ) if i & dhCheckPNotPrime > 0 { result = append ( result , errors . New ( " " ) ) ok = false } if i & dhCheckPNotSafePrime > 0 { result = append ( result , errors . New ( " " ) ) ok = false } if i & dhCheckQNotPrime > 0 { result = append ( result , errors . New ( " " ) ) ok = false } if i & dhCheckInvalidQValue > 0 { result = append ( result , errors . New ( " " ) ) ok = false } if i & dhCheckInvalidJValue > 0 { result = append ( result , errors . New ( " " ) ) ok = false } if i & dhUnableToCheckGenerator > 0 { result = append ( result , errors . New ( " " ) ) ok = false } if i & dhNotSuitableGenerator > 0 { result = append ( result , errors . New ( " " ) ) ok = false } if i == 0 { result = append ( result , ErrAllParametersOK ) } return result , ok }
Check returns a number of errors and an "ok" bool.
Check returns a number of errors and an " ok " bool .