@@ -33,6 +33,8 @@ use openvm_rv32im_circuit::{
33
33
use openvm_rv32im_transpiler:: {
34
34
Rv32ITranspilerExtension , Rv32IoTranspilerExtension , Rv32MTranspilerExtension ,
35
35
} ;
36
+ use openvm_memcpy_circuit:: { Memcpy , MemcpyCpuProverExt , MemcpyExecutor } ;
37
+ use openvm_memcpy_transpiler:: MemcpyTranspilerExtension ;
36
38
use openvm_sha256_circuit:: { Sha256 , Sha256Executor , Sha2CpuProverExt } ;
37
39
use openvm_sha256_transpiler:: Sha256TranspilerExtension ;
38
40
use openvm_stark_backend:: {
@@ -81,6 +83,7 @@ pub struct SdkVmConfig {
81
83
pub rv32i : Option < UnitStruct > ,
82
84
pub io : Option < UnitStruct > ,
83
85
pub keccak : Option < UnitStruct > ,
86
+ pub memcpy : Option < UnitStruct > ,
84
87
pub sha256 : Option < UnitStruct > ,
85
88
pub native : Option < UnitStruct > ,
86
89
pub castf : Option < UnitStruct > ,
@@ -118,6 +121,7 @@ impl SdkVmConfig {
118
121
. rv32m ( Default :: default ( ) )
119
122
. io ( Default :: default ( ) )
120
123
. keccak ( Default :: default ( ) )
124
+ . memcpy ( Default :: default ( ) )
121
125
. sha256 ( Default :: default ( ) )
122
126
. bigint ( Default :: default ( ) )
123
127
. modular ( ModularExtension :: new ( vec ! [
@@ -199,6 +203,9 @@ impl TranspilerConfig<F> for SdkVmConfig {
199
203
if self . keccak . is_some ( ) {
200
204
transpiler = transpiler. with_extension ( Keccak256TranspilerExtension ) ;
201
205
}
206
+ if self . memcpy . is_some ( ) {
207
+ transpiler = transpiler. with_extension ( MemcpyTranspilerExtension ) ;
208
+ }
202
209
if self . sha256 . is_some ( ) {
203
210
transpiler = transpiler. with_extension ( Sha256TranspilerExtension ) ;
204
211
}
@@ -269,6 +276,7 @@ impl SdkVmConfig {
269
276
let rv32i = config. rv32i . map ( |_| Rv32I ) ;
270
277
let io = config. io . map ( |_| Rv32Io ) ;
271
278
let keccak = config. keccak . map ( |_| Keccak256 ) ;
279
+ let memcpy = config. memcpy . map ( |_| Memcpy ) ;
272
280
let sha256 = config. sha256 . map ( |_| Sha256 ) ;
273
281
let native = config. native . map ( |_| Native ) ;
274
282
let castf = config. castf . map ( |_| CastFExtension ) ;
@@ -284,6 +292,7 @@ impl SdkVmConfig {
284
292
rv32i,
285
293
io,
286
294
keccak,
295
+ memcpy,
287
296
sha256,
288
297
native,
289
298
castf,
@@ -315,6 +324,8 @@ pub struct SdkVmConfigInner {
315
324
pub io : Option < Rv32Io > ,
316
325
#[ extension( executor = "Keccak256Executor" ) ]
317
326
pub keccak : Option < Keccak256 > ,
327
+ #[ extension( executor = "MemcpyExecutor" ) ]
328
+ pub memcpy : Option < Memcpy > ,
318
329
#[ extension( executor = "Sha256Executor" ) ]
319
330
pub sha256 : Option < Sha256 > ,
320
331
#[ extension( executor = "NativeExecutor<F>" ) ]
@@ -392,6 +403,9 @@ where
392
403
if let Some ( keccak) = & config. keccak {
393
404
VmProverExtension :: < E , _ , _ > :: extend_prover ( & Keccak256CpuProverExt , keccak, inventory) ?;
394
405
}
406
+ if let Some ( memcpy) = & config. memcpy {
407
+ VmProverExtension :: < E , _ , _ > :: extend_prover ( & MemcpyCpuProverExt , memcpy, inventory) ?;
408
+ }
395
409
if let Some ( sha256) = & config. sha256 {
396
410
VmProverExtension :: < E , _ , _ > :: extend_prover ( & Sha2CpuProverExt , sha256, inventory) ?;
397
411
}
@@ -566,6 +580,12 @@ impl From<Keccak256> for UnitStruct {
566
580
}
567
581
}
568
582
583
+ impl From < Memcpy > for UnitStruct {
584
+ fn from ( _: Memcpy ) -> Self {
585
+ UnitStruct { }
586
+ }
587
+ }
588
+
569
589
impl From < Sha256 > for UnitStruct {
570
590
fn from ( _: Sha256 ) -> Self {
571
591
UnitStruct { }
@@ -592,6 +612,7 @@ struct SdkVmConfigWithDefaultDeser {
592
612
pub rv32i : Option < UnitStruct > ,
593
613
pub io : Option < UnitStruct > ,
594
614
pub keccak : Option < UnitStruct > ,
615
+ pub memcpy : Option < UnitStruct > ,
595
616
pub sha256 : Option < UnitStruct > ,
596
617
pub native : Option < UnitStruct > ,
597
618
pub castf : Option < UnitStruct > ,
@@ -611,6 +632,7 @@ impl From<SdkVmConfigWithDefaultDeser> for SdkVmConfig {
611
632
rv32i : config. rv32i ,
612
633
io : config. io ,
613
634
keccak : config. keccak ,
635
+ memcpy : config. memcpy ,
614
636
sha256 : config. sha256 ,
615
637
native : config. native ,
616
638
castf : config. castf ,
0 commit comments