Issue #43130 shows flaky hash not inbalanced on 386 platform,
which is using AES hashing instead of wyhash.
This CL increase the scramble times to 3 that amd64 using right now.
Fixes #43130
Change-Id: I9d012eda99ff71c13a89448f46fcb9c5e7cec921
Reviewed-on: https://go-review.googlesource.com/c/go/+/384075
Trust: mzh <mzh@golangcn.org>
Run-TryBot: mzh <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
PAND masks<>(SB)(BX*8), X1
final1:
- AESENC X0, X1 // scramble input, xor in seed
- AESENC X1, X1 // scramble combo 2 times
+ PXOR X0, X1 // xor data with seed
+ AESENC X1, X1 // scramble combo 3 times
+ AESENC X1, X1
AESENC X1, X1
MOVL X1, (DX)
RET
MOVOU (AX), X2
MOVOU -16(AX)(BX*1), X3
+ // xor with seed
+ PXOR X0, X2
+ PXOR X1, X3
+
// scramble 3 times
- AESENC X0, X2
- AESENC X1, X3
+ AESENC X2, X2
+ AESENC X3, X3
AESENC X2, X2
AESENC X3, X3
AESENC X2, X2
MOVOU -32(AX)(BX*1), X6
MOVOU -16(AX)(BX*1), X7
- AESENC X0, X4
- AESENC X1, X5
- AESENC X2, X6
- AESENC X3, X7
+ PXOR X0, X4
+ PXOR X1, X5
+ PXOR X2, X6
+ PXOR X3, X7
+
+ AESENC X4, X4
+ AESENC X5, X5
+ AESENC X6, X6
+ AESENC X7, X7
AESENC X4, X4
AESENC X5, X5
DECL BX
JNE aesloop
- // 2 more scrambles to finish
+ // 3 more scrambles to finish
+ AESENC X4, X4
+ AESENC X5, X5
+ AESENC X6, X6
+ AESENC X7, X7
+
AESENC X4, X4
AESENC X5, X5
AESENC X6, X6