Giter Club home page Giter Club logo

Comments (4)

Divide-By-0 avatar Divide-By-0 commented on July 29, 2024 1

bn254 is defined over the numbers 0-q, you can check the definition of q in that file corresponds to the size of the prime for BN254 in i.e. https://hackmd.io/@jpw/bn254 . It seems the public inputs should be checked against the size of the scalar field, not the base field, so I agree with this note.

But you're right that tornado cash checks those same public inputs against the scalar prime: https://github.com/tornadocash/tornado-core/blob/1ef6a263ac6a0e476d063fcb269a9df65a1bd56a/contracts/Verifier.sol#L199

from snarkjs.

Stumble avatar Stumble commented on July 29, 2024

More context: https://github.com/tornadocash/tornado-core/blob/master/contracts/Verifier.sol#L216
tornado's implementation

from snarkjs.

Stumble avatar Stumble commented on July 29, 2024

I'm leaning more towards the possibility that it's a bug now, since I found that the templates for fflonk and plonk are accurately checking against the scalar field size.

image
image

from snarkjs.

Stumble avatar Stumble commented on July 29, 2024

Although I think it is neither a security issue or causing any trouble on production, but still created a PR to fix it: #480

from snarkjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.