diff --git a/galois_arm64.go b/galois_arm64.go index e34f39a..d860525 100644 --- a/galois_arm64.go +++ b/galois_arm64.go @@ -33,8 +33,12 @@ func galMulSlice(c byte, in, out []byte, o *options) { return } var done int - galMulNEON(mulTableLow[c][:], mulTableHigh[c][:], in, out) done = (len(in) >> 5) << 5 + if raceEnabled { + raceReadSlice(in[:done]) + raceWriteSlice(out[:done]) + } + galMulNEON(mulTableLow[c][:], mulTableHigh[c][:], in, out) remain := len(in) - done if remain > 0 { @@ -50,9 +54,12 @@ func galMulSliceXor(c byte, in, out []byte, o *options) { sliceXor(in, out, o) return } - var done int + done := (len(in) >> 5) << 5 + if raceEnabled { + raceReadSlice(in[:done]) + raceWriteSlice(out[:done]) + } galMulXorNEON(mulTableLow[c][:], mulTableHigh[c][:], in, out) - done = (len(in) >> 5) << 5 remain := len(in) - done if remain > 0 { diff --git a/xor_arm64.go b/xor_arm64.go index b3b579d..ffda888 100644 --- a/xor_arm64.go +++ b/xor_arm64.go @@ -10,7 +10,7 @@ func sliceXor(in, out []byte, o *options) { done := (len(in) >> 5) << 5 if raceEnabled { raceWriteSlice(out[:done]) - raceReadSlices(in[:done]) + raceReadSlice(in[:done]) } xorSliceNEON(in, out)