@@ -581,6 +581,39 @@ ExecutionResult WabtEngine::execute(
581
581
}
582
582
);
583
583
584
+ // Create the bignum host module
585
+ // The lifecycle of this pointer is handled by `env`.
586
+ hostModule = env.AppendHostModule (" bignum" );
587
+ heraAssert (hostModule, " Failed to create host module." );
588
+
589
+ hostModule->AppendFuncExport (
590
+ " mul256" ,
591
+ {{Type::I32, Type::I32, Type::I32}, {}},
592
+ [&interface](
593
+ const interp::HostFunc*,
594
+ const interp::FuncSignature*,
595
+ const interp::TypedValues& args,
596
+ interp::TypedValues&
597
+ ) {
598
+ interface.mul256 (args[0 ].value .i32 , args[1 ].value .i32 , args[2 ].value .i32 );
599
+ return interp::Result::Ok;
600
+ }
601
+ );
602
+
603
+ hostModule->AppendFuncExport (
604
+ " umulmod256" ,
605
+ {{Type::I32, Type::I32, Type::I32, Type::I32}, {}},
606
+ [&interface](
607
+ const interp::HostFunc*,
608
+ const interp::FuncSignature*,
609
+ const interp::TypedValues& args,
610
+ interp::TypedValues&
611
+ ) {
612
+ interface.umulmod256 (args[0 ].value .i32 , args[1 ].value .i32 , args[2 ].value .i32 , args[3 ].value .i32 );
613
+ return interp::Result::Ok;
614
+ }
615
+ );
616
+
584
617
#if HERA_DEBUGGING
585
618
// Create debug host module
586
619
// The lifecycle of this pointer is handled by `env`.
0 commit comments