Skip to content

Commit 8e3bbbe

Browse files
Kris Kwiatkowskineuromncr
Kris Kwiatkowski
authored andcommitted
Fixes code issues detected by golint
1 parent 8a60f13 commit 8e3bbbe

25 files changed

+456
-457
lines changed

Diff for: .etc/golangci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ linters:
33
disable:
44
- ineffassign
55
- gocritic
6-
- golint
76
- stylecheck
87
- errcheck
98
- misspell

Diff for: dh/sidh/internal/common/types.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@ package common
22

33
const (
44
// corresponds to words in P751
5-
FP_MAX_WORDS = 12
5+
FpMaxWords = 12
66
// corresponds to byte size of P751 SIDH private key for B
7-
MAX_SIDH_PRIVATE_KEY_BSZ = 48
7+
MaxSidhPrivateKeyBsz = 48
88
// corresponds to byte size of P751 SIKE private key for B
9-
MAX_SIKE_PRIVATE_KEY_BSZ = MAX_SIDH_PRIVATE_KEY_BSZ + MAX_MSG_BSZ
9+
MaxSikePrivateKeyBsz = MaxSidhPrivateKeyBsz + MaxMsgBsz
1010
// corresponds to SIKE max length of 'n' (see 1.4 of SIKE spec in NIST PQC round 1)
11-
MAX_MSG_BSZ = 40
11+
MaxMsgBsz = 40
1212
// corresponds to byte size of shared secret generated by SIKEp751
13-
MAX_SHARED_SECRET_BSZ = 188
13+
MaxSharedSecretBsz = 188
1414
// correponds to by size of the P751 public key
15-
MAX_PUBLIC_KEY_SZ = 3 * FP_MAX_WORDS * 64
15+
MaxPublicKeySz = 3 * FpMaxWords * 64
1616
// correponds to by size of the ciphertext produced by SIKE/P751
17-
MAX_CIPHERTEXT_BSZ = MAX_MSG_BSZ + MAX_PUBLIC_KEY_SZ
17+
MaxCiphertextBsz = MaxMsgBsz + MaxPublicKeySz
1818
)
1919

2020
// Id's correspond to bitlength of the prime field characteristic
21-
// Currently FP_751 is the only one supported by this implementation
21+
// Currently Fp751 is the only one supported by this implementation
2222
const (
23-
FP_503 uint8 = iota
24-
FP_751
23+
Fp503 uint8 = iota
24+
Fp751
2525
)
2626

2727
// Representation of an element of the base field F_p.
2828
//
2929
// No particular meaning is assigned to the representation -- it could represent
3030
// an element in Montgomery form, or not. Tracking the meaning of the field
3131
// element is left to higher types.
32-
type Fp [FP_MAX_WORDS]uint64
32+
type Fp [FpMaxWords]uint64
3333

3434
// Represents an intermediate product of two elements of the base field F_p.
35-
type FpX2 [2 * FP_MAX_WORDS]uint64
35+
type FpX2 [2 * FpMaxWords]uint64
3636

3737
// Represents an element of the extended field Fp^2 = Fp(x+i)
3838
type Fp2 struct {
@@ -42,7 +42,7 @@ type Fp2 struct {
4242

4343
type DomainParams struct {
4444
// P, Q and R=P-Q base points
45-
Affine_P, Affine_Q, Affine_R Fp2
45+
AffineP, AffineQ, AffineR Fp2
4646
// Size of a compuatation strategy for x-torsion group
4747
IsogenyStrategy []uint32
4848
// Max size of secret key for x-torsion group
@@ -52,7 +52,7 @@ type DomainParams struct {
5252
}
5353

5454
type SidhParams struct {
55-
Id uint8
55+
ID uint8
5656
// Bytelen of P
5757
Bytelen int
5858
// The public key size, in bytes.

Diff for: dh/sidh/internal/p503/arith_generic.go

+24-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dh/sidh/internal/p503/arith_test.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dh/sidh/internal/p503/core.go

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dh/sidh/internal/p503/curve_test.go

+20-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)