diff --git a/.gitignore b/.gitignore index 6d76e03bf0..169d72f25d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ **/target /tmp/ **.idea/ -outputs/ *.DS_Store diff --git a/examples/fibonacci/outputs/fibonacci.lpk b/examples/fibonacci/outputs/fibonacci.lpk new file mode 100644 index 0000000000..6bcd2d6ecf Binary files /dev/null and b/examples/fibonacci/outputs/fibonacci.lpk differ diff --git a/examples/fibonacci/outputs/fibonacci.lvk b/examples/fibonacci/outputs/fibonacci.lvk new file mode 100644 index 0000000000..29ad86b96b Binary files /dev/null and b/examples/fibonacci/outputs/fibonacci.lvk differ diff --git a/examples/fibonacci/outputs/fibonacci.proof b/examples/fibonacci/outputs/fibonacci.proof new file mode 100644 index 0000000000..e043e95f92 Binary files /dev/null and b/examples/fibonacci/outputs/fibonacci.proof differ diff --git a/examples/fibonacci/outputs/fibonacci.sum b/examples/fibonacci/outputs/fibonacci.sum new file mode 100644 index 0000000000..7d859e2436 --- /dev/null +++ b/examples/fibonacci/outputs/fibonacci.sum @@ -0,0 +1 @@ +4515828aedc8e4ff8fe7555eabcb3da1fd155e7d35743d1322e763dfb477df83 \ No newline at end of file diff --git a/examples/hello_world/outputs/hello_world.leo.checksum b/examples/hello_world/outputs/hello_world.leo.checksum new file mode 100644 index 0000000000..f504b7f030 --- /dev/null +++ b/examples/hello_world/outputs/hello_world.leo.checksum @@ -0,0 +1 @@ +a8083686e43fd326bd715555ef323dcec82c859403428cb4bd33368d5893eaac \ No newline at end of file diff --git a/examples/hello_world/outputs/hello_world.leo.pk b/examples/hello_world/outputs/hello_world.leo.pk new file mode 100644 index 0000000000..4001de3b6f Binary files /dev/null and b/examples/hello_world/outputs/hello_world.leo.pk differ diff --git a/examples/hello_world/outputs/hello_world.leo.proof b/examples/hello_world/outputs/hello_world.leo.proof new file mode 100644 index 0000000000..af85d87279 Binary files /dev/null and b/examples/hello_world/outputs/hello_world.leo.proof differ diff --git a/examples/hello_world/outputs/hello_world.leo.vk b/examples/hello_world/outputs/hello_world.leo.vk new file mode 100644 index 0000000000..ad7a019480 Binary files /dev/null and b/examples/hello_world/outputs/hello_world.leo.vk differ diff --git a/examples/hello_world/outputs/hello_world.lpk b/examples/hello_world/outputs/hello_world.lpk new file mode 100644 index 0000000000..270d97857c Binary files /dev/null and b/examples/hello_world/outputs/hello_world.lpk differ diff --git a/examples/hello_world/outputs/hello_world.lvk b/examples/hello_world/outputs/hello_world.lvk new file mode 100644 index 0000000000..7c7f3e27c0 Binary files /dev/null and b/examples/hello_world/outputs/hello_world.lvk differ diff --git a/examples/hello_world/outputs/hello_world.proof b/examples/hello_world/outputs/hello_world.proof new file mode 100644 index 0000000000..288fa4e48f Binary files /dev/null and b/examples/hello_world/outputs/hello_world.proof differ diff --git a/examples/hello_world/outputs/hello_world.sum b/examples/hello_world/outputs/hello_world.sum new file mode 100644 index 0000000000..1fd7a79244 --- /dev/null +++ b/examples/hello_world/outputs/hello_world.sum @@ -0,0 +1 @@ +d11c379b6a0ea2e0da8c9980db0c8705d18b047799b4372e8786dc44a6ee1495 \ No newline at end of file diff --git a/examples/pedersen_hash/outputs/pedersen_hash.lpk b/examples/pedersen_hash/outputs/pedersen_hash.lpk new file mode 100644 index 0000000000..cc506a71f5 Binary files /dev/null and b/examples/pedersen_hash/outputs/pedersen_hash.lpk differ diff --git a/examples/pedersen_hash/outputs/pedersen_hash.lvk b/examples/pedersen_hash/outputs/pedersen_hash.lvk new file mode 100644 index 0000000000..5053611fdb Binary files /dev/null and b/examples/pedersen_hash/outputs/pedersen_hash.lvk differ diff --git a/examples/pedersen_hash/outputs/pedersen_hash.proof b/examples/pedersen_hash/outputs/pedersen_hash.proof new file mode 100644 index 0000000000..b96d4b560e Binary files /dev/null and b/examples/pedersen_hash/outputs/pedersen_hash.proof differ diff --git a/examples/pedersen_hash/outputs/pedersen_hash.sum b/examples/pedersen_hash/outputs/pedersen_hash.sum new file mode 100644 index 0000000000..83bbae02ca --- /dev/null +++ b/examples/pedersen_hash/outputs/pedersen_hash.sum @@ -0,0 +1 @@ +ccedb51d6030e8775a49346b694e53da5d3fdb57b884320231eb3c9ecf7c4df6 \ No newline at end of file diff --git a/leo/commands/build.rs b/leo/commands/build.rs index 16f3d96311..09b1bc50c9 100644 --- a/leo/commands/build.rs +++ b/leo/commands/build.rs @@ -1,9 +1,10 @@ use crate::{cli::*, cli_types::*, errors::CLIError}; use leo_compiler::{compiler::Compiler, group::targets::edwards_bls12::EdwardsGroupType}; use leo_package::{ - directories::{source::SOURCE_DIRECTORY_NAME, OutputDirectory, OUTPUT_DIRECTORY_NAME}, - files::{ChecksumFile, LibFile, MainFile, Manifest, LIB_FILE_NAME, MAIN_FILE_NAME}, + directories::source::SOURCE_DIRECTORY_NAME, + files::{LibFile, MainFile, Manifest, LIB_FILE_NAME, MAIN_FILE_NAME}, inputs::*, + outputs::{ChecksumFile, OutputDirectory, OUTPUT_DIRECTORY_NAME}, }; use snarkos_algorithms::snark::groth16::KeypairAssembly; diff --git a/leo/commands/clean.rs b/leo/commands/clean.rs index 25f16ad269..b9087d2f97 100644 --- a/leo/commands/clean.rs +++ b/leo/commands/clean.rs @@ -1,5 +1,8 @@ use crate::{cli::*, cli_types::*, errors::CLIError}; -use leo_package::files::{ChecksumFile, Manifest, ProofFile, ProvingKeyFile, VerificationKeyFile}; +use leo_package::{ + files::Manifest, + outputs::{ChecksumFile, ProofFile, ProvingKeyFile, VerificationKeyFile}, +}; use clap::ArgMatches; use std::{convert::TryFrom, env::current_dir}; diff --git a/leo/commands/prove.rs b/leo/commands/prove.rs index ec16c583fe..1fa21dabf0 100644 --- a/leo/commands/prove.rs +++ b/leo/commands/prove.rs @@ -1,5 +1,5 @@ use crate::{cli::*, cli_types::*, commands::SetupCommand, errors::CLIError}; -use leo_package::files::{Manifest, ProofFile}; +use leo_package::{files::Manifest, outputs::ProofFile}; use snarkos_algorithms::snark::groth16::{Groth16, PreparedVerifyingKey, Proof}; use snarkos_curves::bls12_377::{Bls12_377, Fr}; diff --git a/leo/commands/publish.rs b/leo/commands/publish.rs index 5018d1f4c5..46feb377d0 100644 --- a/leo/commands/publish.rs +++ b/leo/commands/publish.rs @@ -1,7 +1,7 @@ use crate::{cli::*, cli_types::*, commands::BuildCommand, errors::CLIError}; use leo_package::{ - directories::output::OutputDirectory, files::{Manifest, ZipFile}, + outputs::OutputDirectory, }; use clap::ArgMatches; diff --git a/leo/commands/setup.rs b/leo/commands/setup.rs index 1cb7626db4..6df7531a55 100644 --- a/leo/commands/setup.rs +++ b/leo/commands/setup.rs @@ -7,7 +7,8 @@ use crate::{ use leo_compiler::{compiler::Compiler, group::targets::edwards_bls12::EdwardsGroupType}; use leo_package::{ directories::SOURCE_DIRECTORY_NAME, - files::{Manifest, ProvingKeyFile, VerificationKeyFile, MAIN_FILE_NAME}, + files::{Manifest, MAIN_FILE_NAME}, + outputs::{ProvingKeyFile, VerificationKeyFile}, }; use snarkos_algorithms::snark::groth16::{Groth16, Parameters, PreparedVerifyingKey, VerifyingKey}; diff --git a/leo/commands/test.rs b/leo/commands/test.rs index 740388f6cf..5249a6bd46 100644 --- a/leo/commands/test.rs +++ b/leo/commands/test.rs @@ -5,9 +5,10 @@ use crate::{ }; use leo_compiler::{compiler::Compiler, group::targets::edwards_bls12::EdwardsGroupType}; use leo_package::{ - directories::{output::OUTPUT_DIRECTORY_NAME, source::SOURCE_DIRECTORY_NAME}, + directories::source::SOURCE_DIRECTORY_NAME, files::{MainFile, Manifest, MAIN_FILE_NAME}, inputs::*, + outputs::OUTPUT_DIRECTORY_NAME, }; use snarkos_curves::edwards_bls12::Fq; diff --git a/package/src/directories/mod.rs b/package/src/directories/mod.rs index 232d70dba1..f7955972c9 100644 --- a/package/src/directories/mod.rs +++ b/package/src/directories/mod.rs @@ -1,8 +1,5 @@ pub mod imports; pub use self::imports::*; -pub mod output; -pub use self::output::*; - pub mod source; pub use self::source::*; diff --git a/package/src/errors/directory/mod.rs b/package/src/errors/directory/mod.rs index 232d70dba1..f7955972c9 100644 --- a/package/src/errors/directory/mod.rs +++ b/package/src/errors/directory/mod.rs @@ -1,8 +1,5 @@ pub mod imports; pub use self::imports::*; -pub mod output; -pub use self::output::*; - pub mod source; pub use self::source::*; diff --git a/package/src/errors/files/mod.rs b/package/src/errors/files/mod.rs index ed1c111b88..5199f4694a 100644 --- a/package/src/errors/files/mod.rs +++ b/package/src/errors/files/mod.rs @@ -1,9 +1,6 @@ pub mod zip; pub use self::zip::*; -pub mod checksum; -pub use self::checksum::*; - pub mod gitignore; pub use self::gitignore::*; @@ -15,12 +12,3 @@ pub use self::main::*; pub mod manifest; pub use self::manifest::*; - -pub mod proof; -pub use self::proof::*; - -pub mod proving_key; -pub use self::proving_key::*; - -pub mod verification_key; -pub use self::verification_key::*; diff --git a/package/src/errors/mod.rs b/package/src/errors/mod.rs index 70166cd620..3cc75c45f7 100644 --- a/package/src/errors/mod.rs +++ b/package/src/errors/mod.rs @@ -6,3 +6,6 @@ pub use self::files::*; pub mod inputs; pub use inputs::*; + +pub mod outputs; +pub use outputs::*; diff --git a/package/src/errors/files/checksum.rs b/package/src/errors/outputs/checksum.rs similarity index 100% rename from package/src/errors/files/checksum.rs rename to package/src/errors/outputs/checksum.rs diff --git a/package/src/errors/directory/output.rs b/package/src/errors/outputs/directory.rs similarity index 100% rename from package/src/errors/directory/output.rs rename to package/src/errors/outputs/directory.rs diff --git a/package/src/errors/outputs/mod.rs b/package/src/errors/outputs/mod.rs new file mode 100644 index 0000000000..f9ba49a493 --- /dev/null +++ b/package/src/errors/outputs/mod.rs @@ -0,0 +1,14 @@ +pub mod checksum; +pub use checksum::*; + +pub mod directory; +pub use self::directory::*; + +pub mod proof; +pub use proof::*; + +pub mod proving_key; +pub use proving_key::*; + +pub mod verification_key; +pub use verification_key::*; diff --git a/package/src/errors/files/proof.rs b/package/src/errors/outputs/proof.rs similarity index 100% rename from package/src/errors/files/proof.rs rename to package/src/errors/outputs/proof.rs diff --git a/package/src/errors/files/proving_key.rs b/package/src/errors/outputs/proving_key.rs similarity index 100% rename from package/src/errors/files/proving_key.rs rename to package/src/errors/outputs/proving_key.rs diff --git a/package/src/errors/files/verification_key.rs b/package/src/errors/outputs/verification_key.rs similarity index 100% rename from package/src/errors/files/verification_key.rs rename to package/src/errors/outputs/verification_key.rs diff --git a/package/src/files/mod.rs b/package/src/files/mod.rs index ed1c111b88..5a1da53664 100644 --- a/package/src/files/mod.rs +++ b/package/src/files/mod.rs @@ -1,9 +1,3 @@ -pub mod zip; -pub use self::zip::*; - -pub mod checksum; -pub use self::checksum::*; - pub mod gitignore; pub use self::gitignore::*; @@ -16,11 +10,5 @@ pub use self::main::*; pub mod manifest; pub use self::manifest::*; -pub mod proof; -pub use self::proof::*; - -pub mod proving_key; -pub use self::proving_key::*; - -pub mod verification_key; -pub use self::verification_key::*; +pub mod zip; +pub use self::zip::*; diff --git a/package/src/files/zip.rs b/package/src/files/zip.rs index a021159839..ba6a73abd8 100644 --- a/package/src/files/zip.rs +++ b/package/src/files/zip.rs @@ -1,15 +1,16 @@ //! The program package zip file. use crate::{ - directories::{IMPORTS_DIRECTORY_NAME, OUTPUT_DIRECTORY_NAME}, + directories::IMPORTS_DIRECTORY_NAME, errors::ZipFileError, - files::{ + inputs::{INPUT_DIRECTORY_NAME, INPUT_FILE_EXTENSION}, + outputs::{ CHECKSUM_FILE_EXTENSION, + OUTPUT_DIRECTORY_NAME, PROOF_FILE_EXTENSION, PROVING_KEY_FILE_EXTENSION, VERIFICATION_KEY_FILE_EXTENSION, }, - inputs::{INPUT_DIRECTORY_NAME, INPUT_FILE_EXTENSION}, }; use serde::Deserialize; diff --git a/package/src/lib.rs b/package/src/lib.rs index ce32f7a266..df0631d3e0 100644 --- a/package/src/lib.rs +++ b/package/src/lib.rs @@ -7,3 +7,4 @@ pub use errors::*; pub mod directories; pub mod files; pub mod inputs; +pub mod outputs; diff --git a/package/src/files/checksum.rs b/package/src/outputs/checksum.rs similarity index 96% rename from package/src/files/checksum.rs rename to package/src/outputs/checksum.rs index caafddcb84..d48f033412 100644 --- a/package/src/files/checksum.rs +++ b/package/src/outputs/checksum.rs @@ -1,6 +1,6 @@ //! The build checksum file. -use crate::{directories::output::OUTPUT_DIRECTORY_NAME, errors::ChecksumFileError}; +use crate::{errors::ChecksumFileError, outputs::OUTPUT_DIRECTORY_NAME}; use serde::Deserialize; use std::{ diff --git a/package/src/directories/output.rs b/package/src/outputs/directory.rs similarity index 100% rename from package/src/directories/output.rs rename to package/src/outputs/directory.rs diff --git a/package/src/outputs/mod.rs b/package/src/outputs/mod.rs new file mode 100644 index 0000000000..e834a52b14 --- /dev/null +++ b/package/src/outputs/mod.rs @@ -0,0 +1,17 @@ +pub mod checksum; +pub use self::checksum::*; + +pub mod directory; +pub use directory::*; + +// pub mod output; +// pub use output::*; + +pub mod proof; +pub use self::proof::*; + +pub mod proving_key; +pub use self::proving_key::*; + +pub mod verification_key; +pub use self::verification_key::*; diff --git a/package/src/files/proof.rs b/package/src/outputs/proof.rs similarity index 96% rename from package/src/files/proof.rs rename to package/src/outputs/proof.rs index aca7483e75..ea589e2221 100644 --- a/package/src/files/proof.rs +++ b/package/src/outputs/proof.rs @@ -1,6 +1,6 @@ //! The proof file. -use crate::{directories::output::OUTPUT_DIRECTORY_NAME, errors::ProofFileError}; +use crate::{errors::ProofFileError, outputs::OUTPUT_DIRECTORY_NAME}; use serde::Deserialize; use std::{ diff --git a/package/src/files/proving_key.rs b/package/src/outputs/proving_key.rs similarity index 96% rename from package/src/files/proving_key.rs rename to package/src/outputs/proving_key.rs index 7015bb67a8..d94f3069b9 100644 --- a/package/src/files/proving_key.rs +++ b/package/src/outputs/proving_key.rs @@ -1,6 +1,6 @@ //! The proving key file. -use crate::{directories::output::OUTPUT_DIRECTORY_NAME, errors::ProvingKeyFileError}; +use crate::{errors::ProvingKeyFileError, outputs::OUTPUT_DIRECTORY_NAME}; use serde::Deserialize; use std::{ diff --git a/package/src/files/verification_key.rs b/package/src/outputs/verification_key.rs similarity index 95% rename from package/src/files/verification_key.rs rename to package/src/outputs/verification_key.rs index 407326e33d..983a0fa38e 100644 --- a/package/src/files/verification_key.rs +++ b/package/src/outputs/verification_key.rs @@ -1,6 +1,6 @@ //! The verification key file. -use crate::{directories::output::OUTPUT_DIRECTORY_NAME, errors::VerificationKeyFileError}; +use crate::{errors::VerificationKeyFileError, outputs::OUTPUT_DIRECTORY_NAME}; use serde::Deserialize; use std::{