@@ -580,6 +580,39 @@ ExecutionResult WabtEngine::execute(
580
580
}
581
581
);
582
582
583
+ // Create the bignum host module
584
+ // The lifecycle of this pointer is handled by `env`.
585
+ hostModule = env.AppendHostModule (" bignum" );
586
+ heraAssert (hostModule, " Failed to create host module." );
587
+
588
+ hostModule->AppendFuncExport (
589
+ " mul256" ,
590
+ {{Type::I32, Type::I32, Type::I32}, {}},
591
+ [&interface](
592
+ const interp::HostFunc*,
593
+ const interp::FuncSignature*,
594
+ const interp::TypedValues& args,
595
+ interp::TypedValues&
596
+ ) {
597
+ interface.mul256 (args[0 ].value .i32 , args[1 ].value .i32 , args[2 ].value .i32 );
598
+ return interp::Result::Ok;
599
+ }
600
+ );
601
+
602
+ hostModule->AppendFuncExport (
603
+ " umulmod256" ,
604
+ {{Type::I32, Type::I32, Type::I32, Type::I32}, {}},
605
+ [&interface](
606
+ const interp::HostFunc*,
607
+ const interp::FuncSignature*,
608
+ const interp::TypedValues& args,
609
+ interp::TypedValues&
610
+ ) {
611
+ interface.umulmod256 (args[0 ].value .i32 , args[1 ].value .i32 , args[2 ].value .i32 , args[3 ].value .i32 );
612
+ return interp::Result::Ok;
613
+ }
614
+ );
615
+
583
616
#if HERA_DEBUGGING
584
617
// Create debug host module
585
618
// The lifecycle of this pointer is handled by `env`.
@@ -1108,6 +1141,37 @@ void WabtEngine::verifyContract(bytes_view code) {
1108
1141
}
1109
1142
);
1110
1143
1144
+ // Create the bignum host module
1145
+ // The lifecycle of this pointer is handled by `env`.
1146
+ hostModule = env.AppendHostModule (" bignum" );
1147
+ heraAssert (hostModule, " Failed to create host module." );
1148
+
1149
+ hostModule->AppendFuncExport (
1150
+ " mul256" ,
1151
+ {{Type::I32, Type::I32, Type::I32}, {}},
1152
+ [&](
1153
+ const interp::HostFunc*,
1154
+ const interp::FuncSignature*,
1155
+ const interp::TypedValues&,
1156
+ interp::TypedValues&
1157
+ ) {
1158
+ return interp::Result::Ok;
1159
+ }
1160
+ );
1161
+
1162
+ hostModule->AppendFuncExport (
1163
+ " umulmod256" ,
1164
+ {{Type::I32, Type::I32, Type::I32, Type::I32}, {}},
1165
+ [&](
1166
+ const interp::HostFunc*,
1167
+ const interp::FuncSignature*,
1168
+ const interp::TypedValues&,
1169
+ interp::TypedValues&
1170
+ ) {
1171
+ return interp::Result::Ok;
1172
+ }
1173
+ );
1174
+
1111
1175
#if HERA_DEBUGGING
1112
1176
// Create debug host module
1113
1177
// The lifecycle of this pointer is handled by `env`.
0 commit comments