-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds a simplified version of Pedersen hash, following https://research.anoma.net/t/revised-zkvm-strategy/546/27 * Reformats the Juvix sources for the CI to pass
- Loading branch information
Showing
8 changed files
with
55 additions
and
40 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,28 @@ | ||
module Stdlib.Cairo.Pedersen; | ||
|
||
import Stdlib.Data.Field open using {Field}; | ||
import | ||
Stdlib.Cairo.Ec as Ec; | ||
|
||
module ConstantPoints; | ||
P0 : Ec.Point := | ||
Ec.mkPoint | ||
2089986280348253421170679821480865132823066470938446095505822317253594081284 | ||
1713931329540660377023406109199410414810705867260802078187082345529207694986; | ||
|
||
P1 : Ec.Point := | ||
Ec.mkPoint | ||
996781205833008774514500082376783249102396023663454813447423147977397232763 | ||
1668503676786377725805489344771023921079126552019160156920634619255970485781; | ||
|
||
P2 : Ec.Point := | ||
Ec.mkPoint | ||
2251563274489750535117886426533222435294046428347329203627021249169616184184 | ||
1798716007562728905295480679789526322175868328062420237419143593021674992973; | ||
end; | ||
|
||
pedersenHashToCurve (x y : Field) : Ec.Point := | ||
let | ||
open ConstantPoints; | ||
open Ec.Operators; | ||
in P0 + x * P1 + y * P2; |
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
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