Comments (12)
As far as I remember FourQ uses MULXQ
instruction which may not be supported on your CPU.
Line 129 in 79a11e7
The fix which worked for me was to first check if CPU supports MULX and, if not, fallback to unoptimized implementation which doesn't use assembly (I think I needed to add non-assembly implementation to my local clone).
Obviously using newer CPU "solves" the issue :)
from circl.
You are correct. It was using the old version of the code. I had to remove the old version of the Circl library, and fully re-download. It works perfectly now:
from circl.
@billbuchanan we will investigate this issue. In the meantime, which Go version did you use? Did you see this error with other keys, or it is a consistent error for any key? Which CPU model are you using, e.g. Core i5-4000x?
from circl.
I am using Go 1.12.6 windows/amd64
I have managed to get all of the other key exchange methods to work (post-quantum, X25519, X448, and so on), but I get an exception with Fourq using a basic multiplication of the base point (I tried lots of different key value, from simple to random, but still get an exception). My CPU is AMD Phenom II X6 1055T, 2.80 GHz.
from circl.
Thanks for this. Do you have instructions on building for the non-assembly implementation?
from circl.
I am working on a patch, it will be released this week.
from circl.
Thank you so much. Excellent support, and love the library.
from circl.
The PR #96 has added support for legacy multiplication instructions.
Let us know if some other issues arise.
from circl.
Thanks for the update. I now get the error of:
\github.com\cloudflare\circl\ecc\fourq\fp_amd64.s:50: unrecognized instruction "_fpMulLeg"
asm: assembly of github.com\cloudflare\circl\ecc\fourq\fp_amd64.s failed
from circl.
@billbuchanan
I could not reproduce that failure. I tried using go1.12.6, but in a linux machine.
Does that error happen during compilation or running time?
I recommend you to update Go to a more recent version. Also, make sure to clean compilation cache using go clean -cache
from circl.
I can get it to work here:
https://repl.it/@billbuchanan/gofourq
But on my server, I get a runtime error:
c:>fourq.exe
Secret [250 133 245 228 228 163 21 170 121 63 215 199 226 215 181 104 55 156 72
117 141 179 146 105 216 0 226 124 140 33 131 80]
Exception 0xc000001d 0x0 0x0 0x4b2758
PC=0x4b2758
github.com/cloudflare/circl/ecc/fourq.doubleAsm(0xc000085d10)
d:/go/src/src/github.com/cloudflare/circl/ecc/fourq/point_amd64.s:8 +0x8
8
github.com/cloudflare/circl/ecc/fourq.(*pointR1).double(...)
d:/go/src/src/github.com/cloudflare/circl/ecc/fourq/point_amd64.go:24
github.com/cloudflare/circl/ecc/fourq.(*pointR1).ScalarBaseMult(0xc000085d10, 0x
c000058140)
d:/go/src/src/github.com/cloudflare/circl/ecc/fourq/point.go:190 +0x284
github.com/cloudflare/circl/ecc/fourq.(*Point).ScalarBaseMult(0xc000085dd0, 0xc0
00058140)
d:/go/src/src/github.com/cloudflare/circl/ecc/fourq/curve.go:82 +0x70
main.KeyGen(0xc000085ec8, 0xc000058140)
c:/Python27/godir/fourq.go:22 +0x53
main.main()
c:/Python27/godir/fourq.go:49 +0x1d0
rax 0x0
rbx 0x0
rcx 0x0
rdi 0xc000085d10
rsi 0x0
rbp 0xc000085cf0
rsp 0xc000085b28
r8 0x0
r9 0x0
r10 0x0
r11 0x0
r12 0x6c2a26
r13 0x4db6e0
r14 0x0
r15 0x0
rip 0x4b2758
rflags 0x10246
cs 0x33
fs 0x53
gs 0x2b
from circl.
Please take a look on your go.mod file, it should point to the master
version rather than to v1.0.0.
File: go.mod
module main
go 1.13
require github.com/cloudflare/circl master
Note that the error message still points to the function doubleAsm
, which was removed after you reported us the initial bug.
github.com/cloudflare/circl/ecc/fourq.doubleAsm(0xc000085d10)
d:/go/src/src/github.com/cloudflare/circl/ecc/fourq/point_amd64.s:8 +0x8
from circl.
Related Issues (20)
- go plugin not compiling HOT 3
- OPRF - Export Public Key HOT 3
- Add Ascon-80pq to cipher\ascon HOT 2
- cipher/ascon: go routine safe? HOT 1
- Add Validate() function to kem.PublicKey and kem.PrivateKey interfaces
- enhancement request: implement KDF (SDHI and/or Naor-Reingold) HOT 1
- Add KEM combiner which is IND-CCA2 robust HOT 5
- Compatibility with npmjs.com/package/dilithium-crystals HOT 5
- panic: unmarshalling 0 first byte private keys HOT 1
- [QUESTION]: is blindsign package post-quantum secure ? HOT 4
- Bytes() and SetBytes() are not match in BLS12381 G1 and G2 HOT 3
- repo: consider add govulncheck to CI job
- enhancement request: Implement McCallum-Relyea exchange HOT 1
- oprf: Update latest test vectors
- blindrsa: update test vectors to match RFC9474 HOT 1
- add disclaimer and warning to README about Kyber patent
- Unusual Behavior: Successful Signature Verification After Altering Private Key HOT 4
- Why were the patch versions for CVE-2023-1732 released so late? HOT 2
- does KyberSlash affect this verison of Kyber? HOT 3
- ML-DSA? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circl.