mirror of
https://github.com/Luzifer/go-dhparam.git
synced 2024-11-09 15:50:02 +00:00
Lint: Unexport internal constants
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c07b9032a2
commit
35bb50a88a
1 changed files with 14 additions and 14 deletions
28
validate.go
28
validate.go
|
@ -6,13 +6,13 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const DH_CHECK_P_NOT_PRIME = 0x01
|
||||
const DH_CHECK_P_NOT_SAFE_PRIME = 0x02
|
||||
const DH_UNABLE_TO_CHECK_GENERATOR = 0x04
|
||||
const DH_NOT_SUITABLE_GENERATOR = 0x08
|
||||
const DH_CHECK_Q_NOT_PRIME = 0x10
|
||||
const DH_CHECK_INVALID_Q_VALUE = 0x20
|
||||
const DH_CHECK_INVALID_J_VALUE = 0x40
|
||||
const dh_check_p_not_prime = 0x01
|
||||
const dh_check_p_not_safe_prime = 0x02
|
||||
const dh_unable_to_check_generator = 0x04
|
||||
const dh_not_suitable_generator = 0x08
|
||||
const dh_check_q_not_prime = 0x10
|
||||
const dh_check_invalid_q_value = 0x20
|
||||
const dh_check_invalid_j_value = 0x40
|
||||
|
||||
// ErrAllParametersOK is defined to check whether the returned error from Check is indeed no error
|
||||
// For simplicity reasons it is defined as an error instead of an additional result parameter
|
||||
|
@ -29,37 +29,37 @@ func (d DH) Check() ([]error, bool) {
|
|||
|
||||
i := d.check()
|
||||
|
||||
if i&DH_CHECK_P_NOT_PRIME > 0 {
|
||||
if i&dh_check_p_not_prime > 0 {
|
||||
result = append(result, errors.New("WARNING: p value is not prime"))
|
||||
ok = false
|
||||
}
|
||||
|
||||
if i&DH_CHECK_P_NOT_SAFE_PRIME > 0 {
|
||||
if i&dh_check_p_not_safe_prime > 0 {
|
||||
result = append(result, errors.New("WARNING: p value is not a safe prime"))
|
||||
ok = false
|
||||
}
|
||||
|
||||
if i&DH_CHECK_Q_NOT_PRIME > 0 {
|
||||
if i&dh_check_q_not_prime > 0 {
|
||||
result = append(result, errors.New("WARNING: q value is not a prime"))
|
||||
ok = false
|
||||
}
|
||||
|
||||
if i&DH_CHECK_INVALID_Q_VALUE > 0 {
|
||||
if i&dh_check_invalid_q_value > 0 {
|
||||
result = append(result, errors.New("WARNING: q value is invalid"))
|
||||
ok = false
|
||||
}
|
||||
|
||||
if i&DH_CHECK_INVALID_J_VALUE > 0 {
|
||||
if i&dh_check_invalid_j_value > 0 {
|
||||
result = append(result, errors.New("WARNING: j value is invalid"))
|
||||
ok = false
|
||||
}
|
||||
|
||||
if i&DH_UNABLE_TO_CHECK_GENERATOR > 0 {
|
||||
if i&dh_unable_to_check_generator > 0 {
|
||||
result = append(result, errors.New("WARNING: unable to check the generator value"))
|
||||
ok = false
|
||||
}
|
||||
|
||||
if i&DH_NOT_SUITABLE_GENERATOR > 0 {
|
||||
if i&dh_not_suitable_generator > 0 {
|
||||
result = append(result, errors.New("WARNING: the g value is not a generator"))
|
||||
ok = false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue