jubjub.lisp 958 B

12345678910111213141516171819
  1. (def! a_u "15a36d1f0f390d8852a35a8c1908dd87a361ee3fd48fdf77b9819dc82d90607e")
  2. (def! a_v "015d8c7f5b43fe33f7891142c001d9251f3abeeb98fad3e87b0dc53c4ebf1891")
  3. (def! b_u "15a36d1f0f390d8852a35a8c1908dd87a361ee3fd48fdf77b9819dc82d90607e")
  4. (def! b_v "015d8c7f5b43fe33f7891142c001d9251f3abeeb98fad3e87b0dc53c4ebf1891")
  5. (def! a "73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000")
  6. (def! d "2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1")
  7. (def! one "0000000000000000000000000000000000000000000000000000000000000001")
  8. (defzk! circuit ())
  9. (def! U (fn* [x1 y1 x2 y2] (+ (+ x1 y1) (+ x2 y2))))
  10. (def! jubjub-add (fn* [x1 y1 x2 y2] (zkcons! circuit (
  11. (add lc0 x1)
  12. (add lc0 y1)
  13. (add lc1 x2)
  14. (add lc1 y2)
  15. (add lc2 (U x1 y1 x2 y2))
  16. enforce
  17. ))))
  18. (println (jubjub-add a_u a_v b_u b_v))
  19. (println circuit)