Browse Source

added zk-witness

plato 5 years ago
parent
commit
1895cc8665
1 changed files with 4 additions and 3 deletions
  1. 4 3
      lisp/examples/macro-test.lisp

+ 4 - 3
lisp/examples/macro-test.lisp

@@ -43,13 +43,14 @@
         ;; fetch the result of the function that is by design 
         ;; a list/vector so we use nth to get the element that 
         ;; is the hashmap defined inside zk-square with key v2
+        `(def! ~EDWARDS_D (alloc-const ~EDWARDS_D (scalar "2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1")))
         `(def! u2 (alloc ~u2 (get (nth (nth (zk-square ~val1) 0) 3) "v2")))
         `(def! v2 (alloc ~v2 (get (nth (nth (zk-square ~val2) 0) 3) "v2")))
-        `(alloc ~u2v2 (get (nth (nth (zk-mul u2 v2) 0) 3) "XXXX"))
+        `(alloc ~u2v2 (get (last (last (zk-mul u2 v2))) "result"))
         `(enforce  
             ((scalar::one::neg ~u2) (scalar::one ~v2))
-            (scalar::one ~v1) 
-            (scalar::one ~v2) 
+            (scalar::one cs::one) 
+            ((scalar::one cs::one) (~EDWARDS_D ~u2v2))
         )
         )
     ))