We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d81cf1e commit 9e75216Copy full SHA for 9e75216
math/gf4096/gf4096.go
@@ -2,11 +2,11 @@
2
package gf4096
3
4
// Gf is a field element of characteristic 2 modulo z^12 + z^3 + 1
5
-type Gf = uint16
+type Elt = uint16
6
7
const (
8
- GfBits = 12
9
- GfMask = (1 << GfBits) - 1
+ Bits = 12
+ Mask = (1 << Bits) - 1
10
)
11
12
// Add two Gf elements together. Since an addition in Gf(2) is the same as XOR,
@@ -37,7 +37,7 @@ func Mul(a, b Gf) Gf {
37
tmp ^= t >> 9
38
tmp ^= t >> 12
39
40
- return uint16(tmp & GfMask)
+ return Elt(tmp & Mask)
41
}
42
43
// sqr calculates the square of Gf element a
math/gf4096/gf_test.go
@@ -15,8 +15,9 @@ type (
15
16
17
func assertEq(t *testing.T, a, b Gf) {
18
+ t.Helper()
19
if a != b {
- test.ReportError(t, b, a)
20
+ test.ReportError(t, a, b)
21
22
23
0 commit comments