From 20f4a47fd0fe5c5e5dae5b5842799bd21478aa0c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 20 May 2021 19:22:17 +0100 Subject: [PATCH] Update documentation too --- zokrates_book/src/rng_tutorial.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zokrates_book/src/rng_tutorial.md b/zokrates_book/src/rng_tutorial.md index 0fb56be6..247b1acf 100644 --- a/zokrates_book/src/rng_tutorial.md +++ b/zokrates_book/src/rng_tutorial.md @@ -133,7 +133,7 @@ A Zokrates function can return multiple values. In this case, it returns the has value of the bit being revealed. ```javascript -def main(private u32[16] preimage, field bitNum) -> (u32[8], bool): +def main(private u32[16] preimage, u32 bitNum) -> (u32[8], bool): ```   @@ -152,10 +152,10 @@ when it is declared.   This is a [for loop](https://zokrates.github.io/language/control_flow.html#for-loops). For loops -have to have an index of type `field`, and their bounds need to be known at compile time. +have to have an index of type `u32`, and their bounds need to be known at compile time. In this case, we go over each of the sixteen 32 bit words. ```javascript - for field i in 0..16 do + for u32 i in 0..16 do ``` The function we imported, `u32_to_bits`, converts a `u32` value to an array of bits. @@ -169,7 +169,7 @@ The function we imported, `u32_to_bits`, converts a `u32` value to an array of b The inner loop copies the bits from `val` to `preimageBits`, the bit array for the preimage. ```javascript - for field bit in 0..32 do + for u32 bit in 0..32 do preimageBits[i*32+bit] = val[bit] endfor endfor