GithubHelp home page GithubHelp logo

Comments (4)

abakst avatar abakst commented on August 25, 2024

This question may just be an artifact of our old hash_to_curve implementation. Let's return to this issue after #5 to see if we need to resolve it.

from mithril.

markulf avatar markulf commented on August 25, 2024

Is there a benefit from not using whatever cardano is using? Is cardano calling a rust or a C library? (libsodium)

Ideally hash functions should be easy to replace. Cautionary tale of MD5 being very hard to remove reliably from legacy software.

from mithril.

abakst avatar abakst commented on August 25, 2024

Indeed it is very easy to change the hash. It is only fixed by our implementation in two places (one for the dense mapping, one for hash_to_curve, so these choices are somewhat independent). We're also parameterized by the hashing strategy for the Merkle Tree (our tests use Sha3 but that can be changed easily as well).

We're actually only relying on Blake2b/Sha3 implementing traits from digest, so it should be straightforward to swap out another hash in msp::eval and hash_to_curve. If you'd like we can use something other than Blake2b, presumably most hashes would have a similar interface even if they do not implement these traits.

from mithril.

iquerejeta avatar iquerejeta commented on August 25, 2024

We used SHA because the Blake2b library we use does not support output lengths we need - error at runtime for length 300+.

could you give an example of where it breaks at runtime? I'm guessing that length 300+ is bits, right? not bytes? If I recall correctly, we don't need output lengths higher than 300 bytes, but I might be missing something. I made a PR #24 removing sha3, and it seems to work for now.

Blake2b is good for now. It is our default choice in Cardano

from mithril.

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.