Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Conversation

noel2004
Copy link
Member

@noel2004 noel2004 commented Jan 30, 2024

Mode exp precompile read first 96-bytes of inputs as the expected lengths for the following base, exp and modulus value. In current code, if the input bytes is less than 96, code would wrongly parse the U256 length number with array less than 32 bytes and obtain error value.

For example, if the input has only 1 bytes as '0x01', the code would parse base length as 1, however, the correct value should be 0x01000000000000000000000000000000 (256 bit integer in big-endian).

It cause the failure of test case modexpRandomInput_d1_g0_v0 and has been fixed in this PR.

@noel2004 noel2004 marked this pull request as ready for review January 30, 2024 05:42
@noel2004 noel2004 requested a review from lispc January 30, 2024 07:54
@noel2004
Copy link
Member Author

modexpRandomInput_d1_g0_v0 has passed:

[2024-01-30T08:22:12Z INFO testool::statetest::executor] modexpRandomInput_d1_g0_v0: mock-prove END
[2024-01-30T08:22:17Z DEBUG testool::statetest::executor] balance_overflow = false
[2024-01-30T08:22:17Z DEBUG testool::statetest::executor] has_l2_different_evm_behaviour_trace = true
[2024-01-30T08:22:17Z WARN testool::statetest::executor] skip post check
[2024-01-30T08:22:17Z INFO testool::statetest::executor] modexpRandomInput_d1_g0_v0: run-test END
[2024-01-30T08:22:17Z INFO testool] result=Ok(())

@lispc lispc merged commit 913800e into develop Jan 30, 2024
@lispc lispc deleted the fix/modexp_input branch January 30, 2024 11:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants