Comments (6)
Thanks! I think this is caused by a mismatch between the fp_print() and fp_cmp() functions. To facilitate debugging, fp_print() converts back from the Montgomery representation, while fp_cmp() compares raw digit vectors. Far from intuitive, I know. :(
Perhaps fp_cmp() should only perform equality checks, since a finite field does not admit a total order anyways?
from relic.
I see. I don’t know what the right answer is, but its semantics should not change based on a configuration option. In practice I do need lexicographic ordering for a point compression scheme I have to interoperate with. Does comparing Montgomery representations have any meaning?
from relic.
Agree, will move this to the DV module which does not care about fields and change fp_cmp() for equality checks, which work among different representations.
Comparing Montgomery representations does not conserve any ordering, since everything is multiplied by (R mod p); and you should not transmit coordinates in Montgomery form anyway. Maybe you should first export to byte vectors with fp_write_bin() and then perform the comparison?
from relic.
I meant that if comparing Montgomery representations is meaningless it would be reasonable to make fp_cmp convert back before comparing, but yeah also comparing fp_write_bin outputs works for me.
from relic.
Fixed the issue according to the solution suggested above in commit 78a1266
from relic.
Thanks again for reporting!
from relic.
Related Issues (20)
- Error thrown in Optimal Ate Pairing HOT 2
- bench_rand.c not compiling with RAND=CALL HOT 1
- Error in the KSS-18-638 curve initialization function HOT 5
- Unable to install presets on M1 chip arm64 HOT 3
- Error in ep_param_set() HOT 8
- can not deduce the macro WSIZE on Apple M2 HOT 4
- BLS signatures with point compression HOT 2
- Want to use BN_254 curve HOT 1
- Build failure since recent commit HOT 1
- Compile failure on recent master HOT 4
- Compiling on M1 Mac HOT 1
- Compile Failue with x64-ecc-128 preset HOT 3
- cmake error the target not found HOT 2
- Homegaming HOT 1
- Leak the Secret Key of BBS Short Signature in Relic via Rowhammer HOT 4
- /demo/ers-etrs code running error HOT 3
- `bn_gcd_ext_binar` returns different Bezout coefficients HOT 2
- Problem while compiling HOT 12
- Error generating lib file HOT 2
- Alerts for errors HOT 4
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 relic.