From 28ac40923cc21c96be6ff555c24fc2a942e7acd7 Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Wed, 11 Jan 2023 03:07:03 +0200 Subject: [PATCH] Fix typos --- changelogs/unreleased/1260-rex4539 | 1 + zokrates_analysis/src/struct_concretizer.rs | 2 +- zokrates_book/src/toolbox/abi.md | 2 +- zokrates_book/src/toolbox/trusted_setup.md | 10 +++++----- zokrates_cli/examples/book/numeric_inference.zok | 4 ++-- zokrates_codegen/src/lib.rs | 2 +- zokrates_core/src/semantics.rs | 4 ++-- zokrates_core_test/tests/tests/native_le.zok | 2 +- zokrates_interpreter/src/lib.rs | 2 +- zokrates_js/README.md | 2 +- 10 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 changelogs/unreleased/1260-rex4539 diff --git a/changelogs/unreleased/1260-rex4539 b/changelogs/unreleased/1260-rex4539 new file mode 100644 index 00000000..d0c02778 --- /dev/null +++ b/changelogs/unreleased/1260-rex4539 @@ -0,0 +1 @@ +Fix typos \ No newline at end of file diff --git a/zokrates_analysis/src/struct_concretizer.rs b/zokrates_analysis/src/struct_concretizer.rs index 102cb4d8..932a9267 100644 --- a/zokrates_analysis/src/struct_concretizer.rs +++ b/zokrates_analysis/src/struct_concretizer.rs @@ -1,5 +1,5 @@ // After all generics are inlined, a program should be completely "concrete", which means that all types must only contain -// litterals for array sizes. This is especially important to generate the ABI of the program. +// literals for array sizes. This is especially important to generate the ABI of the program. // It is direct to ensure that with most types, however the way structs are implemented requires a slightly different process: // Where for an array, `field[N]` ends up being propagated to `field[42]` which is direct to turn into a concrete type, // for structs, `Foo { field[N] a }` is propagated to `Foo<42> { field[N] a }`. The missing step is replacing `N` by `42` diff --git a/zokrates_book/src/toolbox/abi.md b/zokrates_book/src/toolbox/abi.md index caaa0c3b..15fd5503 100644 --- a/zokrates_book/src/toolbox/abi.md +++ b/zokrates_book/src/toolbox/abi.md @@ -1,6 +1,6 @@ # ZoKrates ABI -In order to interact programatically with compiled ZoKrates programs, ZoKrates supports passing arguments using an ABI. +In order to interact programmatically with compiled ZoKrates programs, ZoKrates supports passing arguments using an ABI. To illustrate this, we'll use the following example program: diff --git a/zokrates_book/src/toolbox/trusted_setup.md b/zokrates_book/src/toolbox/trusted_setup.md index aa05b4f0..bb643e0e 100644 --- a/zokrates_book/src/toolbox/trusted_setup.md +++ b/zokrates_book/src/toolbox/trusted_setup.md @@ -1,6 +1,6 @@ # Performing a trusted setup using a multi-party computation protocol (MPC) -The zk-SNARK schemes supported by ZoKrates require a trusted setup. This procedure must be run to generate the proving and verification keys. This procedure generates some data often refered to as "toxic waste" which can be used to create fake proofs which will be accepted by the verifier. The entity running the trusted setup is trusted to delete this toxic waste. +The zk-SNARK schemes supported by ZoKrates require a trusted setup. This procedure must be run to generate the proving and verification keys. This procedure generates some data often referred to as "toxic waste" which can be used to create fake proofs which will be accepted by the verifier. The entity running the trusted setup is trusted to delete this toxic waste. Using an MPC protocol, we can run the trusted setup in a decentralized way, so that this responsibility is shared among all participants of the setup. If at least one participant is honest and deletes their part of the toxic waste, then no fake proofs can be created by anyone. This section of the book describes the steps to perform a trusted setup for the Groth16 scheme. @@ -35,7 +35,7 @@ Parameters written to `mpc.params` ``` Using the `-r` flag, we pass a path to the file which contains the parameters for our circuit with depth `2^n` (`phase1radix2m{n}`). -The parameters for various circuit depths can be computed using the [phase2-bn254](https://github.com/kobigurk/phase2-bn254) utility +The parameters for various circuit depths can be computed using the [phase2-bn254](https://github.com/kobigurk/phase2-bn254) utility by picking the latest response from the [Perpetual Powers of Tau](https://github.com/weijiekoh/perpetualpowersoftau) and following the instructions in the mentioned repositories. ## Making a contribution @@ -126,9 +126,9 @@ Your contribution has been written to `final.params` ``` The random beacon is the `2^n` iteration of `SHA256` over the hash evaluated on -some high entropy and publicly available data. Possible sources of data could be: +some high entropy and publicly available data. Possible sources of data could be: * The closing value of the stock market on a certain date -* The output of a selected set of national lotteries +* The output of a selected set of national lotteries * The value of a block at a particular height in one or more blockchains * [League of Entropy](https://www.cloudflare.com/leagueofentropy/) (drand) @@ -163,5 +163,5 @@ Once the ceremony is finalized, we can export the keys and use them to generate The secure generation of parameters for zk-SNARKs is a crucial step in the trustworthiness of the resulting proof system. The security of the ceremony relies entirely on the fact that at least one participant needs to securely delete their "toxic waste" for the resulting parameters to be generated honestly. Opening the ceremony to a large number of participants reduces the probability that the resulting parameters are dishonest. -Once the ceremony is finalized, we can generate a verifier smart contract by using the keys we obtained through the trusted setup ceremony. +Once the ceremony is finalized, we can generate a verifier smart contract by using the keys we obtained through the trusted setup ceremony. At this point, we can safely deploy the contract and verify proofs on-chain. diff --git a/zokrates_cli/examples/book/numeric_inference.zok b/zokrates_cli/examples/book/numeric_inference.zok index f8106431..b3446b51 100644 --- a/zokrates_cli/examples/book/numeric_inference.zok +++ b/zokrates_cli/examples/book/numeric_inference.zok @@ -1,8 +1,8 @@ def main() { - // `255` is infered to `255f`, and the addition happens between field elements + // `255` is inferred to `255f`, and the addition happens between field elements assert(255 + 1f == 256); - // `255` is infered to `255u8`, and the addition happens between u8 + // `255` is inferred to `255u8`, and the addition happens between u8 // This causes an overflow assert(255 + 1u8 == 0); diff --git a/zokrates_codegen/src/lib.rs b/zokrates_codegen/src/lib.rs index cf4e8cbb..e149a968 100644 --- a/zokrates_codegen/src/lib.rs +++ b/zokrates_codegen/src/lib.rs @@ -259,7 +259,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { /// As long as `sizeUnknown` is `true` we don't yet know if a is <= than b. /// 2. Loop over `b`: /// * b[0] = 1 - /// when `b` is 1 we check wether `a` is 0 in that particular run and update + /// when `b` is 1 we check whether `a` is 0 in that particular run and update /// `sizeUnknown` accordingly: /// `sizeUnknown = sizeUnknown && a[0]` /// * b[1] = 1 diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index ad584e71..a4f7bb0c 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -988,7 +988,7 @@ impl<'ast, T: Field> Checker<'ast, T> { _ => unreachable!(), }; - // return if any errors occured + // return if any errors occurred if !errors.is_empty() { return Err(errors); } @@ -1035,7 +1035,7 @@ impl<'ast, T: Field> Checker<'ast, T> { // insert into typed_modules if we checked anything if let Some(typed_module) = to_insert { - // there should be no checked module at that key just yet, if there is we have a colision or we checked something twice + // there should be no checked module at that key just yet, if there is we have a collision or we checked something twice assert!(state .typed_modules .insert(module_id.to_path_buf(), typed_module) diff --git a/zokrates_core_test/tests/tests/native_le.zok b/zokrates_core_test/tests/tests/native_le.zok index 74d51a19..1a70dbe0 100644 --- a/zokrates_core_test/tests/tests/native_le.zok +++ b/zokrates_core_test/tests/tests/native_le.zok @@ -27,7 +27,7 @@ def le(field a, field c) -> bool { return le(a_bits, c_bits); } -// this instanciates comparison starting from u32 +// this instantiates comparison starting from u32 def le(u32 a, u32 c) -> bool { bool[32] a_bits = u32_to_bits(a); bool[32] c_bits = u32_to_bits(c); diff --git a/zokrates_interpreter/src/lib.rs b/zokrates_interpreter/src/lib.rs index f33ab3de..9f90e00c 100644 --- a/zokrates_interpreter/src/lib.rs +++ b/zokrates_interpreter/src/lib.rs @@ -13,7 +13,7 @@ pub type ExecutionResult = Result, Error>; #[derive(Default)] pub struct Interpreter { /// Whether we should try to give out-of-range bit decompositions when the input is not a single summand. - /// Used to do targetted testing of `<` flattening, making sure the bit decomposition we base the result on is unique. + /// Used to do targeted testing of `<` flattening, making sure the bit decomposition we base the result on is unique. should_try_out_of_range: bool, } diff --git a/zokrates_js/README.md b/zokrates_js/README.md index 8fbbd000..21911e6c 100644 --- a/zokrates_js/README.md +++ b/zokrates_js/README.md @@ -6,4 +6,4 @@ JavaScript bindings for [ZoKrates](https://github.com/Zokrates/ZoKrates) project npm install zokrates-js ``` -Check the offical [ZoKrates documentation](https://zokrates.github.io/toolbox/zokrates_js.html) for more details. +Check the official [ZoKrates documentation](https://zokrates.github.io/toolbox/zokrates_js.html) for more details.