From 8ff4ddafb25c8a16d47e0c8c4095268ad43638eb Mon Sep 17 00:00:00 2001 From: collin Date: Mon, 15 Jun 2020 11:11:35 -0700 Subject: [PATCH 1/3] remove CS trait from program struct --- Cargo.lock | 98 ++++++++++++++++++++------ compiler/src/constraints/boolean.rs | 10 +-- compiler/src/constraints/expression.rs | 34 ++++----- compiler/src/constraints/function.rs | 18 +++-- compiler/src/constraints/import.rs | 9 ++- compiler/src/constraints/mod.rs | 2 +- compiler/src/constraints/program.rs | 13 ++-- compiler/src/constraints/statement.rs | 22 +++--- tmp/.gitignore | 2 + tmp/Leo.toml | 3 + tmp/inputs/inputs.leo | 1 + tmp/src/main.leo | 9 +++ 12 files changed, 149 insertions(+), 72 deletions(-) create mode 100644 tmp/.gitignore create mode 100644 tmp/Leo.toml create mode 100644 tmp/inputs/inputs.leo create mode 100644 tmp/src/main.leo diff --git a/Cargo.lock b/Cargo.lock index d769545adc..852e04d60f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,7 +105,7 @@ checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" dependencies = [ "byte-tools", "crypto-mac", - "digest", + "digest 0.8.1", "opaque-debug", ] @@ -118,7 +118,19 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "block-buffer" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcf92448676f82bb7a334c58bbce8b0d43580fb5362a9d608b18879d12a3d31" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.14.2", ] [[package]] @@ -265,7 +277,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" dependencies = [ - "generic-array", + "generic-array 0.12.3", "subtle", ] @@ -316,7 +328,16 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.2", ] [[package]] @@ -407,6 +428,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac746a5f3bbfdadd6106868134545e684693d54d9d44f6e9588a7d54af0bf980" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getopts" version = "0.2.21" @@ -553,7 +584,7 @@ dependencies = [ "leo-types", "log", "rand", - "sha2", + "sha2 0.8.1", "snarkos-curves", "snarkos-errors", "snarkos-gadgets", @@ -971,18 +1002,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.104" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +checksum = "736aac72d1eafe8e5962d1d1c3d99b0df526015ba40915cb3c49d042e92ec243" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.104" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +checksum = "bf0343ce212ac0d3d6afd9391ac8e9c9efe06b533c8d33f660f6390cc4093f57" dependencies = [ "proc-macro2 1.0.9", "quote 1.0.3", @@ -1006,8 +1037,8 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", "fake-simd", "opaque-debug", ] @@ -1018,8 +1049,20 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72377440080fd008550fe9b441e854e43318db116f90181eef92e9ae9aedab48" +dependencies = [ + "block-buffer 0.8.0", + "digest 0.9.0", "fake-simd", "opaque-debug", ] @@ -1051,11 +1094,11 @@ version = "0.8.0" dependencies = [ "blake2", "derivative", - "digest", + "digest 0.8.1", "rand", "rand_chacha", "rayon", - "sha2", + "sha2 0.9.0", "smallvec", "snarkos-errors", "snarkos-models", @@ -1069,11 +1112,22 @@ version = "0.8.0" dependencies = [ "derivative", "rand", + "rand_xorshift", + "serde", "snarkos-errors", "snarkos-models", "snarkos-utilities", ] +[[package]] +name = "snarkos-derives" +version = "0.1.0" +dependencies = [ + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", +] + [[package]] name = "snarkos-errors" version = "0.8.0" @@ -1091,7 +1145,7 @@ name = "snarkos-gadgets" version = "0.8.0" dependencies = [ "derivative", - "digest", + "digest 0.8.1", "snarkos-algorithms", "snarkos-curves", "snarkos-errors", @@ -1103,9 +1157,11 @@ dependencies = [ name = "snarkos-models" version = "0.8.0" dependencies = [ + "bincode", "derivative", "rand", "rand_xorshift", + "serde", "smallvec", "snarkos-errors", "snarkos-utilities", @@ -1120,6 +1176,8 @@ name = "snarkos-utilities" version = "0.8.0" dependencies = [ "rand", + "snarkos-derives", + "thiserror", ] [[package]] @@ -1200,18 +1258,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.16" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d12a1dae4add0f0d568eebc7bf142f145ba1aa2544cafb195c76f0f409091b60" +checksum = "b13f926965ad00595dd129fa12823b04bbf866e9085ab0a5f2b05b850fbfc344" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.16" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f34e0c1caaa462fd840ec6b768946ea1e7842620d94fe29d5b847138f521269" +checksum = "893582086c2f98cde18f906265a65b5030a074b1046c674ae898be6519a7f479" dependencies = [ "proc-macro2 1.0.9", "quote 1.0.3", diff --git a/compiler/src/constraints/boolean.rs b/compiler/src/constraints/boolean.rs index 87d6c9b9ce..370df34743 100644 --- a/compiler/src/constraints/boolean.rs +++ b/compiler/src/constraints/boolean.rs @@ -16,8 +16,8 @@ use snarkos_models::{ }, }; -impl, CS: ConstraintSystem> ConstrainedProgram { - pub(crate) fn bool_from_input( +impl> ConstrainedProgram { + pub(crate) fn bool_from_input>( &mut self, cs: &mut CS, name: String, @@ -57,7 +57,7 @@ impl, CS: ConstraintSystem> Constraine } } - pub(crate) fn enforce_or( + pub(crate) fn enforce_or>( &mut self, cs: &mut CS, left: ConstrainedValue, @@ -74,7 +74,7 @@ impl, CS: ConstraintSystem> Constraine } } - pub(crate) fn enforce_and( + pub(crate) fn enforce_and>( &mut self, cs: &mut CS, left: ConstrainedValue, @@ -95,7 +95,7 @@ impl, CS: ConstraintSystem> Constraine ConstrainedValue::Boolean(Boolean::Constant(left.eq(&right))) } - pub(crate) fn enforce_boolean_eq( + pub(crate) fn enforce_boolean_eq>( &mut self, cs: &mut CS, left: Boolean, diff --git a/compiler/src/constraints/expression.rs b/compiler/src/constraints/expression.rs index 2f43070d06..e4b5430214 100644 --- a/compiler/src/constraints/expression.rs +++ b/compiler/src/constraints/expression.rs @@ -27,7 +27,7 @@ use snarkos_models::{ }, }; -impl, CS: ConstraintSystem> ConstrainedProgram { +impl> ConstrainedProgram { /// Enforce a variable expression by getting the resolved value pub(crate) fn evaluate_identifier( &mut self, @@ -56,7 +56,7 @@ impl, CS: ConstraintSystem> Constraine } /// Enforce numerical operations - fn enforce_add_expression( + fn enforce_add_expression>( &mut self, cs: &mut CS, left: ConstrainedValue, @@ -84,7 +84,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_sub_expression( + fn enforce_sub_expression>( &mut self, cs: &mut CS, left: ConstrainedValue, @@ -112,7 +112,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_mul_expression( + fn enforce_mul_expression>( &mut self, cs: &mut CS, left: ConstrainedValue, @@ -137,7 +137,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_div_expression( + fn enforce_div_expression>( &mut self, cs: &mut CS, left: ConstrainedValue, @@ -162,7 +162,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_pow_expression( + fn enforce_pow_expression>( &mut self, cs: &mut CS, left: ConstrainedValue, @@ -332,7 +332,7 @@ impl, CS: ConstraintSystem> Constraine } /// Enforce ternary conditional expression - fn enforce_conditional_expression( + fn enforce_conditional_expression>( &mut self, cs: &mut CS, file_scope: String, @@ -379,7 +379,7 @@ impl, CS: ConstraintSystem> Constraine } /// Enforce array expressions - fn enforce_array_expression( + fn enforce_array_expression>( &mut self, cs: &mut CS, file_scope: String, @@ -443,7 +443,7 @@ impl, CS: ConstraintSystem> Constraine Ok(ConstrainedValue::Array(result)) } - pub(crate) fn enforce_index( + pub(crate) fn enforce_index>( &mut self, cs: &mut CS, file_scope: String, @@ -457,7 +457,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_array_access_expression( + fn enforce_array_access_expression>( &mut self, cs: &mut CS, file_scope: String, @@ -490,7 +490,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_circuit_expression( + fn enforce_circuit_expression>( &mut self, cs: &mut CS, file_scope: String, @@ -553,7 +553,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_circuit_access_expression( + fn enforce_circuit_access_expression>( &mut self, cs: &mut CS, file_scope: String, @@ -608,7 +608,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_circuit_static_access_expression( + fn enforce_circuit_static_access_expression>( &mut self, cs: &mut CS, file_scope: String, @@ -655,7 +655,7 @@ impl, CS: ConstraintSystem> Constraine Ok(ConstrainedValue::Function(Some(circuit.identifier), function)) } - fn enforce_function_call_expression( + fn enforce_function_call_expression>( &mut self, cs: &mut CS, file_scope: String, @@ -712,7 +712,7 @@ impl, CS: ConstraintSystem> Constraine /// Enforce a branch of a binary expression. /// We don't care about mutability because we are not changing any variables. /// We try to resolve unresolved types here if the type is given explicitly. - pub(crate) fn enforce_branch( + pub(crate) fn enforce_branch>( &mut self, cs: &mut CS, file_scope: String, @@ -728,7 +728,7 @@ impl, CS: ConstraintSystem> Constraine Ok(branch) } - pub(crate) fn enforce_binary_expression( + pub(crate) fn enforce_binary_expression>( &mut self, cs: &mut CS, file_scope: String, @@ -745,7 +745,7 @@ impl, CS: ConstraintSystem> Constraine Ok((resolved_left, resolved_right)) } - pub(crate) fn enforce_expression( + pub(crate) fn enforce_expression>( &mut self, cs: &mut CS, file_scope: String, diff --git a/compiler/src/constraints/function.rs b/compiler/src/constraints/function.rs index adc8be82a2..2132d99298 100644 --- a/compiler/src/constraints/function.rs +++ b/compiler/src/constraints/function.rs @@ -15,7 +15,7 @@ use snarkos_models::{ gadgets::r1cs::ConstraintSystem, }; -impl, CS: ConstraintSystem> ConstrainedProgram { +impl> ConstrainedProgram { fn check_arguments_length(expected: usize, actual: usize) -> Result<(), FunctionError> { // Make sure we are given the correct number of arguments if expected != actual { @@ -25,7 +25,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_input( + fn enforce_input>( &mut self, cs: &mut CS, scope: String, @@ -44,7 +44,7 @@ impl, CS: ConstraintSystem> Constraine } } - pub(crate) fn enforce_function( + pub(crate) fn enforce_function>( &mut self, cs: &mut CS, scope: String, @@ -102,7 +102,7 @@ impl, CS: ConstraintSystem> Constraine Ok(return_values) } - fn allocate_array( + fn allocate_array>( &mut self, cs: &mut CS, name: String, @@ -148,7 +148,7 @@ impl, CS: ConstraintSystem> Constraine Ok(ConstrainedValue::Array(array_value)) } - fn allocate_main_function_input( + fn allocate_main_function_input>( &mut self, cs: &mut CS, _type: Type, @@ -172,7 +172,7 @@ impl, CS: ConstraintSystem> Constraine } } - pub(crate) fn enforce_main_function( + pub(crate) fn enforce_main_function>( &mut self, cs: &mut CS, scope: String, @@ -207,7 +207,11 @@ impl, CS: ConstraintSystem> Constraine self.enforce_function(cs, scope, function_name, function, input_variables) } - pub(crate) fn resolve_definitions(&mut self, cs: &mut CS, program: Program) -> Result<(), ImportError> { + pub(crate) fn resolve_definitions>( + &mut self, + cs: &mut CS, + program: Program, + ) -> Result<(), ImportError> { let program_name = program.name.clone(); // evaluate and store all imports diff --git a/compiler/src/constraints/import.rs b/compiler/src/constraints/import.rs index 6c4909a777..04f8491005 100644 --- a/compiler/src/constraints/import.rs +++ b/compiler/src/constraints/import.rs @@ -13,8 +13,13 @@ use snarkos_models::{ }; use std::env::current_dir; -impl, CS: ConstraintSystem> ConstrainedProgram { - pub fn enforce_import(&mut self, cs: &mut CS, scope: String, import: Import) -> Result<(), ImportError> { +impl> ConstrainedProgram { + pub fn enforce_import>( + &mut self, + cs: &mut CS, + scope: String, + import: Import, + ) -> Result<(), ImportError> { let path = current_dir().map_err(|error| ImportError::DirectoryError(error))?; // Sanitize the package path to the imports directory diff --git a/compiler/src/constraints/mod.rs b/compiler/src/constraints/mod.rs index 1095a54fa6..c4c5c6494f 100644 --- a/compiler/src/constraints/mod.rs +++ b/compiler/src/constraints/mod.rs @@ -64,7 +64,7 @@ pub fn generate_test_constraints>( cs: &mut TestConstraintSystem, program: Program, ) -> Result<(), CompilerError> { - let mut resolved_program = ConstrainedProgram::>::new(); + let mut resolved_program = ConstrainedProgram::::new(); let program_name = program.get_name(); let tests = program.tests.clone(); diff --git a/compiler/src/constraints/program.rs b/compiler/src/constraints/program.rs index e1648b2810..3071720e8a 100644 --- a/compiler/src/constraints/program.rs +++ b/compiler/src/constraints/program.rs @@ -2,26 +2,21 @@ use crate::{constraints::ConstrainedValue, GroupType}; -use snarkos_models::{ - curves::{Field, PrimeField}, - gadgets::r1cs::ConstraintSystem, -}; -use std::{collections::HashMap, marker::PhantomData}; +use snarkos_models::curves::{Field, PrimeField}; +use std::collections::HashMap; -pub struct ConstrainedProgram, CS: ConstraintSystem> { +pub struct ConstrainedProgram> { pub identifiers: HashMap>, - pub _cs: PhantomData, } pub fn new_scope(outer: String, inner: String) -> String { format!("{}_{}", outer, inner) } -impl, CS: ConstraintSystem> ConstrainedProgram { +impl> ConstrainedProgram { pub fn new() -> Self { Self { identifiers: HashMap::new(), - _cs: PhantomData::, } } diff --git a/compiler/src/constraints/statement.rs b/compiler/src/constraints/statement.rs index 2b7e43633f..d923080a03 100644 --- a/compiler/src/constraints/statement.rs +++ b/compiler/src/constraints/statement.rs @@ -27,7 +27,7 @@ use snarkos_models::{ }, }; -impl, CS: ConstraintSystem> ConstrainedProgram { +impl> ConstrainedProgram { fn resolve_assignee(&mut self, scope: String, assignee: Assignee) -> String { match assignee { Assignee::Identifier(name) => new_scope(scope, name.to_string()), @@ -47,7 +47,7 @@ impl, CS: ConstraintSystem> Constraine }) } - fn mutate_array( + fn mutate_array>( &mut self, cs: &mut CS, file_scope: String, @@ -125,7 +125,7 @@ impl, CS: ConstraintSystem> Constraine Ok(()) } - fn enforce_assign_statement( + fn enforce_assign_statement>( &mut self, cs: &mut CS, file_scope: String, @@ -180,7 +180,7 @@ impl, CS: ConstraintSystem> Constraine Ok(()) } - fn enforce_definition_statement( + fn enforce_definition_statement>( &mut self, cs: &mut CS, file_scope: String, @@ -203,7 +203,7 @@ impl, CS: ConstraintSystem> Constraine self.store_definition(function_scope, variable, value) } - fn enforce_multiple_definition_statement( + fn enforce_multiple_definition_statement>( &mut self, cs: &mut CS, file_scope: String, @@ -243,7 +243,7 @@ impl, CS: ConstraintSystem> Constraine Ok(()) } - fn enforce_return_statement( + fn enforce_return_statement>( &mut self, cs: &mut CS, file_scope: String, @@ -276,7 +276,7 @@ impl, CS: ConstraintSystem> Constraine Ok(ConstrainedValue::Return(returns)) } - fn iterate_or_early_return( + fn iterate_or_early_return>( &mut self, cs: &mut CS, file_scope: String, @@ -302,7 +302,7 @@ impl, CS: ConstraintSystem> Constraine Ok(res) } - fn enforce_conditional_statement( + fn enforce_conditional_statement>( &mut self, cs: &mut CS, file_scope: String, @@ -340,7 +340,7 @@ impl, CS: ConstraintSystem> Constraine } } - fn enforce_for_statement( + fn enforce_for_statement>( &mut self, cs: &mut CS, file_scope: String, @@ -378,7 +378,7 @@ impl, CS: ConstraintSystem> Constraine Ok(res) } - fn enforce_assert_eq_statement( + fn enforce_assert_eq_statement>( &mut self, cs: &mut CS, left: ConstrainedValue, @@ -406,7 +406,7 @@ impl, CS: ConstraintSystem> Constraine }) } - pub(crate) fn enforce_statement( + pub(crate) fn enforce_statement>( &mut self, cs: &mut CS, file_scope: String, diff --git a/tmp/.gitignore b/tmp/.gitignore new file mode 100644 index 0000000000..ee3b8ff567 --- /dev/null +++ b/tmp/.gitignore @@ -0,0 +1,2 @@ +/output +/.leo diff --git a/tmp/Leo.toml b/tmp/Leo.toml new file mode 100644 index 0000000000..36afb9b7ec --- /dev/null +++ b/tmp/Leo.toml @@ -0,0 +1,3 @@ +[package] +name = "tmp" +version = "0.1.0" diff --git a/tmp/inputs/inputs.leo b/tmp/inputs/inputs.leo new file mode 100644 index 0000000000..15685c3c69 --- /dev/null +++ b/tmp/inputs/inputs.leo @@ -0,0 +1 @@ +[main] diff --git a/tmp/src/main.leo b/tmp/src/main.leo new file mode 100644 index 0000000000..f694486c52 --- /dev/null +++ b/tmp/src/main.leo @@ -0,0 +1,9 @@ +function test(p: public bool) { + +} + +// The 'pedersen_hash' main function. +function main() { + let a = true; + test(a); +} From 17e241ae414de08b570d2dec58af46e0d94d4ce1 Mon Sep 17 00:00:00 2001 From: collin Date: Mon, 15 Jun 2020 18:27:53 -0700 Subject: [PATCH 2/3] remove tmp folder --- tmp/.gitignore | 2 -- tmp/Leo.toml | 3 --- tmp/inputs/inputs.leo | 1 - tmp/src/main.leo | 9 --------- 4 files changed, 15 deletions(-) delete mode 100644 tmp/.gitignore delete mode 100644 tmp/Leo.toml delete mode 100644 tmp/inputs/inputs.leo delete mode 100644 tmp/src/main.leo diff --git a/tmp/.gitignore b/tmp/.gitignore deleted file mode 100644 index ee3b8ff567..0000000000 --- a/tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/output -/.leo diff --git a/tmp/Leo.toml b/tmp/Leo.toml deleted file mode 100644 index 36afb9b7ec..0000000000 --- a/tmp/Leo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "tmp" -version = "0.1.0" diff --git a/tmp/inputs/inputs.leo b/tmp/inputs/inputs.leo deleted file mode 100644 index 15685c3c69..0000000000 --- a/tmp/inputs/inputs.leo +++ /dev/null @@ -1 +0,0 @@ -[main] diff --git a/tmp/src/main.leo b/tmp/src/main.leo deleted file mode 100644 index f694486c52..0000000000 --- a/tmp/src/main.leo +++ /dev/null @@ -1,9 +0,0 @@ -function test(p: public bool) { - -} - -// The 'pedersen_hash' main function. -function main() { - let a = true; - test(a); -} From 0168902a7d1fa0a8576a0240a00a690ff292738b Mon Sep 17 00:00:00 2001 From: collin Date: Mon, 15 Jun 2020 19:32:37 -0700 Subject: [PATCH 3/3] update snarkos master --- compiler/tests/field/mod.rs | 2 +- compiler/tests/group/mod.rs | 2 +- types/src/inputs/input_fields.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/tests/field/mod.rs b/compiler/tests/field/mod.rs index 1c2c9f889b..db3bf89491 100644 --- a/compiler/tests/field/mod.rs +++ b/compiler/tests/field/mod.rs @@ -16,7 +16,7 @@ use leo_types::InputValue; use snarkos_curves::edwards_bls12::Fq; use snarkos_gadgets::curves::edwards_bls12::FqGadget; use snarkos_models::{ - curves::{Field, PrimeField}, + curves::{One, PrimeField, Zero}, gadgets::{ curves::field::FieldGadget, r1cs::{ConstraintSystem, TestConstraintSystem}, diff --git a/compiler/tests/group/mod.rs b/compiler/tests/group/mod.rs index 46aeea7a51..f0c32488b1 100644 --- a/compiler/tests/group/mod.rs +++ b/compiler/tests/group/mod.rs @@ -12,7 +12,7 @@ use leo_types::InputValue; use snarkos_curves::edwards_bls12::{EdwardsAffine, Fq}; use snarkos_gadgets::curves::edwards_bls12::EdwardsBlsGadget; use snarkos_models::{ - curves::Group, + curves::Zero, gadgets::{r1cs::TestConstraintSystem, utilities::alloc::AllocGadget}, }; use std::str::FromStr; diff --git a/types/src/inputs/input_fields.rs b/types/src/inputs/input_fields.rs index 30f3324b55..2f1157ddd3 100644 --- a/types/src/inputs/input_fields.rs +++ b/types/src/inputs/input_fields.rs @@ -1,7 +1,7 @@ use crate::InputValue; use leo_inputs::{types::IntegerType, InputParserError}; -use snarkos_models::curves::{Field, PairingEngine}; +use snarkos_models::curves::{One, PairingEngine, Zero}; use std::str::FromStr; pub struct InputFields(pub Vec);