@@ -32,6 +32,8 @@ use openvm_rv32im_circuit::{
32
32
use openvm_rv32im_transpiler:: {
33
33
Rv32ITranspilerExtension , Rv32IoTranspilerExtension , Rv32MTranspilerExtension ,
34
34
} ;
35
+ use openvm_memcpy_circuit:: { Memcpy , MemcpyCpuProverExt , MemcpyExecutor } ;
36
+ use openvm_memcpy_transpiler:: MemcpyTranspilerExtension ;
35
37
use openvm_sha256_circuit:: { Sha256 , Sha256Executor , Sha2CpuProverExt } ;
36
38
use openvm_sha256_transpiler:: Sha256TranspilerExtension ;
37
39
use openvm_stark_backend:: {
@@ -52,6 +54,7 @@ pub struct SdkVmConfig {
52
54
pub rv32i : Option < UnitStruct > ,
53
55
pub io : Option < UnitStruct > ,
54
56
pub keccak : Option < UnitStruct > ,
57
+ pub memcpy : Option < UnitStruct > ,
55
58
pub sha256 : Option < UnitStruct > ,
56
59
pub native : Option < UnitStruct > ,
57
60
pub castf : Option < UnitStruct > ,
@@ -79,6 +82,8 @@ pub struct SdkVmConfigInner {
79
82
pub io : Option < Rv32Io > ,
80
83
#[ extension( executor = "Keccak256Executor" ) ]
81
84
pub keccak : Option < Keccak256 > ,
85
+ #[ extension( executor = "MemcpyExecutor" ) ]
86
+ pub memcpy : Option < Memcpy > ,
82
87
#[ extension( executor = "Sha256Executor" ) ]
83
88
pub sha256 : Option < Sha256 > ,
84
89
#[ extension( executor = "NativeExecutor<F>" ) ]
@@ -115,6 +120,9 @@ impl SdkVmConfig {
115
120
if self . keccak . is_some ( ) {
116
121
transpiler = transpiler. with_extension ( Keccak256TranspilerExtension ) ;
117
122
}
123
+ if self . memcpy . is_some ( ) {
124
+ transpiler = transpiler. with_extension ( MemcpyTranspilerExtension ) ;
125
+ }
118
126
if self . sha256 . is_some ( ) {
119
127
transpiler = transpiler. with_extension ( Sha256TranspilerExtension ) ;
120
128
}
@@ -166,6 +174,7 @@ impl SdkVmConfig {
166
174
let rv32i = self . rv32i . map ( |_| Rv32I ) ;
167
175
let io = self . io . map ( |_| Rv32Io ) ;
168
176
let keccak = self . keccak . map ( |_| Keccak256 ) ;
177
+ let memcpy = self . memcpy . map ( |_| Memcpy ) ;
169
178
let sha256 = self . sha256 . map ( |_| Sha256 ) ;
170
179
let native = self . native . map ( |_| Native ) ;
171
180
let castf = self . castf . map ( |_| CastFExtension ) ;
@@ -190,6 +199,7 @@ impl SdkVmConfig {
190
199
rv32i,
191
200
io,
192
201
keccak,
202
+ memcpy,
193
203
sha256,
194
204
native,
195
205
castf,
@@ -256,6 +266,9 @@ where
256
266
if let Some ( keccak) = & config. keccak {
257
267
VmProverExtension :: < E , _ , _ > :: extend_prover ( & Keccak256CpuProverExt , keccak, inventory) ?;
258
268
}
269
+ if let Some ( memcpy) = & config. memcpy {
270
+ VmProverExtension :: < E , _ , _ > :: extend_prover ( & MemcpyCpuProverExt , memcpy, inventory) ?;
271
+ }
259
272
if let Some ( sha256) = & config. sha256 {
260
273
VmProverExtension :: < E , _ , _ > :: extend_prover ( & Sha2CpuProverExt , sha256, inventory) ?;
261
274
}
@@ -373,6 +386,12 @@ impl From<Keccak256> for UnitStruct {
373
386
}
374
387
}
375
388
389
+ impl From < Memcpy > for UnitStruct {
390
+ fn from ( _: Memcpy ) -> Self {
391
+ UnitStruct { }
392
+ }
393
+ }
394
+
376
395
impl From < Sha256 > for UnitStruct {
377
396
fn from ( _: Sha256 ) -> Self {
378
397
UnitStruct { }
@@ -399,6 +418,7 @@ struct SdkVmConfigWithDefaultDeser {
399
418
pub rv32i : Option < UnitStruct > ,
400
419
pub io : Option < UnitStruct > ,
401
420
pub keccak : Option < UnitStruct > ,
421
+ pub memcpy : Option < UnitStruct > ,
402
422
pub sha256 : Option < UnitStruct > ,
403
423
pub native : Option < UnitStruct > ,
404
424
pub castf : Option < UnitStruct > ,
@@ -424,6 +444,7 @@ impl From<SdkVmConfigWithDefaultDeser> for SdkVmConfig {
424
444
rv32i : config. rv32i ,
425
445
io : config. io ,
426
446
keccak : config. keccak ,
447
+ memcpy : config. memcpy ,
427
448
sha256 : config. sha256 ,
428
449
native : config. native ,
429
450
castf : config. castf ,
0 commit comments