aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bn256/cloudflare
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-08-09 18:46:52 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-16 16:02:16 +0800
commit3e21adc6488be41ac882c316486573374785cc82 (patch)
treeed6e1fede007bc8011ed6b12816a5be16ee91c38 /crypto/bn256/cloudflare
parent2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2 (diff)
downloaddexon-3e21adc6488be41ac882c316486573374785cc82.tar
dexon-3e21adc6488be41ac882c316486573374785cc82.tar.gz
dexon-3e21adc6488be41ac882c316486573374785cc82.tar.bz2
dexon-3e21adc6488be41ac882c316486573374785cc82.tar.lz
dexon-3e21adc6488be41ac882c316486573374785cc82.tar.xz
dexon-3e21adc6488be41ac882c316486573374785cc82.tar.zst
dexon-3e21adc6488be41ac882c316486573374785cc82.zip
crypto/bn256: fix issues caused by Go 1.11
Diffstat (limited to 'crypto/bn256/cloudflare')
-rw-r--r--crypto/bn256/cloudflare/gfp_amd64.s2
-rw-r--r--crypto/bn256/cloudflare/gfp_decl.go7
2 files changed, 8 insertions, 1 deletions
diff --git a/crypto/bn256/cloudflare/gfp_amd64.s b/crypto/bn256/cloudflare/gfp_amd64.s
index 3a785d200..bdb4ffb78 100644
--- a/crypto/bn256/cloudflare/gfp_amd64.s
+++ b/crypto/bn256/cloudflare/gfp_amd64.s
@@ -110,7 +110,7 @@ TEXT ·gfpMul(SB),0,$160-24
MOVQ b+16(FP), SI
// Jump to a slightly different implementation if MULX isn't supported.
- CMPB runtime·support_bmi2(SB), $0
+ CMPB ·hasBMI2(SB), $0
JE nobmi2Mul
mulBMI2(0(DI),8(DI),16(DI),24(DI), 0(SI))
diff --git a/crypto/bn256/cloudflare/gfp_decl.go b/crypto/bn256/cloudflare/gfp_decl.go
index 6a8a4fddb..fdea5c11a 100644
--- a/crypto/bn256/cloudflare/gfp_decl.go
+++ b/crypto/bn256/cloudflare/gfp_decl.go
@@ -5,6 +5,13 @@ package bn256
// This file contains forward declarations for the architecture-specific
// assembly implementations of these functions, provided that they exist.
+import (
+ "golang.org/x/sys/cpu"
+)
+
+//nolint:varcheck
+var hasBMI2 = cpu.X86.HasBMI2
+
// go:noescape
func gfpNeg(c, a *gfP)