@@ -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:: {
@@ -63,6 +65,7 @@ pub struct SdkVmConfig {
63
65
pub rv32i : Option < UnitStruct > ,
64
66
pub io : Option < UnitStruct > ,
65
67
pub keccak : Option < UnitStruct > ,
68
+ pub memcpy : Option < UnitStruct > ,
66
69
pub sha256 : Option < UnitStruct > ,
67
70
pub native : Option < UnitStruct > ,
68
71
pub castf : Option < UnitStruct > ,
@@ -100,6 +103,7 @@ impl SdkVmConfig {
100
103
. rv32m ( Default :: default ( ) )
101
104
. io ( Default :: default ( ) )
102
105
. keccak ( Default :: default ( ) )
106
+ . memcpy ( Default :: default ( ) )
103
107
. sha256 ( Default :: default ( ) )
104
108
. bigint ( Default :: default ( ) )
105
109
. modular ( ModularExtension :: new ( vec ! [
@@ -181,6 +185,9 @@ impl TranspilerConfig<F> for SdkVmConfig {
181
185
if self . keccak . is_some ( ) {
182
186
transpiler = transpiler. with_extension ( Keccak256TranspilerExtension ) ;
183
187
}
188
+ if self . memcpy . is_some ( ) {
189
+ transpiler = transpiler. with_extension ( MemcpyTranspilerExtension ) ;
190
+ }
184
191
if self . sha256 . is_some ( ) {
185
192
transpiler = transpiler. with_extension ( Sha256TranspilerExtension ) ;
186
193
}
@@ -251,6 +258,7 @@ impl SdkVmConfig {
251
258
let rv32i = config. rv32i . map ( |_| Rv32I ) ;
252
259
let io = config. io . map ( |_| Rv32Io ) ;
253
260
let keccak = config. keccak . map ( |_| Keccak256 ) ;
261
+ let memcpy = config. memcpy . map ( |_| Memcpy ) ;
254
262
let sha256 = config. sha256 . map ( |_| Sha256 ) ;
255
263
let native = config. native . map ( |_| Native ) ;
256
264
let castf = config. castf . map ( |_| CastFExtension ) ;
@@ -266,6 +274,7 @@ impl SdkVmConfig {
266
274
rv32i,
267
275
io,
268
276
keccak,
277
+ memcpy,
269
278
sha256,
270
279
native,
271
280
castf,
@@ -297,6 +306,8 @@ pub struct SdkVmConfigInner {
297
306
pub io : Option < Rv32Io > ,
298
307
#[ extension( executor = "Keccak256Executor" ) ]
299
308
pub keccak : Option < Keccak256 > ,
309
+ #[ extension( executor = "MemcpyExecutor" ) ]
310
+ pub memcpy : Option < Memcpy > ,
300
311
#[ extension( executor = "Sha256Executor" ) ]
301
312
pub sha256 : Option < Sha256 > ,
302
313
#[ extension( executor = "NativeExecutor<F>" ) ]
@@ -374,6 +385,9 @@ where
374
385
if let Some ( keccak) = & config. keccak {
375
386
VmProverExtension :: < E , _ , _ > :: extend_prover ( & Keccak256CpuProverExt , keccak, inventory) ?;
376
387
}
388
+ if let Some ( memcpy) = & config. memcpy {
389
+ VmProverExtension :: < E , _ , _ > :: extend_prover ( & MemcpyCpuProverExt , memcpy, inventory) ?;
390
+ }
377
391
if let Some ( sha256) = & config. sha256 {
378
392
VmProverExtension :: < E , _ , _ > :: extend_prover ( & Sha2CpuProverExt , sha256, inventory) ?;
379
393
}
@@ -485,6 +499,12 @@ impl From<Keccak256> for UnitStruct {
485
499
}
486
500
}
487
501
502
+ impl From < Memcpy > for UnitStruct {
503
+ fn from ( _: Memcpy ) -> Self {
504
+ UnitStruct { }
505
+ }
506
+ }
507
+
488
508
impl From < Sha256 > for UnitStruct {
489
509
fn from ( _: Sha256 ) -> Self {
490
510
UnitStruct { }
@@ -511,6 +531,7 @@ struct SdkVmConfigWithDefaultDeser {
511
531
pub rv32i : Option < UnitStruct > ,
512
532
pub io : Option < UnitStruct > ,
513
533
pub keccak : Option < UnitStruct > ,
534
+ pub memcpy : Option < UnitStruct > ,
514
535
pub sha256 : Option < UnitStruct > ,
515
536
pub native : Option < UnitStruct > ,
516
537
pub castf : Option < UnitStruct > ,
@@ -530,6 +551,7 @@ impl From<SdkVmConfigWithDefaultDeser> for SdkVmConfig {
530
551
rv32i : config. rv32i ,
531
552
io : config. io ,
532
553
keccak : config. keccak ,
554
+ memcpy : config. memcpy ,
533
555
sha256 : config. sha256 ,
534
556
native : config. native ,
535
557
castf : config. castf ,
0 commit comments