Procházet zdrojové kódy

move public function down

narodnik před 5 roky
rodič
revize
5aafeeea6c
1 změnil soubory, kde provedl 15 přidání a 15 odebrání
  1. 15 15
      src/vm.rs

+ 15 - 15
src/vm.rs

@@ -38,21 +38,6 @@ enum AllocType {
 }
 
 impl ZKVirtualMachine {
-    fn public(&self) -> Vec<Scalar> {
-        let mut publics = Vec::new();
-        for (alloc_type, index) in &self.alloc {
-            match alloc_type {
-                AllocType::Private => {
-                }
-                AllocType::Public => {
-                    let scalar = self.aux[*index].clone();
-                    publics.push(scalar);
-                }
-            }
-        }
-        publics
-    }
-
     fn initialize(&mut self, params: &Vec<(VariableIndex, Scalar)>) {
         // Resize array
         self.aux = vec![Scalar::zero(); self.ops.len()];
@@ -75,6 +60,21 @@ impl ZKVirtualMachine {
         }
     }
 
+    fn public(&self) -> Vec<Scalar> {
+        let mut publics = Vec::new();
+        for (alloc_type, index) in &self.alloc {
+            match alloc_type {
+                AllocType::Private => {
+                }
+                AllocType::Public => {
+                    let scalar = self.aux[*index].clone();
+                    publics.push(scalar);
+                }
+            }
+        }
+        publics
+    }
+
     fn setup(&mut self) {
         let start = Instant::now();
         // Create parameters for our circuit. In a production deployment these would