chacha20poly1305: correct AVX2 feature detection
CL 110355 switched out the adhoc cpu feature detection for x/sys/cpu, in doing so the AVX2 check was broken. The assembly code uses MULX which is part of BMI2. Updates golang/go#24843 Change-Id: I4719b8ff3211eb1c823099512e593e540d6f3be8 GitHub-Last-Rev: 70542b53cd09fcae26c3579cd84bcee39a4b8a57 GitHub-Pull-Request: golang/crypto#44 Reviewed-on: https://go-review.googlesource.com/110796 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
613d6eafa3
commit
2c241ca304
@@ -20,7 +20,7 @@ func chacha20Poly1305Seal(dst []byte, key []uint32, src, ad []byte)
|
||||
|
||||
var (
|
||||
useASM = cpu.X86.HasSSSE3
|
||||
useAVX2 = cpu.X86.HasAVX2
|
||||
useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI2
|
||||
)
|
||||
|
||||
// setupState writes a ChaCha20 input matrix to state. See
|
||||
|
||||
Reference in New Issue
Block a user