-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [evm precompiles] do *not* ignore `unmarshal` return value Because `unmarshal` is marked as `discardable` we silently ignored the return value of `unmarshal`, which in some test cases indicated that the source value does not fit into target bigint * [io_limbs] handle `unmarshal` for sources longer, but smaller If a given source `src` is given to `unmarshal` where the most significant bytes are all zero beyond the size that fits into the destination BigInt, we still return a successful parse. Previously we would just return false whenever we found more bytes than can possibly fit (this leads to issues with e.g. EVM precompiles tests, which come as strings that are longer). Note: We can probably do the all zero check in a better way (i.e. using the fact that endianness does not matter and just compare all relevant bytes, but not sure about the most elegant way to do that, taking the dynamic sizes into account) * [tests] explicitly pass output size for EVM precompiles, chk exp err * revert checking of "upper" bytes in `io_limbs.nim` * [evm precompiles] return invalid input size for MSM input.len == 0 * [evm precompiles] split parsing of field coords by curve For BLS12-381 we now parse according to the spec https://eips.ethereum.org/EIPS/eip-2537#fine-points-and-encoding-of-base-elements making sure to check the 'upper' 16 bytes to be empty. If they are not we return IntLargerThanModulus.
- Loading branch information
Showing
2 changed files
with
87 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters