0

im trying to follow this tutorial - https://zokrates.github.io/sha256example.html

I built zokrates docker provided and copied the source code to the docker, and then tried to compile the code.

here is the code:

import "LIBSNARK/sha256packed"
def main(private field a, private field b, private field c, private field d) -> (field[2]):
h = sha256packed([a,b,c,d])
    return h

However, i faced following error messages:

Compilation failed: Semantic error: Function definition for function sha256packed with signature (field[4]) -> (_) not found.

what is wrong with this work?

1 Answer 1

0

This is probably an old answer by now, but I believe you were looking at an outdated version of the blog. ZoKrates have modified the SHA256 gadget, and the import now looks liek this:

import "hashes/sha256/512bitPacked.code" as sha256packed

The function signature also is a bit different now that what it was, but your code already seems to conform to the current version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.