Code Monkey home page Code Monkey logo

itsuku's Introduction

This repository hosts an implementation of the Istuku proof-of-work scheme, as described in the following paper : https://eprint.iacr.org/2017/1168.pdf

Dependencies

pip3 install sortedcontainers

Tests

Install Pytest for python3

$ sudo apt-get install python3-pytest
$ pip3 install pytest

Then run the tests :

$ cd itsuku/
$ pytest
$ py.test-3

itsuku's People

Contributors

14alarro avatar baptistecolin avatar zx80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

itsuku's Issues

merkle_tree should be able to handle T != 2^n

So far, the merkle_tree function can only build a regular binary tree, made of 2*T-1 nodes, if the initial array X is of size 2^n.

This function (as well of the rest of the program, probably) should be amended so it can build a Merkle-tree out of an array X of arbitrary size

Stunning comments

Ideally, each function should be accompanied with some "documentation", that is to say comments that explain clearly what are the expected inputs and ouputs, what the function does, etc

H function is undeterministic

Looks like the H function in itsuku.py does not behave deterministically, which is not what we want ...

The following test fails :

sha = sha512()
sha_input = int_to_4bytes(123)
sha.update(sha_input)
assert sha.digest[:10] == H(10, sha_input)

The comparison in the assertion fails because the two string are totally different. Moreover, if you run the test again, you will see that the right-hand term in the assertion is never the same. Which is why I'm calling this "undeterministic". Meanwhile, the left-hand term remains the same frome one test to another, which is what is expected.

If you figure out what's wrong with our H function, please let us know !

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.