new.lisp 893 B

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