Coder Social home page Coder Social logo

r1cs-tutorial's People

Contributors

aayux avatar mikerah avatar mimoo avatar nukemandan avatar pmikolajczyk41 avatar pratyush avatar valardragon avatar weikengchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

r1cs-tutorial's Issues

Pedersen Hash Improper Configuration

Summary of Bug

Pedersen Hash Improper Configuration

Version

This tutorial's configuration of pedersen hash window
(https://github.com/arkworks-rs/r1cs-tutorial/blob/main/merkle_tree_example/src/common.rs#L18):

pub type TwoToOneHash = PedersenCRHCompressor<EdwardsProjective, TECompressor, TwoToOneWindow>;
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct TwoToOneWindow;

// `WINDOW_SIZE * NUM_WINDOWS` = 2 * 256 bits = enough for hashing two outputs.
impl pedersen::Window for TwoToOneWindow {
    const WINDOW_SIZE: usize = 128;
    const NUM_WINDOWS: usize = 4;
}

pub type LeafHash = PedersenCRHCompressor<EdwardsProjective, TECompressor, LeafWindow>;

#[derive(Clone, PartialEq, Eq, Hash)]
pub struct LeafWindow;

// `WINDOW_SIZE * NUM_WINDOWS` = 2 * 256 bits = enough for hashing two outputs.
impl pedersen::Window for LeafWindow {
    const WINDOW_SIZE: usize = 144;
    const NUM_WINDOWS: usize = 4;
}

Which configure the window_size to N, and the num_windows to 4. This is not consistent with the arkworks test:
(https://github.com/arkworks-rs/crypto-primitives/blob/main/src/merkle_tree/mod.rs#L463).

From my understanding, this will introduce a potential security vulnerability.

Happy to create a PR if this is confirmed by arkworks devs.

Steps to Reproduce

The compilation gets broken

The whole project cannot be compiled, due to ark-crypto-primitives is always going to pull the latest commit from github.
But it compiled while I used specified commit

Platform:
rust: 1.52.1
os: ubuntu 20.04

Perhaps that Cargo.lock file can avoid this situation.

Where can i ask question?

image
In Merkle tree example, the error shows the 'leaf_bytes' didn't implement 'ToBytesGadget'. But the 'leaf_bytes' is the default value. So how can I deal with it?

README for part #1 of the R1CS Tutorial is misguiding

โˆ‚

Summary of Bug

The README for the merkle tree example in the R1CS tutorial incorrectly states that it will show how to invoke a SNARK when actually the example is only about generating the constraints and verifying satisfiability directly using the witness input itself. This is confusing for beginners trying to learn arkworks.

Version

commit 5d3a902

Steps to Reproduce

Compare the README to the example code.

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.