Giter Site home page Giter Site logo

Comments (2)

str4d avatar str4d commented on August 22, 2024 1

For a Pedersen hash defined over a generic elliptic curve, I think something like this might be possible, though you would need to account for the windowed encoding mechanism (it might be sufficient to just bit-shift by 3 bits instead of 1, but I haven't thought about it much).

However, pedersen_hash is defined over Jubjub, which is a twisted Edwards curve with d being a non-square. This means that addition is complete, and so there is no point at infinity.

(cc @daira because I've likely mis-explained something 😅)

from librustzcash.

daira avatar daira commented on August 22, 2024

The Pedersen hash is defined in terms of the Edwards curve, which as @str4d says has no point at infinity. The zero point has an affine representation (0, 1).

The output of the hash is the u-coordinate of the resulting Edwards point. This is 0 for the zero point, which is a possible output. (If you actually find an input that gives this output, you can also find collisions in the hash. Pedersen hashes are not the only kind of hash for which this is the case; for example if you find an input to SHA-256 that results in a zero output then you can also find collisions in SHA-256, although for a different reason.)

In the circuit, the hash is implemented in terms of both the Edwards curve and the birationally equivalent Montgomery curve. The use of the latter is carefully limited to avoid occurrence of the point at infinity and other exceptional cases; this is explained and justified in appendix A.3.3.9 of the protocol spec.

from librustzcash.

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.