diff --git a/Cargo.lock b/Cargo.lock index 8b22f9ad54..49ae1d2b2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6037,7 +6037,6 @@ dependencies = [ "log", "nohash-hasher", "num", - "num-bigint 0.4.6", "num_cpus", "p3-air", "p3-baby-bear", @@ -6175,12 +6174,17 @@ dependencies = [ name = "sp1-primitives" version = "2.0.0" dependencies = [ + "bincode", + "hex", "itertools 0.13.0", "lazy_static", + "num-bigint 0.4.6", "p3-baby-bear", "p3-field", "p3-poseidon2", "p3-symmetric", + "serde", + "sha2 0.10.8", ] [[package]] @@ -6509,6 +6513,7 @@ dependencies = [ "sp1-core-executor", "sp1-core-machine", "sp1-cuda", + "sp1-primitives", "sp1-prover", "sp1-stark", "strum", diff --git a/crates/core/machine/Cargo.toml b/crates/core/machine/Cargo.toml index ac01767a9f..f264ff4194 100644 --- a/crates/core/machine/Cargo.toml +++ b/crates/core/machine/Cargo.toml @@ -63,7 +63,6 @@ strum = "0.26" web-time = "1.1.0" rayon-scan = "0.1.1" thiserror = "1.0.63" -num-bigint = { version = "0.4.6", default-features = false } rand = "0.8.5" bytemuck = "1.16.0" hashbrown = { version = "0.14.5", features = ["serde", "inline-more"] } diff --git a/crates/core/machine/src/io.rs b/crates/core/machine/src/io.rs index 6f5475cf22..e4b417955b 100644 --- a/crates/core/machine/src/io.rs +++ b/crates/core/machine/src/io.rs @@ -1,6 +1,3 @@ -use crate::utils::Buffer; -use k256::sha2::{Digest, Sha256}; -use num_bigint::BigUint; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use sp1_stark::{baby_bear_poseidon2::BabyBearPoseidon2, ShardProof, StarkVerifyingKey}; @@ -14,12 +11,6 @@ pub struct SP1Stdin { pub proofs: Vec<(ShardProof, StarkVerifyingKey)>, } -/// Public values for the prover. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct SP1PublicValues { - buffer: Buffer, -} - impl SP1Stdin { /// Create a new `SP1Stdin`. pub const fn new() -> Self { @@ -70,83 +61,6 @@ impl SP1Stdin { } } -impl SP1PublicValues { - /// Create a new `SP1PublicValues`. - pub const fn new() -> Self { - Self { buffer: Buffer::new() } - } - - pub fn raw(&self) -> String { - format!("0x{}", hex::encode(self.buffer.data.clone())) - } - - /// Create a `SP1PublicValues` from a slice of bytes. - pub fn from(data: &[u8]) -> Self { - Self { buffer: Buffer::from(data) } - } - - pub fn as_slice(&self) -> &[u8] { - self.buffer.data.as_slice() - } - - pub fn to_vec(&self) -> Vec { - self.buffer.data.clone() - } - - /// Read a value from the buffer. - pub fn read(&mut self) -> T { - self.buffer.read() - } - - /// Read a slice of bytes from the buffer. - pub fn read_slice(&mut self, slice: &mut [u8]) { - self.buffer.read_slice(slice); - } - - /// Write a value to the buffer. - pub fn write(&mut self, data: &T) { - self.buffer.write(data); - } - - /// Write a slice of bytes to the buffer. - pub fn write_slice(&mut self, slice: &[u8]) { - self.buffer.write_slice(slice); - } - - /// Hash the public values. - pub fn hash(&self) -> Vec { - let mut hasher = Sha256::new(); - hasher.update(self.buffer.data.as_slice()); - hasher.finalize().to_vec() - } - - /// Hash the public values, mask the top 3 bits and return a BigUint. Matches the implementation - /// of `hashPublicValues` in the Solidity verifier. - /// - /// ```solidity - /// sha256(publicValues) & bytes32(uint256((1 << 253) - 1)); - /// ``` - pub fn hash_bn254(&self) -> BigUint { - // Hash the public values. - let mut hasher = Sha256::new(); - hasher.update(self.buffer.data.as_slice()); - let hash_result = hasher.finalize(); - let mut hash = hash_result.to_vec(); - - // Mask the top 3 bits. - hash[0] &= 0b00011111; - - // Return the masked hash as a BigUint. - BigUint::from_bytes_be(&hash) - } -} - -impl AsRef<[u8]> for SP1PublicValues { - fn as_ref(&self) -> &[u8] { - &self.buffer.data - } -} - pub mod proof_serde { use serde::{de::DeserializeOwned, Deserialize, Deserializer, Serialize}; use sp1_stark::{MachineProof, StarkGenericConfig}; @@ -183,23 +97,3 @@ pub mod proof_serde { } } } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_hash_public_values() { - let test_hex = "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"; - let test_bytes = hex::decode(test_hex).unwrap(); - - let mut public_values = SP1PublicValues::new(); - public_values.write_slice(&test_bytes); - let hash = public_values.hash_bn254(); - - let expected_hash = "1ce987d0a7fcc2636fe87e69295ba12b1cc46c256b369ae7401c51b805ee91bd"; - let expected_hash_biguint = BigUint::from_bytes_be(&hex::decode(expected_hash).unwrap()); - - assert_eq!(hash, expected_hash_biguint); - } -} diff --git a/crates/core/machine/src/syscall/precompiles/keccak256/air.rs b/crates/core/machine/src/syscall/precompiles/keccak256/air.rs index 4a17ea1b3c..7cce1d615c 100644 --- a/crates/core/machine/src/syscall/precompiles/keccak256/air.rs +++ b/crates/core/machine/src/syscall/precompiles/keccak256/air.rs @@ -145,10 +145,11 @@ where #[cfg(test)] mod test { use crate::{ - io::{SP1PublicValues, SP1Stdin}, + io::SP1Stdin, riscv::RiscvAir, utils::{prove, setup_logger, tests::KECCAK256_ELF}, }; + use sp1_primitives::io::SP1PublicValues; use rand::{Rng, SeedableRng}; use sp1_core_executor::Program; diff --git a/crates/core/machine/src/utils/buffer.rs b/crates/core/machine/src/utils/buffer.rs deleted file mode 100644 index 96f8952cd3..0000000000 --- a/crates/core/machine/src/utils/buffer.rs +++ /dev/null @@ -1,56 +0,0 @@ -use serde::{de::DeserializeOwned, Deserialize, Serialize}; - -/// A buffer of serializable/deserializable objects. -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct Buffer { - pub data: Vec, - #[serde(skip)] - pub ptr: usize, -} - -impl Buffer { - pub const fn new() -> Self { - Self { data: Vec::new(), ptr: 0 } - } - - pub fn from(data: &[u8]) -> Self { - Self { data: data.to_vec(), ptr: 0 } - } - - /// Set the position ptr to the beginning of the buffer. - pub fn head(&mut self) { - self.ptr = 0; - } - - /// Read the serializable object from the buffer. - pub fn read(&mut self) -> T { - let result: T = - bincode::deserialize(&self.data[self.ptr..]).expect("failed to deserialize"); - let nb_bytes = bincode::serialized_size(&result).expect("failed to get serialized size"); - self.ptr += nb_bytes as usize; - result - } - - pub fn read_slice(&mut self, slice: &mut [u8]) { - slice.copy_from_slice(&self.data[self.ptr..self.ptr + slice.len()]); - self.ptr += slice.len(); - } - - /// Write the serializable object from the buffer. - pub fn write(&mut self, data: &T) { - let mut tmp = Vec::new(); - bincode::serialize_into(&mut tmp, data).expect("serialization failed"); - self.data.extend(tmp); - } - - /// Write the slice of bytes to the buffer. - pub fn write_slice(&mut self, slice: &[u8]) { - self.data.extend_from_slice(slice); - } -} - -impl Default for Buffer { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/core/machine/src/utils/mod.rs b/crates/core/machine/src/utils/mod.rs index 38d6500528..cb54e568d5 100644 --- a/crates/core/machine/src/utils/mod.rs +++ b/crates/core/machine/src/utils/mod.rs @@ -1,4 +1,3 @@ -mod buffer; pub mod concurrency; mod logger; #[cfg(any(test, feature = "programs"))] @@ -7,7 +6,6 @@ mod prove; mod span; mod tracer; -pub use buffer::*; pub use logger::*; pub use prove::*; use sp1_curves::params::Limbs; diff --git a/crates/core/machine/src/utils/prove.rs b/crates/core/machine/src/utils/prove.rs index 5f12c7dd70..24263b7fdb 100644 --- a/crates/core/machine/src/utils/prove.rs +++ b/crates/core/machine/src/utils/prove.rs @@ -20,12 +20,13 @@ use thiserror::Error; use p3_baby_bear::BabyBear; use p3_field::PrimeField32; -use crate::riscv::cost::CostEstimator; use crate::{ - io::{SP1PublicValues, SP1Stdin}, + io::SP1Stdin, + riscv::cost::CostEstimator, utils::{chunk_vec, concurrency::TurnBasedSync}, }; use sp1_core_executor::events::sorted_table_lines; +use sp1_primitives::io::SP1PublicValues; use sp1_core_executor::{ subproof::NoOpSubproofVerifier, ExecutionError, ExecutionRecord, ExecutionReport, Executor, diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index e8b6c7bf89..e817ed23fd 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -10,9 +10,14 @@ keywords = { workspace = true } categories = { workspace = true } [dependencies] +bincode = "1.3.3" +hex = "0.4.3" lazy_static = "1.5.0" +num-bigint = { version = "0.4.6", default-features = false } p3-field = { workspace = true } p3-baby-bear = { workspace = true } p3-poseidon2 = { workspace = true } p3-symmetric = { workspace = true } +serde = { version = "1.0.207", features = ["derive"] } +sha2 = "0.10.8" itertools = "0.13.0" diff --git a/crates/primitives/src/io.rs b/crates/primitives/src/io.rs new file mode 100644 index 0000000000..0d4d89e957 --- /dev/null +++ b/crates/primitives/src/io.rs @@ -0,0 +1,107 @@ +use crate::types::Buffer; +use num_bigint::BigUint; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use sha2::{Digest, Sha256}; + +/// Public values for the prover. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct SP1PublicValues { + buffer: Buffer, +} + +impl SP1PublicValues { + /// Create a new `SP1PublicValues`. + pub const fn new() -> Self { + Self { buffer: Buffer::new() } + } + + pub fn raw(&self) -> String { + format!("0x{}", hex::encode(self.buffer.data.clone())) + } + + /// Create a `SP1PublicValues` from a slice of bytes. + pub fn from(data: &[u8]) -> Self { + Self { buffer: Buffer::from(data) } + } + + pub fn as_slice(&self) -> &[u8] { + self.buffer.data.as_slice() + } + + pub fn to_vec(&self) -> Vec { + self.buffer.data.clone() + } + + /// Read a value from the buffer. + pub fn read(&mut self) -> T { + self.buffer.read() + } + + /// Read a slice of bytes from the buffer. + pub fn read_slice(&mut self, slice: &mut [u8]) { + self.buffer.read_slice(slice); + } + + /// Write a value to the buffer. + pub fn write(&mut self, data: &T) { + self.buffer.write(data); + } + + /// Write a slice of bytes to the buffer. + pub fn write_slice(&mut self, slice: &[u8]) { + self.buffer.write_slice(slice); + } + + /// Hash the public values. + pub fn hash(&self) -> Vec { + let mut hasher = Sha256::new(); + hasher.update(self.buffer.data.as_slice()); + hasher.finalize().to_vec() + } + + /// Hash the public values, mask the top 3 bits and return a BigUint. Matches the implementation + /// of `hashPublicValues` in the Solidity verifier. + /// + /// ```solidity + /// sha256(publicValues) & bytes32(uint256((1 << 253) - 1)); + /// ``` + pub fn hash_bn254(&self) -> BigUint { + // Hash the public values. + let mut hasher = Sha256::new(); + hasher.update(self.buffer.data.as_slice()); + let hash_result = hasher.finalize(); + let mut hash = hash_result.to_vec(); + + // Mask the top 3 bits. + hash[0] &= 0b00011111; + + // Return the masked hash as a BigUint. + BigUint::from_bytes_be(&hash) + } +} + +impl AsRef<[u8]> for SP1PublicValues { + fn as_ref(&self) -> &[u8] { + &self.buffer.data + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_hash_public_values() { + let test_hex = "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"; + let test_bytes = hex::decode(test_hex).unwrap(); + + let mut public_values = SP1PublicValues::new(); + public_values.write_slice(&test_bytes); + let hash = public_values.hash_bn254(); + + let expected_hash = "1ce987d0a7fcc2636fe87e69295ba12b1cc46c256b369ae7401c51b805ee91bd"; + let expected_hash_biguint = BigUint::from_bytes_be(&hex::decode(expected_hash).unwrap()); + + assert_eq!(hash, expected_hash_biguint); + } +} diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 190524acdf..53ab9b8652 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -7,6 +7,7 @@ use p3_field::AbstractField; use p3_poseidon2::{Poseidon2, Poseidon2ExternalMatrixGeneral}; pub mod consts; +pub mod io; pub mod types; lazy_static! { diff --git a/crates/primitives/src/types.rs b/crates/primitives/src/types.rs index c75d210cc1..6e0e2d326d 100644 --- a/crates/primitives/src/types.rs +++ b/crates/primitives/src/types.rs @@ -1,3 +1,5 @@ +use serde::{de::DeserializeOwned, Deserialize, Serialize}; + #[derive(Debug, Clone, Copy)] pub enum RecursionProgramType { Core, @@ -6,3 +8,58 @@ pub enum RecursionProgramType { Shrink, Wrap, } + +/// A buffer of serializable/deserializable objects. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Buffer { + pub data: Vec, + #[serde(skip)] + pub ptr: usize, +} + +impl Buffer { + pub const fn new() -> Self { + Self { data: Vec::new(), ptr: 0 } + } + + pub fn from(data: &[u8]) -> Self { + Self { data: data.to_vec(), ptr: 0 } + } + + /// Set the position ptr to the beginning of the buffer. + pub fn head(&mut self) { + self.ptr = 0; + } + + /// Read the serializable object from the buffer. + pub fn read(&mut self) -> T { + let result: T = + bincode::deserialize(&self.data[self.ptr..]).expect("failed to deserialize"); + let nb_bytes = bincode::serialized_size(&result).expect("failed to get serialized size"); + self.ptr += nb_bytes as usize; + result + } + + pub fn read_slice(&mut self, slice: &mut [u8]) { + slice.copy_from_slice(&self.data[self.ptr..self.ptr + slice.len()]); + self.ptr += slice.len(); + } + + /// Write the serializable object from the buffer. + pub fn write(&mut self, data: &T) { + let mut tmp = Vec::new(); + bincode::serialize_into(&mut tmp, data).expect("serialization failed"); + self.data.extend(tmp); + } + + /// Write the slice of bytes to the buffer. + pub fn write_slice(&mut self, slice: &[u8]) { + self.data.extend_from_slice(slice); + } +} + +impl Default for Buffer { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/prover/src/init.rs b/crates/prover/src/init.rs index 52ca606a22..933a899ba4 100644 --- a/crates/prover/src/init.rs +++ b/crates/prover/src/init.rs @@ -1,6 +1,7 @@ use crate::components::SP1ProverComponents; use p3_baby_bear::BabyBear; -pub use sp1_core_machine::io::{SP1PublicValues, SP1Stdin}; +pub use sp1_core_machine::io::SP1Stdin; +pub use sp1_primitives::io::SP1PublicValues; use sp1_primitives::types::RecursionProgramType; use sp1_recursion_compiler::config::InnerConfig; use sp1_recursion_core::runtime::RecursionProgram; diff --git a/crates/prover/src/types.rs b/crates/prover/src/types.rs index 95bc5d8a6c..a2cd780286 100644 --- a/crates/prover/src/types.rs +++ b/crates/prover/src/types.rs @@ -6,11 +6,8 @@ use p3_bn254_fr::Bn254Fr; use p3_commit::{Pcs, TwoAdicMultiplicativeCoset}; use p3_field::{AbstractField, PrimeField, PrimeField32, TwoAdicField}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use sp1_core_machine::{ - io::{SP1PublicValues, SP1Stdin}, - riscv::RiscvAir, -}; -use sp1_primitives::poseidon2_hash; +use sp1_core_machine::{io::SP1Stdin, riscv::RiscvAir}; +use sp1_primitives::{io::SP1PublicValues, poseidon2_hash}; use sp1_recursion_core::{air::RecursionPublicValues, stark::config::BabyBearPoseidon2Outer}; use sp1_recursion_gnark_ffi::proof::{Groth16Bn254Proof, PlonkBn254Proof}; use sp1_recursion_program::machine::{ diff --git a/crates/prover/src/verify.rs b/crates/prover/src/verify.rs index 99cf818d01..a1e180f002 100644 --- a/crates/prover/src/verify.rs +++ b/crates/prover/src/verify.rs @@ -5,8 +5,8 @@ use num_bigint::BigUint; use p3_baby_bear::BabyBear; use p3_field::{AbstractField, PrimeField}; use sp1_core_executor::subproof::SubproofVerifier; -use sp1_core_machine::{cpu::MAX_CPU_LOG_DEGREE, io::SP1PublicValues}; -use sp1_primitives::consts::WORD_SIZE; +use sp1_core_machine::cpu::MAX_CPU_LOG_DEGREE; +use sp1_primitives::{consts::WORD_SIZE, io::SP1PublicValues}; use sp1_recursion_core::{air::RecursionPublicValues, stark::config::BabyBearPoseidon2Outer}; use sp1_recursion_gnark_ffi::{ Groth16Bn254Proof, Groth16Bn254Prover, PlonkBn254Proof, PlonkBn254Prover, diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml index ada8973cea..a394f142e0 100644 --- a/crates/sdk/Cargo.toml +++ b/crates/sdk/Cargo.toml @@ -52,6 +52,7 @@ hashbrown = "0.14.5" sysinfo = "0.30.13" sp1-core-executor = { workspace = true } sp1-stark = { workspace = true } +sp1-primitives = { workspace = true } getrandom = { version = "0.2.15", features = ["custom", "js"] } itertools = "0.13.0" diff --git a/crates/sdk/src/action.rs b/crates/sdk/src/action.rs index 40344b9ce0..48f8ae7da3 100644 --- a/crates/sdk/src/action.rs +++ b/crates/sdk/src/action.rs @@ -1,5 +1,6 @@ use sp1_core_executor::{ExecutionReport, HookEnv, SP1ContextBuilder}; -use sp1_core_machine::io::{SP1PublicValues, SP1Stdin}; +use sp1_core_machine::io::SP1Stdin; +use sp1_primitives::io::SP1PublicValues; use sp1_prover::{components::DefaultProverComponents, SP1ProvingKey}; use anyhow::{Ok, Result}; diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs index bb869b5d33..d8b572a88f 100644 --- a/crates/sdk/src/lib.rs +++ b/crates/sdk/src/lib.rs @@ -39,9 +39,8 @@ use {std::future::Future, tokio::task::block_in_place}; pub use provers::{CpuProver, MockProver, Prover}; pub use sp1_core_executor::{ExecutionReport, HookEnv, SP1Context, SP1ContextBuilder}; -pub use sp1_core_machine::{ - io::SP1PublicValues, io::SP1Stdin, riscv::cost::CostEstimator, SP1_CIRCUIT_VERSION, -}; +pub use sp1_core_machine::{io::SP1Stdin, riscv::cost::CostEstimator, SP1_CIRCUIT_VERSION}; +pub use sp1_primitives::io::SP1PublicValues; pub use sp1_prover::{ CoreSC, HashableKey, InnerSC, OuterSC, PlonkBn254Proof, SP1Prover, SP1ProvingKey, SP1VerifyingKey, diff --git a/crates/sdk/src/proof.rs b/crates/sdk/src/proof.rs index d22621d7f1..13a7b99520 100644 --- a/crates/sdk/src/proof.rs +++ b/crates/sdk/src/proof.rs @@ -2,7 +2,8 @@ use std::{fmt::Debug, fs::File, path::Path}; use anyhow::Result; use serde::{Deserialize, Serialize}; -use sp1_core_machine::io::{SP1PublicValues, SP1Stdin}; +use sp1_core_machine::io::SP1Stdin; +use sp1_primitives::io::SP1PublicValues; use strum_macros::{EnumDiscriminants, EnumTryAs}; use sp1_prover::{CoreSC, Groth16Bn254Proof, InnerSC, PlonkBn254Proof}; diff --git a/examples/Cargo.lock b/examples/Cargo.lock index ac3fe60b6d..d05470e0bf 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock @@ -4970,7 +4970,7 @@ dependencies = [ [[package]] name = "sp1-build" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "cargo_metadata", @@ -4981,7 +4981,7 @@ dependencies = [ [[package]] name = "sp1-core-executor" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "bytemuck", @@ -5017,7 +5017,7 @@ dependencies = [ [[package]] name = "sp1-core-machine" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "arrayref", @@ -5036,7 +5036,6 @@ dependencies = [ "log", "nohash-hasher", "num", - "num-bigint 0.4.6", "num_cpus", "p3-air", "p3-baby-bear", @@ -5081,7 +5080,7 @@ dependencies = [ [[package]] name = "sp1-cuda" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "ctrlc", @@ -5100,7 +5099,7 @@ dependencies = [ [[package]] name = "sp1-curves" -version = "1.2.0" +version = "2.0.0" dependencies = [ "curve25519-dalek", "dashu", @@ -5119,7 +5118,7 @@ dependencies = [ [[package]] name = "sp1-derive" -version = "1.2.0" +version = "2.0.0" dependencies = [ "proc-macro2", "quote", @@ -5128,19 +5127,24 @@ dependencies = [ [[package]] name = "sp1-primitives" -version = "1.2.0" +version = "2.0.0" dependencies = [ + "bincode", + "hex", "itertools 0.13.0", "lazy_static", + "num-bigint 0.4.6", "p3-baby-bear", "p3-field", "p3-poseidon2", "p3-symmetric", + "serde", + "sha2 0.10.8", ] [[package]] name = "sp1-prover" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -5178,7 +5182,7 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "itertools 0.13.0", @@ -5201,7 +5205,7 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" -version = "1.2.0" +version = "2.0.0" dependencies = [ "backtrace", "itertools 0.13.0", @@ -5229,7 +5233,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -version = "1.2.0" +version = "2.0.0" dependencies = [ "arrayref", "backtrace", @@ -5265,7 +5269,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core-v2" -version = "1.2.0" +version = "2.0.0" dependencies = [ "arrayref", "backtrace", @@ -5304,7 +5308,7 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -version = "1.2.0" +version = "2.0.0" dependencies = [ "proc-macro2", "quote", @@ -5313,7 +5317,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -5338,7 +5342,7 @@ dependencies = [ [[package]] name = "sp1-recursion-program" -version = "1.2.0" +version = "2.0.0" dependencies = [ "itertools 0.13.0", "p3-air", @@ -5368,7 +5372,7 @@ dependencies = [ [[package]] name = "sp1-sdk" -version = "1.2.0" +version = "2.0.0" dependencies = [ "alloy-sol-types", "anyhow", @@ -5382,6 +5386,7 @@ dependencies = [ "hashbrown 0.14.5", "hex", "indicatif", + "itertools 0.13.0", "log", "num-bigint 0.4.6", "p3-baby-bear", @@ -5398,6 +5403,7 @@ dependencies = [ "sp1-core-executor", "sp1-core-machine", "sp1-cuda", + "sp1-primitives", "sp1-prover", "sp1-stark", "strum", @@ -5413,7 +5419,7 @@ dependencies = [ [[package]] name = "sp1-stark" -version = "1.2.0" +version = "2.0.0" dependencies = [ "arrayref", "getrandom", diff --git a/examples/aggregation/program/Cargo.lock b/examples/aggregation/program/Cargo.lock index 57b07bc689..a250d713c9 100644 --- a/examples/aggregation/program/Cargo.lock +++ b/examples/aggregation/program/Cargo.lock @@ -215,9 +215,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -477,18 +477,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -517,7 +517,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.1.1" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -529,19 +529,24 @@ dependencies = [ [[package]] name = "sp1-primitives" -version = "1.1.1" +version = "2.0.0" dependencies = [ + "bincode", + "hex", "itertools 0.13.0", "lazy_static", + "num-bigint", "p3-baby-bear", "p3-field", "p3-poseidon2", "p3-symmetric", + "serde", + "sha2", ] [[package]] name = "sp1-zkvm" -version = "1.1.1" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", diff --git a/examples/chess/program/Cargo.lock b/examples/chess/program/Cargo.lock index 43da74aea7..4d54ded2e4 100644 --- a/examples/chess/program/Cargo.lock +++ b/examples/chess/program/Cargo.lock @@ -494,7 +494,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.1.1" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -506,7 +506,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.1.1" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", diff --git a/examples/fibonacci/program/Cargo.lock b/examples/fibonacci/program/Cargo.lock index bf06ad227b..bf01c4af10 100644 --- a/examples/fibonacci/program/Cargo.lock +++ b/examples/fibonacci/program/Cargo.lock @@ -335,7 +335,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -347,7 +347,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", diff --git a/examples/io/program/Cargo.lock b/examples/io/program/Cargo.lock index 99d7258ba2..a436fde9c1 100644 --- a/examples/io/program/Cargo.lock +++ b/examples/io/program/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.1.1" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -348,7 +348,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.1.1" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", diff --git a/examples/json/program/Cargo.lock b/examples/json/program/Cargo.lock index b57093df70..1a941a255c 100644 --- a/examples/json/program/Cargo.lock +++ b/examples/json/program/Cargo.lock @@ -368,7 +368,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.1.1" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -380,7 +380,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.1.1" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", diff --git a/examples/patch-testing/program/Cargo.lock b/examples/patch-testing/program/Cargo.lock index 306b5ac40a..b0ab6be5d6 100644 --- a/examples/patch-testing/program/Cargo.lock +++ b/examples/patch-testing/program/Cargo.lock @@ -1262,7 +1262,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.1.1" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -1274,7 +1274,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.1.1" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", @@ -1285,7 +1285,7 @@ dependencies = [ "rand", "serde", "sha2 0.10.8", - "sp1-lib 1.1.1", + "sp1-lib 2.0.0", ] [[package]] diff --git a/examples/regex/program/Cargo.lock b/examples/regex/program/Cargo.lock index 53116ab999..94daa223f3 100644 --- a/examples/regex/program/Cargo.lock +++ b/examples/regex/program/Cargo.lock @@ -374,7 +374,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.1.1" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -386,7 +386,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.1.1" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", diff --git a/examples/rsa/program/Cargo.lock b/examples/rsa/program/Cargo.lock index c5fdebb49f..fef1330fb9 100644 --- a/examples/rsa/program/Cargo.lock +++ b/examples/rsa/program/Cargo.lock @@ -380,6 +380,8 @@ dependencies = [ [[package]] name = "rsa" version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ "const-oid", "digest", @@ -390,7 +392,6 @@ dependencies = [ "pkcs8", "rand_core", "signature", - "sp1-derive", "spki", "subtle", "zeroize", @@ -487,20 +488,9 @@ dependencies = [ "scale-info", ] -[[package]] -name = "sp1-derive" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d06fdae1dc74a9085b155d12180825653e530983262b8ad2e57fe15551d17a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sp1-lib" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -512,7 +502,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", diff --git a/examples/ssz-withdrawals/program/Cargo.lock b/examples/ssz-withdrawals/program/Cargo.lock index 9c359473a1..6dc99b9f40 100644 --- a/examples/ssz-withdrawals/program/Cargo.lock +++ b/examples/ssz-withdrawals/program/Cargo.lock @@ -1346,7 +1346,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.1.1" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -1358,7 +1358,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.1.1" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", diff --git a/examples/tendermint/program/Cargo.lock b/examples/tendermint/program/Cargo.lock index 9099d055b5..d3dc931636 100644 --- a/examples/tendermint/program/Cargo.lock +++ b/examples/tendermint/program/Cargo.lock @@ -691,7 +691,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -703,7 +703,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "cfg-if",