Coder Social home page Coder Social logo

pysnark's People

Contributors

meilof 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pysnark's Issues

Multiplication gates, and proof generation time

Hi
I'm working academic paper and I have written a prototype that utilizes Pysnark. I would like to ask if it is possible to determine some values such as the number of multiplication gates, and proof generation time

Questions about If/Else and Parallelization

Hi,

I have a program of the following structre:

Input ciphertext y, Witness: secret key

  1. Decrypt y using the secret key, obtaining x
  2. If x has some property output 1
  3. Output 0

My questions are:

  • How is it possible to realize the if/else clause?
  • Assuming that I have multiple ciphertexts as input, it is possible to run the decryptions in parallel for efficiency?

Error is printed but not returned

I used the new version and tested again the case that I mentioned in my first comment. now during verification this is printed :
"Reading QAP vk: pysnark_vk_main
Verifying main (pysnark_vk_main) *** divisibility check failed
1"
isn't it supposed to print 0 (false) when the prover has executed a different code and as a result ,provided wrong proof and value?
why it is still printing 1(true)?

Originally posted by @Mahsa-Bastankhah in #4 (comment)

wrong proof is verified correctly!!

I follow "readme" and as a prover I changed the cube.py to calculate the 2*cube(in) to check if the verifier can recognize the inconsistency between third party code and prover cod.but surprisingly the verifier verified it correctly.what is the problem here?? prover can run a code diffrent from the code that third party provided and at the same time convince the verifier that he/she has done the right calculation.

Runtime Error in Cube.py

Hi,
I have been trying to run the first example cube.py, but I got this error

python cube.py 3

**Traceback (most recent call last):
File "cube.py", line 40, in
inv = Var(int(sys.argv[1]), "in")
File "/usr/local/lib/python2.7/dist-packages/pysnark/runtime.py", line 93, in inited_
return fn(*args, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pysnark/runtime.py", line 319, in init
vc_ctr[vc_ctx] += 1
KeyError: None

Cryptic error during trusted party verification

Similar to the previous issue, I wish to try out proof of ownership of hash preimage.
For starters, I wrote a mock hash function:

def mock_hash(x):
    n_it = Var(100, True)
    _zero = Var(0, True)
    _one = Var(1, True)
    _, x = x.divmod(97, 32)

    p = Var(1, "True")
    while True:
        if n_it.equals(_zero).value == 1:
            break

        n_it -= _one

        p *= x
        _, p = p.divmod(97, 32)

    return p

I was not sure how for loops work when using runtime vars, so I used the while True.

The main is:

hx = Var(int(sys.argv[1]), "in")
x = Var(int(sys.argv[2]), "True")

out = Var(0, "True")
if hx.equals(mock_hash(x)).value == 1:
    out = Var(1, "True")

print out.val("out")

The script compiles and runs fine, but during verification at first run (trusted party) I get:

Verifying main (pysnark_vk_main) *** divisibility check failed

followed, somewhat confusingly, by:

1
Verification succeeded

What is this error about? How can I fix this?

comparing isn't supported

hi.
I tried to compare two integer and report the maximum and then prove to the verifier that the value I'm reporting is maximum of two integers.but I figured out that Var variables don't support comparing.in another word following code does't print True when a = 10 and b = 5
a = int(input())
b = int(input())
x = Var(a,"in1")
y = Var(b,"in2")
print x > y

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.