-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pedersen hash for Noir * Fix strings in generated toml files
- Loading branch information
1 parent
4aff561
commit c4fe044
Showing
24 changed files
with
157 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
|
||
[package] | ||
name = fib_1 | ||
type = bin | ||
authors = [] | ||
compiler_version = 0.10.3 | ||
name = "fib_1" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
fn main(a_start: Field, b_start: Field) -> pub Field { | ||
let mut a = a_start; | ||
let mut b = b_start; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
|
||
[package] | ||
name = fib_10 | ||
type = bin | ||
authors = [] | ||
compiler_version = 0.10.3 | ||
name = "fib_10" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
fn main(a_start: Field, b_start: Field) -> pub Field { | ||
let mut a = a_start; | ||
let mut b = b_start; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
|
||
[package] | ||
name = fib_100 | ||
type = bin | ||
authors = [] | ||
compiler_version = 0.10.3 | ||
name = "fib_100" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
fn main(a_start: Field, b_start: Field) -> pub Field { | ||
let mut a = a_start; | ||
let mut b = b_start; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
|
||
[package] | ||
name = fib_1000 | ||
type = bin | ||
authors = [] | ||
compiler_version = 0.10.3 | ||
name = "fib_1000" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
fn main(a_start: Field, b_start: Field) -> pub Field { | ||
let mut a = a_start; | ||
let mut b = b_start; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
|
||
[package] | ||
name = fib_10000 | ||
type = bin | ||
authors = [] | ||
compiler_version = 0.10.3 | ||
name = "fib_10000" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
fn main(a_start: Field, b_start: Field) -> pub Field { | ||
let mut a = a_start; | ||
let mut b = b_start; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
|
||
[package] | ||
name = fib_100000 | ||
type = bin | ||
authors = [] | ||
compiler_version = 0.10.3 | ||
name = "fib_100000" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
fn main(a_start: Field, b_start: Field) -> pub Field { | ||
let mut a = a_start; | ||
let mut b = b_start; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
|
||
[package] | ||
name = fib_1000000 | ||
type = bin | ||
authors = [] | ||
compiler_version = 0.10.3 | ||
name = "fib_1000000" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
fn main(a_start: Field, b_start: Field) -> pub Field { | ||
let mut a = a_start; | ||
let mut b = b_start; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "pedersen_3226" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
use dep::std; | ||
|
||
fn main(x: [Field; 3226]) -> pub [Field; 2] { | ||
std::hash::pedersen(x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "pedersen_323" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
use dep::std; | ||
|
||
fn main(x: [Field; 323]) -> pub [Field; 2] { | ||
std::hash::pedersen(x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "pedersen_33" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
use dep::std; | ||
|
||
fn main(x: [Field; 33]) -> pub [Field; 2] { | ||
std::hash::pedersen(x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
field_bits=254 | ||
|
||
function generate() { | ||
n_bytes="$1" | ||
n_fields="$(python3 -c "import math; print(math.ceil($n_bytes / math.floor($field_bits / 8)))")" | ||
n="$n_fields" | ||
|
||
code=" | ||
use dep::std; | ||
fn main(x: [Field; $n]) -> pub [Field; 2] { | ||
std::hash::pedersen(x) | ||
}" | ||
toml=$(cat <<EOF | ||
[package] | ||
name = "pedersen_$n" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = "0.10.3" | ||
[dependencies] | ||
EOF | ||
) | ||
|
||
mkdir -p "$n/src" | ||
echo "$code" > "$n/src/main.nr" | ||
echo "$toml" > "$n/Nargo.toml" | ||
} | ||
|
||
generate 1000 | ||
generate 10000 | ||
generate 100000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters