-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a80532
commit fca98dd
Showing
10 changed files
with
119 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from "EMBED" import sample_challenge | ||
|
||
def main(private field[4] f, private field[4] g, private field[7] h) -> field: | ||
field x = sample_challenge([...f, ...g, ...h]) | ||
field[7] xpows = [1; 7] | ||
for field i in 0..6 do | ||
xpows[i+1] = xpows[i] * x | ||
endfor | ||
field fx = 0 | ||
field gx = 0 | ||
field hx = 0 | ||
for field i in 0..4 do | ||
fx = fx + xpows[i] * f[i] | ||
gx = gx + xpows[i] * g[i] | ||
endfor | ||
for field i in 0..7 do | ||
hx = hx + xpows[i] * h[i] | ||
endfor | ||
assert(fx * gx == hx) | ||
return f[0] | ||
|
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,20 @@ | ||
(set_default_modulus 52435875175126190479447740508185965837690552500527637822603658699938581184513 | ||
(let ( | ||
(f.0 #f1) | ||
(f.1 #f1) | ||
(f.2 #f1) | ||
(f.3 #f1) | ||
(g.0 #f1) | ||
(g.1 #f1) | ||
(g.2 #f1) | ||
(g.3 #f1) | ||
(h.0 #f1) | ||
(h.1 #f2) | ||
(h.2 #f3) | ||
(h.3 #f4) | ||
(h.4 #f3) | ||
(h.5 #f2) | ||
(h.6 #f1) | ||
) false ; ignored | ||
)) | ||
|
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,5 @@ | ||
(set_default_modulus 52435875175126190479447740508185965837690552500527637822603658699938581184513 | ||
(let ( | ||
(return #f1) | ||
) false ; ignored | ||
)) |
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 @@ | ||
from "EMBED" import sample_challenge | ||
|
||
def main(private field x, private field y) -> field: | ||
field a = sample_challenge([x, y]) | ||
assert(a * x == a * y) | ||
return 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,6 @@ | ||
(set_default_modulus 52435875175126190479447740508185965837690552500527637822603658699938581184513 | ||
(let ( | ||
(x #f7) | ||
(y #f7) | ||
) false ; ignored | ||
)) |
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 @@ | ||
(set_default_modulus 52435875175126190479447740508185965837690552500527637822603658699938581184513 | ||
(let ( | ||
(return #f7) | ||
) false ; ignored | ||
)) | ||
|
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
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