@@ -153,6 +153,60 @@ PrecompileAnalysis point_evaluation_analyze(bytes_view, evmc_revision) noexcept
153
153
return {POINT_EVALUATION_PRECOMPILE_GAS, 64 };
154
154
}
155
155
156
+ PrecompileAnalysis bls12_g1add_analyze (bytes_view, evmc_revision) noexcept
157
+ {
158
+ // TODO: Implement
159
+ return {GasCostMax, 0 };
160
+ }
161
+
162
+ PrecompileAnalysis bls12_g1mul_analyze (bytes_view, evmc_revision) noexcept
163
+ {
164
+ // TODO: Implement
165
+ return {GasCostMax, 0 };
166
+ }
167
+
168
+ PrecompileAnalysis bls12_g1msm_analyze (bytes_view input, evmc_revision) noexcept
169
+ {
170
+ // TODO: Implement
171
+ return {GasCostMax, 0 };
172
+ }
173
+
174
+ PrecompileAnalysis bls12_g2add_analyze (bytes_view, evmc_revision) noexcept
175
+ {
176
+ // TODO: Implement
177
+ return {GasCostMax, 0 };
178
+ }
179
+
180
+ PrecompileAnalysis bls12_g2mul_analyze (bytes_view, evmc_revision) noexcept
181
+ {
182
+ // TODO: Implement
183
+ return {GasCostMax, 0 };
184
+ }
185
+
186
+ PrecompileAnalysis bls12_g2msm_analyze (bytes_view input, evmc_revision) noexcept
187
+ {
188
+ // TODO: Implement
189
+ return {GasCostMax, 0 };
190
+ }
191
+
192
+ PrecompileAnalysis bls12_pairing_check_analyze (bytes_view input, evmc_revision) noexcept
193
+ {
194
+ // TODO: Implement
195
+ return {GasCostMax, 0 };
196
+ }
197
+
198
+ PrecompileAnalysis bls12_map_fp_to_g1_analyze (bytes_view, evmc_revision) noexcept
199
+ {
200
+ // TODO: Implement
201
+ return {GasCostMax, 0 };
202
+ }
203
+
204
+ PrecompileAnalysis bls12_map_fp2_to_g2_analyze (bytes_view, evmc_revision) noexcept
205
+ {
206
+ // TODO: Implement
207
+ return {GasCostMax, 0 };
208
+ }
209
+
156
210
ExecutionResult ecrecover_execute (const uint8_t * input, size_t input_size, uint8_t * output,
157
211
[[maybe_unused]] size_t output_size) noexcept
158
212
{
@@ -292,6 +346,51 @@ ExecutionResult blake2bf_execute(const uint8_t* input, [[maybe_unused]] size_t i
292
346
return {EVMC_SUCCESS, sizeof (h)};
293
347
}
294
348
349
+ ExecutionResult bls12_g1add_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
350
+ {
351
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
352
+ }
353
+
354
+ ExecutionResult bls12_g1mul_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
355
+ {
356
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
357
+ }
358
+
359
+ ExecutionResult bls12_g1msm_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
360
+ {
361
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
362
+ }
363
+
364
+ ExecutionResult bls12_g2add_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
365
+ {
366
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
367
+ }
368
+
369
+ ExecutionResult bls12_g2mul_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
370
+ {
371
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
372
+ }
373
+
374
+ ExecutionResult bls12_g2msm_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
375
+ {
376
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
377
+ }
378
+
379
+ ExecutionResult bls12_pairing_check_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
380
+ {
381
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
382
+ }
383
+
384
+ ExecutionResult bls12_map_fp_to_g1_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
385
+ {
386
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
387
+ }
388
+
389
+ ExecutionResult bls12_map_fp2_to_g2_execute (const uint8_t *, size_t , uint8_t *, size_t ) noexcept
390
+ {
391
+ return {EVMC_PRECOMPILE_FAILURE, 0 };
392
+ }
393
+
295
394
namespace
296
395
{
297
396
struct PrecompileTraits
@@ -301,19 +400,18 @@ struct PrecompileTraits
301
400
};
302
401
303
402
inline constexpr auto traits = []() noexcept {
304
- std::array<PrecompileTraits, NumPrecompiles> tbl{{
305
- {}, // undefined for 0
306
- {ecrecover_analyze, ecrecover_execute},
307
- {sha256_analyze, sha256_execute},
308
- {ripemd160_analyze, ripemd160_execute},
309
- {identity_analyze, identity_execute},
310
- {expmod_analyze, expmod_stub},
311
- {ecadd_analyze, ecadd_execute},
312
- {ecmul_analyze, ecmul_execute},
313
- {ecpairing_analyze, ecpairing_stub},
314
- {blake2bf_analyze, blake2bf_execute},
315
- {point_evaluation_analyze, point_evaluation_stub},
316
- }};
403
+ std::array<PrecompileTraits, NumPrecompiles> tbl{{{}, // undefined for 0
404
+ {ecrecover_analyze, ecrecover_execute}, {sha256_analyze, sha256_execute},
405
+ {ripemd160_analyze, ripemd160_execute}, {identity_analyze, identity_execute},
406
+ {expmod_analyze, expmod_stub}, {ecadd_analyze, ecadd_execute},
407
+ {ecmul_analyze, ecmul_execute}, {ecpairing_analyze, ecpairing_stub},
408
+ {blake2bf_analyze, blake2bf_execute}, {point_evaluation_analyze, point_evaluation_stub},
409
+ {bls12_g1add_analyze, bls12_g1add_execute}, {bls12_g1mul_analyze, bls12_g1mul_execute},
410
+ {bls12_g1msm_analyze, bls12_g1msm_execute}, {bls12_g2add_analyze, bls12_g2add_execute},
411
+ {bls12_g2mul_analyze, bls12_g2mul_execute}, {bls12_g2msm_analyze, bls12_g2msm_execute},
412
+ {bls12_pairing_check_analyze, bls12_pairing_check_execute},
413
+ {bls12_map_fp_to_g1_analyze, bls12_map_fp_to_g1_execute},
414
+ {bls12_map_fp2_to_g2_analyze, bls12_map_fp2_to_g2_execute}}};
317
415
#ifdef EVMONE_PRECOMPILES_SILKPRE
318
416
// tbl[static_cast<size_t>(PrecompileId::ecrecover)].execute = silkpre_ecrecover_execute;
319
417
// tbl[static_cast<size_t>(PrecompileId::sha256)].execute = silkpre_sha256_execute;
@@ -348,6 +446,9 @@ bool is_precompile(evmc_revision rev, const evmc::address& addr) noexcept
348
446
if (rev < EVMC_CANCUN && id >= stdx::to_underlying (PrecompileId::since_cancun))
349
447
return false ;
350
448
449
+ if (rev < EVMC_PRAGUE && id >= stdx::to_underlying (PrecompileId::since_prague))
450
+ return false ;
451
+
351
452
return true ;
352
453
}
353
454
0 commit comments