Merge branch 'develop' of github.com:Zokrates/ZoKrates into for-loop-doc
This commit is contained in:
commit
454d4b9ab3
3 changed files with 5 additions and 5 deletions
|
@ -21,7 +21,7 @@ curl -LSfs get.zokrat.es | sh
|
|||
```
|
||||
|
||||
Have a look at the [documentation](https://zokrates.github.io/) for more information about using ZoKrates.
|
||||
[Get started](https://zokrates.github.io/gettingstarted.html), then try a [tutorial](https://zokrates.github.io/rng_tutorial.html)!
|
||||
[Get started](https://zokrates.github.io/gettingstarted.html), then try a [tutorial](https://zokrates.github.io/examples/rng_tutorial.html)!
|
||||
|
||||
## Getting Help
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ There are many ways to calculate a hash, but here we use Zokrates.
|
|||
|
||||
1. Create this file under the name `get_hash.zok`:
|
||||
```zokrates
|
||||
{{#include ../../zokrates_cli/examples/book/rng_tutorial/get_hash.zok}}
|
||||
{{#include ../../../zokrates_cli/examples/book/rng_tutorial/get_hash.zok}}
|
||||
```
|
||||
2. Compile the program to a form that is usable for zero knowledge proofs. This command writes
|
||||
the binary to `get_hash`. You can see a textual representation, somewhat analogous to assembler
|
||||
|
@ -99,7 +99,7 @@ The next step is to reveal a single bit.
|
|||
|
||||
1. Use this program, `reveal_bit.zok`:
|
||||
```zokrates
|
||||
{{#include ../../zokrates_cli/examples/book/rng_tutorial/reveal_bit.zok}}
|
||||
{{#include ../../../zokrates_cli/examples/book/rng_tutorial/reveal_bit.zok}}
|
||||
```
|
||||
|
||||
2. Compile and run as you did the previous program:
|
||||
|
|
|
@ -16,7 +16,7 @@ We will start this tutorial by using ZoKrates to compute the hash for an arbitra
|
|||
First, we create a new file named `hashexample.zok` with the following content:
|
||||
|
||||
```zokrates
|
||||
{{#include ../../zokrates_cli/examples/book/hashexample.zok}}
|
||||
{{#include ../../../zokrates_cli/examples/book/hashexample.zok}}
|
||||
```
|
||||
|
||||
The first line imports the `sha256packed` function from the ZoKrates standard library.
|
||||
|
@ -70,7 +70,7 @@ To make it work, the two parties have to follow their roles in the protocol:
|
|||
First, Victor has to specify what hash he is interested in. Therefore, we have to adjust the zkSNARK circuit, compiled by ZoKrates, such that in addition to computing the digest, it also validates it against the digest of interest, provided by Victor. This leads to the following update for `hashexample.zok`:
|
||||
|
||||
```zokrates
|
||||
{{#include ../../zokrates_cli/examples/book/hashexample_updated.zok}}
|
||||
{{#include ../../../zokrates_cli/examples/book/hashexample_updated.zok}}
|
||||
```
|
||||
|
||||
Note that we now compare the result of `sha256packed` with the hard-coded correct solution defined by Victor. The lines which we added are treated as assertions: the verifier will not accept a proof where these constraints were not satisfied. Clearly, this program only returns 1 if all of the computed bits are equal.
|
||||
|
|
Loading…
Reference in a new issue