Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Blake2F gas + output calculation on non-zero aligned inputs (#3201)
* refactor(precompiles/09-blake2f.ts): improve readability and performance by using DataView with byteOffset instead of subarray The changes in this commit refactor the code in the `precompile09` function in the `09-blake2f.ts` file. The changes improve the readability and performance of the code by using the `DataView` constructor with `byteOffset` instead of using `subarray` to create new `DataView` instances. Before the changes: - The `rounds`, `hRaw`, `mRaw`, and `tRaw` variables were created using `subarray` to extract specific parts of the `data` array buffer. - The `subarray` method was used with specific indices to create new `DataView` instances. After the changes: - The `rounds`, `hRaw`, `mRaw`, and `tRaw` variables are created using the `DataView` constructor with `byteOffset` to directly access the desired parts of the `data` array buffer. - The `DataView` constructor is used with the appropriate `byteOffset` values to create new `DataView` instances. These changes improve the readability of the code by making it clearer which parts of the `data` array buffer are being accessed. Additionally, using `DataView` with `byteOffset` instead of `subarray` can improve performance by avoiding unnecessary memory allocations. * evm: add blake2f test * evm: blake2f test: add extra comment * evm: fix blake2f "it.only" --------- Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
- Loading branch information