Comments (1)
Good catch @kevaundray !
gnark-crypto use-case of twisted Edwards is edDSA in affine coordinates which explains why edDSA tests don't fail. However, as you pointed out, there are two problems with the addition of twisted Edwards points in projective coordinates:
- The linked code corresponds to a mixed addition of a projective point and an affine point (EFD) but the API takes two points in projective with the assumption
Z2=1
. The tests didn't catch this because we directly use projective points that are converted from random affine points, henceZ=1
always. - There is indeed a mistake when multiplying by
p.Z
instead ofp1.Z
(orA
). The tests didn't catch this because they usep1.Add(&p1, &p2)
so in this casep.Z=p1.Z
in theAdd()
function, which is wrong in general.
I made a PR (#90) that renames the current projective Add()
to MixedAdd()
and takes an affine point and a projective point. It also implements the normal Add()
with no assumptions on Z
and revisits the tests so that it catches these problems.
Thank you.
from gnark-crypto.
Related Issues (20)
- What's the rationale for methods returning pointers in the ecc packages? HOT 3
- bug: invalid marshalling found by fuzzer HOT 2
- iop.Polynomial.Evaluate should work in Lagrange/Lagrange shifted form
- refactor: make applying domain separation optional in Fiat-Shamir Transcript HOT 1
- bug: When dynamic linking, R15 may be clobbered by a global variable access HOT 7
- bug: possibly incorrect `DST_prime` in `ExpandMsgXmd` HOT 6
- Parametrizable mimc endianness HOT 4
- Docu: Merkle tree documentation outdated or hashing of nodes in is incorrect
- Add SetElement to fptower.E2 HOT 2
- BLS12-381 G1 Subgroup checks are slow HOT 7
- feat: MIMC security considerations HOT 2
- Optimize Legendre symbol
- Generator of Fr*
- feat: Implement Poseidon hash
- 📦 `github.com/consensys/gnark-crypto/ecc` HOT 1
- bug: MiMC Write() violates hash.Hash expectations. HOT 5
- feat: add MustSetRandom methods
- Question: is it possible to generate secp256k1 ecdsa Private Key from a secret string? HOT 3
- Question: compatibility between crypto/sha256 and gnark/sha2 HOT 1
- bug: Incorrect ScalarMultiplication in bandersnatch HOT 2
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 gnark-crypto.