anoma / juvix-stdlib

The Juvix standard library
https://anoma.github.io/juvix-stdlib/
9 stars 1 forks source link

Add full Cairo pedersen hash #100

Open CarloModicaPortfolio opened 1 month ago

CarloModicaPortfolio commented 1 month ago

Pedersen hash to curve can be found here: https://docs.starkware.co/starkex/crypto/pedersen-hash-function.html

-- pedersen_hash_to_curve : (x y: Field) : Ec.Point := -- Init the five constant points P0, P1, P2, P3, P4 -- Split x and y to (x_low, x_high) and (y_low, y_high) -- H(x, y) = P0 + x_low P1 + x_high P2 + y_low P3 + y_high P4

lukaszcz commented 1 month ago

The simplified version is already in main: https://github.com/anoma/juvix-stdlib/blob/main/Stdlib/Cairo/Pedersen.juvix. Check if you have the latest version of Juvix (and do git submodule update and juvix clean --global before installing the new one).