new.lisp 925 B

123456789101112131415161718192021222324252627
  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. (sub lc0 x)
  9. )
  10. )
  11. ;; (map (fn* [b] (zkcons! circuit (
  12. ;; (add lc0 one)
  13. ;; '(sub lc0 b)
  14. ;; '(add lc1 x)
  15. ;; 'enforce)
  16. ;; )) bits)
  17. ;; (map (fn* [b] (zkcons! circuit (
  18. ;; '(add lc0 b)
  19. ;; 'double-coeff-lc)
  20. ;; )) bits)
  21. ;; (zkcons! circuit (
  22. ;; 'reset-coeff-lc
  23. ;; '(sub lc0 x)
  24. ;; '(add lc1 one)
  25. ;; 'enforce)
  26. ;; )
  27. (println circuit)