|
@@ -38,21 +38,6 @@ enum AllocType {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
impl ZKVirtualMachine {
|
|
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)>) {
|
|
fn initialize(&mut self, params: &Vec<(VariableIndex, Scalar)>) {
|
|
|
// Resize array
|
|
// Resize array
|
|
|
self.aux = vec![Scalar::zero(); self.ops.len()];
|
|
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) {
|
|
fn setup(&mut self) {
|
|
|
let start = Instant::now();
|
|
let start = Instant::now();
|
|
|
// Create parameters for our circuit. In a production deployment these would
|
|
// Create parameters for our circuit. In a production deployment these would
|