EspressoSystems / espresso-sequencer

93 stars 63 forks source link

M05: The invert function allows inversion of zero #1732

Closed philippecamacho closed 1 month ago

philippecamacho commented 1 month ago

Affected Code: BN254.sol (line 188) Summary: The current implementation of the invert function allows the input 0 to be processed. This is incorrect because 0 does not have a multiplicative inverse in the field. Suggestion: We recommend that the function reverts inversion gracefully if the input is 0. Status: Pending

philippecamacho commented 1 month ago

We agree, this edge case needs to be handled.

philippecamacho commented 1 month ago

Closed in https://github.com/EspressoSystems/solidity-bn254/pull/15.