Giter VIP home page Giter VIP logo

Comments (5)

eigmax avatar eigmax commented on August 11, 2024

It's depends on how large the MDS is. you can check out this linearhash (https://github.com/0xPolygonHermez/pil-stark/blob/main/circuits.gl/linearhash.circom) to support arbitrary size of inputs.

from circomlibjs.

AndriianChestnykh avatar AndriianChestnykh commented on August 11, 2024

@eigmax, yes, it looks like the Poseidon itself depends on MDS constant values (so, the old contract generator couldn't even work properly with arbitrary input size, I guess).
Thanks for pointing out the LinearHash function. It may be of help as a workaround.

from circomlibjs.

ilya-korotya avatar ilya-korotya commented on August 11, 2024

Hi @eigmax. I have the same issue. I want to generate Ethereum Smart Contract that can support 16 inputs for Poseidon hash. Could I create a larger MDS that will support 16 inputs? I don't want to use any loops to manage 16 inputs (since loops are increasing gas consumption).
For example, golang implementation of Poseidon hash supports 16 inputs from the box.
https://github.com/iden3/go-iden3-crypto/blob/master/poseidon/poseidon_test.go#L14

from circomlibjs.

eigmax avatar eigmax commented on August 11, 2024

@ilya-korotya sure, use Cauchy matrix mentioned in Poseidon's paper, and check out how neptune generates here: https://github.com/filecoin-project/neptune/blob/master/src/mds.rs#L21

from circomlibjs.

ilya-korotya avatar ilya-korotya commented on August 11, 2024

@eigmax thanks a lot. It will be helpful.

from circomlibjs.

Related Issues (16)

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.