Browse Source

Fix up the AES-NI detection build constraints.

Mostly to deal with appengine and noasm.
Yawning Angel 3 years ago
parent
commit
e06297f348
2 changed files with 4 additions and 2 deletions
  1. 3 1
      aesni.go
  2. 1 1
      aesni_stub.go

+ 3 - 1
aesni.go

@@ -22,6 +22,8 @@
 
 // +build go1.6
 // +build !gccgo
+// +build !appengine
+// +build !noasm
 // +build amd64
 
 package bsaes
@@ -39,7 +41,7 @@ func supportsAESNI() bool {
 		aesniBit  = 1 << 25
 	)
 
-	// Check for AES-NI support.
+	// Check for AES-NI and PCLMUL support.
 	// CPUID.(EAX=01H, ECX=0H):ECX.AESNI[bit 25]==1
 	//                         ECX.PCLMUL[bit 1]==1
 	regs := [4]uint32{0x01}

+ 1 - 1
aesni_stub.go

@@ -20,7 +20,7 @@
 // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 // SOFTWARE.
 
-// +build !go1.6 gccgo !amd64
+// +build !go1.6 gccgo appengine noasm !amd64
 
 package bsaes