Skip to content

Commit

Permalink
Merge pull request #7 from keep-network/do-not-change-my-t
Browse files Browse the repository at this point in the history
t offset counter is no longer passed as a pointer
  • Loading branch information
mhluongo authored Jun 21, 2019
2 parents 9cf6195 + 7197921 commit cf26032
Show file tree
Hide file tree
Showing 5 changed files with 2,054 additions and 2,055 deletions.
2 changes: 1 addition & 1 deletion f.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var precomputed = [10][16]byte{
// vector `h`, message block vector `mb`, offset counter `t`, final
// block indicator flag `f`, and number of rounds `rounds`. The state vector
// provided as the first parameter is modified by the function.
func F(h *[8]uint64, mb [BlockSize]byte, t *[2]uint64, f bool, rounds int) {
func F(h *[8]uint64, mb [BlockSize]byte, t [2]uint64, f bool, rounds int) {
var m [16]uint64
t0, t1 := t[0], t[1]

Expand Down
5 changes: 2 additions & 3 deletions f_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ func runTest(t *testing.T, testVectors []testVector) {
var m [BlockSize]byte
copy(m[:], mDecoded)
h := test.hIn
c := test.c

F(&h, m, &c, test.f, test.rounds)
F(&h, m, test.t, test.f, test.rounds)

if !reflect.DeepEqual(test.hOut, h) {
t.Errorf("Unexpected result\nExpected: [%v]\nActual: [%v]\n", test.hOut, h)
Expand All @@ -43,7 +42,7 @@ func runTest(t *testing.T, testVectors []testVector) {
type testVector struct {
mIn string
hIn [8]uint64
c [2]uint64
t [2]uint64
f bool
rounds int
hOut [8]uint64
Expand Down
Loading

0 comments on commit cf26032

Please sign in to comment.