1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00

fix links in book

This commit is contained in:
schaeff 2021-06-23 12:54:26 +02:00
parent bf948dbc24
commit 21f3775de4
2 changed files with 4 additions and 4 deletions

View file

@ -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:

View file

@ -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.