|
@@ -2,11 +2,11 @@
|
|
|
(defzk! circuit ())
|
|
(defzk! circuit ())
|
|
|
(def! bits (unpack-bits x 256))
|
|
(def! bits (unpack-bits x 256))
|
|
|
;;zkcons add a constraints instruction to the circuit
|
|
;;zkcons add a constraints instruction to the circuit
|
|
|
- (map (fn* [b] (zkcons!
|
|
|
|
|
- (add 'lc0 'one)
|
|
|
|
|
- '(sub b)
|
|
|
|
|
- '(add lc1 x)
|
|
|
|
|
- 'enforce)
|
|
|
|
|
|
|
+ (map (fn* [b] (zkcons! circuit
|
|
|
|
|
+ (add lc0 one)
|
|
|
|
|
+ (sub lc0 b)
|
|
|
|
|
+ (add lc1 x)
|
|
|
|
|
+ enforce)
|
|
|
) bits)
|
|
) bits)
|
|
|
(map (fn* [b] (quote '(add lc0 b)
|
|
(map (fn* [b] (quote '(add lc0 b)
|
|
|
'double-coeff-lc)
|
|
'double-coeff-lc)
|