diff --git a/is_prime/Cargo.lock b/is_prime/Cargo.lock index 9159014b5..61cc7b3f1 100644 --- a/is_prime/Cargo.lock +++ b/is_prime/Cargo.lock @@ -1672,37 +1672,6 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" -[[package]] -name = "fibonacci-lib" -version = "0.1.0" -dependencies = [ - "alloy-sol-types", -] - -[[package]] -name = "fibonacci-program" -version = "0.1.0" -dependencies = [ - "alloy-sol-types", - "fibonacci-lib", - "sp1-zkvm", -] - -[[package]] -name = "fibonacci-script" -version = "0.1.0" -dependencies = [ - "alloy-sol-types", - "clap", - "fibonacci-lib", - "hex", - "serde", - "serde_json", - "sp1-helper", - "sp1-sdk", - "tracing", -] - [[package]] name = "fixed-hash" version = "0.8.0" @@ -2402,6 +2371,37 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is_prime-lib" +version = "0.1.0" +dependencies = [ + "alloy-sol-types", +] + +[[package]] +name = "is_prime-program" +version = "0.1.0" +dependencies = [ + "alloy-sol-types", + "is_prime-lib", + "sp1-zkvm", +] + +[[package]] +name = "is_prime-script" +version = "0.1.0" +dependencies = [ + "alloy-sol-types", + "clap", + "hex", + "is_prime-lib", + "serde", + "serde_json", + "sp1-helper", + "sp1-sdk", + "tracing", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" diff --git a/is_prime/README.md b/is_prime/README.md index c662baf2f..085b46924 100644 --- a/is_prime/README.md +++ b/is_prime/README.md @@ -68,7 +68,7 @@ inside Solidity. To retrieve your `programVKey` for your on-chain contract, run the following command: ```sh -cargo prove vkey --program fibonacci-program +cargo prove vkey --program is_prime-program ``` ## Using the Prover Network diff --git a/is_prime/elf/riscv32im-succinct-zkvm-elf b/is_prime/elf/riscv32im-succinct-zkvm-elf deleted file mode 100755 index 3938e57cf..000000000 Binary files a/is_prime/elf/riscv32im-succinct-zkvm-elf and /dev/null differ diff --git a/is_prime/lib/Cargo.toml b/is_prime/lib/Cargo.toml index 11f9527b7..7229ce6a9 100644 --- a/is_prime/lib/Cargo.toml +++ b/is_prime/lib/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fibonacci-lib" +name = "is_prime-lib" version = "0.1.0" edition = "2021" diff --git a/is_prime/program/Cargo.lock b/is_prime/program/Cargo.lock index dd66e5b9a..3d50d7791 100644 --- a/is_prime/program/Cargo.lock +++ b/is_prime/program/Cargo.lock @@ -545,7 +545,7 @@ dependencies = [ ] [[package]] -name = "fibonacci-program" +name = "is_prime-program" version = "0.1.0" dependencies = [ "alloy-sol-types", diff --git a/is_prime/program/Cargo.toml b/is_prime/program/Cargo.toml index cf178d92a..edbaa0bcd 100644 --- a/is_prime/program/Cargo.toml +++ b/is_prime/program/Cargo.toml @@ -1,9 +1,9 @@ [package] version = "0.1.0" -name = "fibonacci-program" +name = "is_prime-program" edition = "2021" [dependencies] alloy-sol-types = { workspace = true } sp1-zkvm = "3.0.0-rc4" -fibonacci-lib = { path = "../lib" } +is_prime-lib = { path = "../lib" } diff --git a/is_prime/program/src/main.rs b/is_prime/program/src/main.rs index 044e32b89..e24aab848 100644 --- a/is_prime/program/src/main.rs +++ b/is_prime/program/src/main.rs @@ -9,7 +9,7 @@ sp1_zkvm::entrypoint!(main); use alloy_sol_types::SolType; -use fibonacci_lib::{is_prime, PublicValuesStruct}; +use is_prime_lib::{is_prime, PublicValuesStruct}; pub fn main() { // Read an input to the program. diff --git a/is_prime/script/Cargo.lock b/is_prime/script/Cargo.lock index 730721958..1bc3c9834 100644 --- a/is_prime/script/Cargo.lock +++ b/is_prime/script/Cargo.lock @@ -1627,7 +1627,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] -name = "fibonacci-script" +name = "is_prime-script" version = "0.1.0" dependencies = [ "alloy-sol-types", diff --git a/is_prime/script/Cargo.toml b/is_prime/script/Cargo.toml index 1bc334b7a..8baf03869 100644 --- a/is_prime/script/Cargo.toml +++ b/is_prime/script/Cargo.toml @@ -1,11 +1,11 @@ [package] version = "0.1.0" -name = "fibonacci-script" +name = "is_prime-script" edition = "2021" -default-run = "fibonacci" +default-run = "is_prime" [[bin]] -name = "fibonacci" +name = "is_prime" path = "src/bin/main.rs" [[bin]] @@ -20,7 +20,7 @@ clap = { version = "4.0", features = ["derive", "env"] } tracing = "0.1.40" hex = "0.4.3" alloy-sol-types = { workspace = true } -fibonacci-lib = { path = "../lib" } +is_prime-lib = { path = "../lib" } [build-dependencies] sp1-helper = "3.0.0" diff --git a/is_prime/script/src/bin/evm.rs b/is_prime/script/src/bin/evm.rs index 3f48bbc8a..389259fd9 100644 --- a/is_prime/script/src/bin/evm.rs +++ b/is_prime/script/src/bin/evm.rs @@ -12,7 +12,7 @@ use alloy_sol_types::SolType; use clap::{Parser, ValueEnum}; -use fibonacci_lib::PublicValuesStruct; +use is_prime_lib::PublicValuesStruct; use serde::{Deserialize, Serialize}; use sp1_sdk::{ include_elf, HashableKey, ProverClient, SP1ProofWithPublicValues, SP1Stdin, SP1VerifyingKey, @@ -20,7 +20,7 @@ use sp1_sdk::{ use std::path::PathBuf; /// The ELF (executable and linkable format) file for the Succinct RISC-V zkVM. -pub const FIBONACCI_ELF: &[u8] = include_elf!("fibonacci-program"); +pub const is_prime_ELF: &[u8] = include_elf!("is_prime-program"); /// The arguments for the EVM command. #[derive(Parser, Debug)] @@ -42,7 +42,7 @@ enum ProofSystem { /// A fixture that can be used to test the verification of SP1 zkVM proofs inside Solidity. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -struct SP1FibonacciProofFixture { +struct SP1is_primeProofFixture { cnt_primes: u32, n: u32, vkey: String, @@ -61,7 +61,7 @@ fn main() { let client = ProverClient::new(); // Setup the program. - let (pk, vk) = client.setup(FIBONACCI_ELF); + let (pk, vk) = client.setup(is_prime_ELF); // Setup the inputs. let mut stdin = SP1Stdin::new(); @@ -92,7 +92,7 @@ fn create_proof_fixture( PublicValuesStruct::abi_decode(bytes, false).unwrap(); // Create the testing fixture so we can test things end-to-end. - let fixture = SP1FibonacciProofFixture { + let fixture = SP1is_primeProofFixture { cnt_primes, n, vkey: vk.bytes32().to_string(), diff --git a/is_prime/script/src/bin/main.rs b/is_prime/script/src/bin/main.rs index c5eb23650..4b3e8456e 100644 --- a/is_prime/script/src/bin/main.rs +++ b/is_prime/script/src/bin/main.rs @@ -12,11 +12,11 @@ use alloy_sol_types::SolType; use clap::Parser; -use fibonacci_lib::PublicValuesStruct; +use is_prime_lib::PublicValuesStruct; use sp1_sdk::{include_elf, ProverClient, SP1Stdin}; /// The ELF (executable and linkable format) file for the Succinct RISC-V zkVM. -pub const FIBONACCI_ELF: &[u8] = include_elf!("fibonacci-program"); +pub const is_prime_ELF: &[u8] = include_elf!("is_prime-program"); /// The arguments for the command. #[derive(Parser, Debug)] @@ -55,7 +55,7 @@ fn main() { if args.execute { // Execute the program - let (output, report) = client.execute(FIBONACCI_ELF, stdin).run().unwrap(); + let (output, report) = client.execute(is_prime_ELF, stdin).run().unwrap(); println!("Program executed successfully."); // Read the output. @@ -72,7 +72,7 @@ fn main() { println!("Number of cycles: {}", report.total_instruction_count()); } else { // Setup the program for proving. - let (pk, vk) = client.setup(FIBONACCI_ELF); + let (pk, vk) = client.setup(is_prime_ELF); // Generate the proof let proof = client