new.lisp 539 B

1234567891011121314151617
  1. (def! x "73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000")
  2. (defzk! circuit ())
  3. (def! bits (unpack-bits x 256))
  4. ;;zkcons add a constraints instruction to the circuit
  5. (map (fn* [b] (zkcons!
  6. (add 'lc0 'one)
  7. '(sub b)
  8. '(add lc1 x)
  9. 'enforce)
  10. ) bits)
  11. (map (fn* [b] (quote '(add lc0 b)
  12. 'double-coeff-lc)
  13. ) bits)
  14. (println 'reset-coeff-lc
  15. '(sub lc0 x)
  16. '(add lc1 one)
  17. 'enforce)