]> Cypherpunks repositories - gostls13.git/commitdiff
vendor: update golang.org/x/crypto/chacha20poly1305
authorMikio Hara <mikioh.mikioh@gmail.com>
Thu, 5 Jan 2017 23:27:37 +0000 (08:27 +0900)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 7 Jan 2017 00:38:37 +0000 (00:38 +0000)
Updates golang.org/x/crypto/chacha20poly1305 to rev cb497ae for:
- chacha20poly1305: fix detection of BMI on amd64 (https://golang.org/cl/34852)
- chacha20poly1305: fix typos (https://golang.org/cl/34536)
- chacha20poly1305: fix typos (https://golang.org/cl/33855)
- chacha20poly1305: fix build constraints (https://golang.org/cl/32391)

Change-Id: I3a608b5e21b3a72b5aaa5d0afe6c6cffbb1d6fc1
Reviewed-on: https://go-review.googlesource.com/34871
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go
src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s
src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go

index f0d34856b22023f2ff89df6dfb3399280a92e2cd..47550332126e28fa61dbc2ab2295bba23154fee9 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build amd64,go1.7
+// +build go1.7,amd64,!gccgo,!appengine
 
 package chacha20poly1305
 
index 7c6a1a5e68a47d3488d87ed5a28475c98b3d113e..39c58b44a373f76c550ff0e465509154f0fcf532 100644 (file)
@@ -4,7 +4,7 @@
 
 // This file was originally from https://golang.org/cl/24717 by Vlad Krasnov of CloudFlare.
 
-// +build go1.7
+// +build go1.7,amd64,!gccgo,!appengine
 
 #include "textflag.h"
 // General register allocation
@@ -280,9 +280,14 @@ TEXT ·chacha20Poly1305Open(SB), 0, $288-97
        // Check for AVX2 support
        CMPB runtime·support_avx2(SB), $0
        JE   noavx2bmi2Open
-       CMPB runtime·support_bmi2(SB), $1  // for MULXQ
-       JE  chacha20Poly1305Open_AVX2
+
+       // Check BMI2 bit for MULXQ.
+       // runtime·cpuid_ebx7 is always available here
+       // because it passed avx2 check
+       TESTL $(1<<8), runtime·cpuid_ebx7(SB)
+       JNE   chacha20Poly1305Open_AVX2
 noavx2bmi2Open:
+
        // Special optimization, for very short buffers
        CMPQ inl, $128
        JBE  openSSE128 // About 16% faster
@@ -1489,9 +1494,14 @@ TEXT ·chacha20Poly1305Seal(SB), 0, $288-96
        // Check for AVX2 support
        CMPB runtime·support_avx2(SB), $0
        JE   noavx2bmi2Seal
-       CMPB runtime·support_bmi2(SB), $1  // for MULXQ
-       JE   chacha20Poly1305Seal_AVX2
+
+       // Check BMI2 bit for MULXQ.
+       // runtime·cpuid_ebx7 is always available here
+       // because it passed avx2 check
+       TESTL $(1<<8), runtime·cpuid_ebx7(SB)
+       JNE   chacha20Poly1305Seal_AVX2
 noavx2bmi2Seal:
+
        // Special optimization, for very short buffers
        CMPQ inl, $128
        JBE  sealSSE128 // About 15% faster
@@ -1695,7 +1705,7 @@ sealSSETail64:
        MOVO  D1, ctr0Store
 
 sealSSETail64LoopA:
-       // Perform ChaCha rounds, while hashing the prevsiosly encrpyted ciphertext
+       // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
        polyAdd(0(oup))
        polyMul
        LEAQ 16(oup), oup
@@ -1729,7 +1739,7 @@ sealSSETail128:
        MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store
 
 sealSSETail128LoopA:
-       // Perform ChaCha rounds, while hashing the prevsiosly encrpyted ciphertext
+       // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
        polyAdd(0(oup))
        polyMul
        LEAQ 16(oup), oup
@@ -1775,7 +1785,7 @@ sealSSETail192:
        MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2; MOVO D2, ctr2Store
 
 sealSSETail192LoopA:
-       // Perform ChaCha rounds, while hashing the prevsiosly encrpyted ciphertext
+       // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
        polyAdd(0(oup))
        polyMul
        LEAQ 16(oup), oup
index 1d4dcd33fde451771dfd4669a7b5803f8050e841..4c2eb703c327cddc1a3caea33cfc85e9b8dd59c1 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !amd64 !go1.7
+// +build !amd64 !go1.7 gccgo appengine
 
 package chacha20poly1305