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;