Skip to content

Commit

Permalink
Merge branch 'master' into gd/issue_6946
Browse files Browse the repository at this point in the history
  • Loading branch information
guipublic authored Jan 20, 2025
2 parents 6f23a8c + 6e176d2 commit b273687
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
3 changes: 2 additions & 1 deletion docs/docs/getting_started/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ We can now use `nargo` to generate a _Prover.toml_ file, where our input values
```sh
cd hello_world
nargo check
```

Let's feed some valid values into this file:

Expand Down Expand Up @@ -113,7 +114,7 @@ bb verify -k ./target/vk -p ./target/proof

Notice that in order to verify a proof, the verifier knows nothing but the circuit, which is compiled and used to generate the verification key. This is obviously quite important: private inputs remain private.

As for the public inputs, you may have noticed they haven't been specified. This behavior varies with each particular backend, but barretenberg typically attaches them to the proof. You can see them by parsing and splitting it. For example for if your public inputs are 32 bytes:
As for the public inputs, you may have noticed they haven't been specified. This behavior varies with each particular backend, but barretenberg typically attaches them to the proof. You can see them by parsing and splitting it. For example if your public inputs are 32 bytes:

```bash
head -c 32 ./target/proof | od -An -v -t x1 | tr -d $' \n'
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/noir/concepts/data_types/slices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ View the corresponding test file [here][test-file].

### push_front

Returns a new array with the specified element inserted at index 0. The existing elements indexes are incremented by 1.
Returns a new slice with the specified element inserted at index 0. The existing elements indexes are incremented by 1.

```rust
fn push_front(_self: Self, _elem: T) -> Self
Expand All @@ -75,7 +75,7 @@ View the corresponding test file [here][test-file].

### pop_front

Returns a tuple of two items, the first element of the array and the rest of the array.
Returns a tuple of two items, the first element of the slice and the rest of the slice.

```rust
fn pop_front(_self: Self) -> (T, Self)
Expand All @@ -91,7 +91,7 @@ View the corresponding test file [here][test-file].

### pop_back

Returns a tuple of two items, the beginning of the array with the last element omitted and the last element.
Returns a tuple of two items, the beginning of the slice with the last element omitted and the last element.

```rust
fn pop_back(_self: Self) -> (Self, T)
Expand Down
17 changes: 14 additions & 3 deletions docs/docs/noir/concepts/generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ impl<let N: u32> BigInt<N> {
fn first(first: BigInt<N>, second: BigInt<N>) -> Self {
assert(first.limbs != second.limbs);
first
}

fn second(first: BigInt<N>, second: Self) -> Self {
assert(first.limbs != second.limbs);
Expand Down Expand Up @@ -96,7 +97,17 @@ fn main() {
// We can use first_element_is_equal for arrays of any type
// as long as we have an Eq impl for the types we pass in
let array = [MyStruct::new(), MyStruct::new()];
assert(array_eq(array, array, MyStruct::eq));
assert(first_element_is_equal(array, array));
}

struct MyStruct {
foo: Field
}

impl MyStruct {
fn new() -> Self {
MyStruct { foo: 0 }
}
}

impl Eq for MyStruct {
Expand Down Expand Up @@ -152,9 +163,9 @@ fn example() {
// there is no matching impl for `u32: MyTrait`.
//
// Substituting the `10` on the left hand side of this assert
// with `10 as u32` would also fail with a type mismatch as we
// with `10 as u32` would fail with a type mismatch as we
// are expecting a `Field` from the right hand side.
assert(10 as u32 == foo.generic_method::<Field>());
assert(10 == foo.generic_method::<Field>());
}
```

Expand Down

0 comments on commit b273687

Please sign in to comment.