diff --git a/math/gf4096/gf4096.go b/math/gf4096/gf4096.go index bc4b9db35..baba35417 100644 --- a/math/gf4096/gf4096.go +++ b/math/gf4096/gf4096.go @@ -2,11 +2,11 @@ package gf4096 // Gf is a field element of characteristic 2 modulo z^12 + z^3 + 1 -type Gf = uint16 +type Elt = uint16 const ( - GfBits = 12 - GfMask = (1 << GfBits) - 1 + Bits = 12 + Mask = (1 << Bits) - 1 ) // 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 { tmp ^= t >> 9 tmp ^= t >> 12 - return uint16(tmp & GfMask) + return Elt(tmp & Mask) } // sqr calculates the square of Gf element a diff --git a/math/gf4096/gf_test.go b/math/gf4096/gf_test.go index 61c7b26cf..43add0ceb 100644 --- a/math/gf4096/gf_test.go +++ b/math/gf4096/gf_test.go @@ -17,7 +17,7 @@ type ( func assertEq(t *testing.T, a, b Gf) { t.Helper() if a != b { - test.ReportError(t, b, a) + test.ReportError(t, a, b) } }