From 35bb50a88a4fa95bf7158f96c13e08f02ea13756 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 8 Oct 2018 11:14:14 +0200 Subject: [PATCH] Lint: Unexport internal constants Signed-off-by: Knut Ahlers --- validate.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/validate.go b/validate.go index 25f9c28..1d59611 100644 --- a/validate.go +++ b/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 }