@@ -601,9 +601,8 @@ ExecutionResult bls12_g1add_execute(const uint8_t* input, size_t input_size, uin
601601ExecutionResult bls12_g1msm_execute (const uint8_t * input, size_t input_size, uint8_t * output,
602602 [[maybe_unused]] size_t output_size) noexcept
603603{
604- if (input_size % BLS12_G1_MUL_INPUT_SIZE != 0 )
605- return {EVMC_PRECOMPILE_FAILURE, 0 };
606-
604+ // Checked in `_analyze` function which must be called before.
605+ assert (input_size % BLS12_G1_MUL_INPUT_SIZE == 0 );
607606 assert (output_size == BLS12_G1_POINT_SIZE);
608607
609608 if (input_size == BLS12_G1_MUL_INPUT_SIZE)
@@ -638,9 +637,8 @@ ExecutionResult bls12_g2add_execute(const uint8_t* input, size_t input_size, uin
638637ExecutionResult bls12_g2msm_execute (const uint8_t * input, size_t input_size, uint8_t * output,
639638 [[maybe_unused]] size_t output_size) noexcept
640639{
641- if (input_size % BLS12_G2_MUL_INPUT_SIZE != 0 )
642- return {EVMC_PRECOMPILE_FAILURE, 0 };
643-
640+ // Checked in `_analyze` function which must be called before.
641+ assert (input_size % BLS12_G2_MUL_INPUT_SIZE == 0 );
644642 assert (output_size == BLS12_G2_POINT_SIZE);
645643
646644 if (input_size == BLS12_G2_MUL_INPUT_SIZE)
@@ -661,9 +659,8 @@ ExecutionResult bls12_g2msm_execute(const uint8_t* input, size_t input_size, uin
661659ExecutionResult bls12_pairing_check_execute (const uint8_t * input, size_t input_size,
662660 uint8_t * output, [[maybe_unused]] size_t output_size) noexcept
663661{
664- if (input_size % (BLS12_G1_POINT_SIZE + BLS12_G2_POINT_SIZE) != 0 )
665- return {EVMC_PRECOMPILE_FAILURE, 0 };
666-
662+ // Checked in `_analyze` function which must be called before.
663+ assert (input_size % (BLS12_G1_POINT_SIZE + BLS12_G2_POINT_SIZE) == 0 );
667664 assert (output_size == 32 );
668665
669666 if (!crypto::bls::pairing_check (output, input, input_size))
0 commit comments