1
0
mirror of https://github.com/Luzifer/go-dhparam.git synced 2024-09-19 16:42:57 +00:00

Lint: Unexport internal constants

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-10-08 11:14:14 +02:00
parent c07b9032a2
commit 35bb50a88a
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E

View File

@ -6,13 +6,13 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
const DH_CHECK_P_NOT_PRIME = 0x01 const dh_check_p_not_prime = 0x01
const DH_CHECK_P_NOT_SAFE_PRIME = 0x02 const dh_check_p_not_safe_prime = 0x02
const DH_UNABLE_TO_CHECK_GENERATOR = 0x04 const dh_unable_to_check_generator = 0x04
const DH_NOT_SUITABLE_GENERATOR = 0x08 const dh_not_suitable_generator = 0x08
const DH_CHECK_Q_NOT_PRIME = 0x10 const dh_check_q_not_prime = 0x10
const DH_CHECK_INVALID_Q_VALUE = 0x20 const dh_check_invalid_q_value = 0x20
const DH_CHECK_INVALID_J_VALUE = 0x40 const dh_check_invalid_j_value = 0x40
// ErrAllParametersOK is defined to check whether the returned error from Check is indeed no error // 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 // 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() 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")) result = append(result, errors.New("WARNING: p value is not prime"))
ok = false 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")) result = append(result, errors.New("WARNING: p value is not a safe prime"))
ok = false 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")) result = append(result, errors.New("WARNING: q value is not a prime"))
ok = false 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")) result = append(result, errors.New("WARNING: q value is invalid"))
ok = false 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")) result = append(result, errors.New("WARNING: j value is invalid"))
ok = false 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")) result = append(result, errors.New("WARNING: unable to check the generator value"))
ok = false 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")) result = append(result, errors.New("WARNING: the g value is not a generator"))
ok = false ok = false
} }