@@ -124,7 +124,9 @@ where
124124 PCS : CommitmentScheme < Field = F > ,
125125{
126126 pub generators : PCS :: VerifierSetup ,
127- pub shared : JoltSharedPreprocessing ,
127+ pub bytecode : BytecodePreprocessing ,
128+ pub ram : RAMPreprocessing ,
129+ pub memory_layout : MemoryLayout ,
128130}
129131
130132impl < F , PCS > Serializable for JoltVerifierPreprocessing < F , PCS >
@@ -164,7 +166,9 @@ where
164166 PCS : CommitmentScheme < Field = F > ,
165167{
166168 pub generators : PCS :: ProverSetup ,
167- pub shared : JoltSharedPreprocessing ,
169+ pub bytecode : BytecodePreprocessing ,
170+ pub ram : RAMPreprocessing ,
171+ pub memory_layout : MemoryLayout ,
168172}
169173
170174impl < F , PCS > Serializable for JoltProverPreprocessing < F , PCS >
@@ -206,7 +210,9 @@ where
206210 let generators = PCS :: setup_verifier ( & preprocessing. generators ) ;
207211 JoltVerifierPreprocessing {
208212 generators,
209- shared : preprocessing. shared . clone ( ) ,
213+ bytecode : preprocessing. bytecode . clone ( ) ,
214+ ram : preprocessing. ram . clone ( ) ,
215+ memory_layout : preprocessing. memory_layout . clone ( ) ,
210216 }
211217 }
212218}
@@ -224,35 +230,25 @@ where
224230}
225231
226232pub trait Jolt < F : JoltField , PCS : StreamingCommitmentScheme < Field = F > , FS : Transcript > {
227- fn shared_preprocess (
228- bytecode : Vec < Instruction > ,
229- memory_layout : MemoryLayout ,
230- memory_init : Vec < ( u64 , u8 ) > ,
231- ) -> JoltSharedPreprocessing {
232- let bytecode_preprocessing = BytecodePreprocessing :: preprocess ( bytecode) ;
233- let ram_preprocessing = RAMPreprocessing :: preprocess ( memory_init) ;
234-
235- JoltSharedPreprocessing {
236- memory_layout,
237- bytecode : bytecode_preprocessing,
238- ram : ram_preprocessing,
239- }
240- }
241-
242233 #[ tracing:: instrument( skip_all, name = "Jolt::prover_preprocess" ) ]
243234 fn prover_preprocess (
244235 bytecode : Vec < Instruction > ,
245236 memory_layout : MemoryLayout ,
246237 memory_init : Vec < ( u64 , u8 ) > ,
247238 max_trace_length : usize ,
248239 ) -> JoltProverPreprocessing < F , PCS > {
249- let shared = Self :: shared_preprocess ( bytecode, memory_layout, memory_init) ;
240+ let bytecode = BytecodePreprocessing :: preprocess ( bytecode) ;
241+ let ram = RAMPreprocessing :: preprocess ( memory_init) ;
250242
251243 let max_T: usize = max_trace_length. next_power_of_two ( ) ;
252-
253244 let generators = PCS :: setup_prover ( DTH_ROOT_OF_K . log_2 ( ) + max_T. log_2 ( ) ) ;
254245
255- JoltProverPreprocessing { generators, shared }
246+ JoltProverPreprocessing {
247+ generators,
248+ bytecode,
249+ ram,
250+ memory_layout,
251+ }
256252 }
257253
258254 #[ allow( clippy:: type_complexity) ]
@@ -276,13 +272,13 @@ pub trait Jolt<F: JoltField, PCS: StreamingCommitmentScheme<Field = F>, FS: Tran
276272 use tracer:: instruction:: Cycle ;
277273
278274 let memory_config = MemoryConfig {
279- max_untrusted_advice_size : preprocessing. shared . memory_layout . max_untrusted_advice_size ,
280- max_trusted_advice_size : preprocessing. shared . memory_layout . max_trusted_advice_size ,
281- max_input_size : preprocessing. shared . memory_layout . max_input_size ,
282- max_output_size : preprocessing. shared . memory_layout . max_output_size ,
283- stack_size : preprocessing. shared . memory_layout . stack_size ,
284- memory_size : preprocessing. shared . memory_layout . memory_size ,
285- program_size : Some ( preprocessing. shared . memory_layout . program_size ) ,
275+ max_untrusted_advice_size : preprocessing. memory_layout . max_untrusted_advice_size ,
276+ max_trusted_advice_size : preprocessing. memory_layout . max_trusted_advice_size ,
277+ max_input_size : preprocessing. memory_layout . max_input_size ,
278+ max_output_size : preprocessing. memory_layout . max_output_size ,
279+ stack_size : preprocessing. memory_layout . stack_size ,
280+ memory_size : preprocessing. memory_layout . memory_size ,
281+ program_size : Some ( preprocessing. memory_layout . program_size ) ,
286282 } ;
287283
288284 let ( lazy_trace, mut trace, final_memory_state, mut program_io) = {
@@ -382,13 +378,13 @@ pub trait Jolt<F: JoltField, PCS: StreamingCommitmentScheme<Field = F>, FS: Tran
382378 let _guard = DoryGlobals :: initialize ( DTH_ROOT_OF_K , T ) ;
383379
384380 // Memory layout checks
385- if program_io. memory_layout != preprocessing. shared . memory_layout {
381+ if program_io. memory_layout != preprocessing. memory_layout {
386382 return Err ( ProofVerifyError :: MemoryLayoutMismatch ) ;
387383 }
388- if program_io. inputs . len ( ) > preprocessing. shared . memory_layout . max_input_size as usize {
384+ if program_io. inputs . len ( ) > preprocessing. memory_layout . max_input_size as usize {
389385 return Err ( ProofVerifyError :: InputTooLarge ) ;
390386 }
391- if program_io. outputs . len ( ) > preprocessing. shared . memory_layout . max_output_size as usize {
387+ if program_io. outputs . len ( ) > preprocessing. memory_layout . max_output_size as usize {
392388 return Err ( ProofVerifyError :: OutputTooLarge ) ;
393389 }
394390
0 commit comments