Consensys / gnark

gnark is a fast zk-SNARK library that offers a high-level API to design circuits. The library is open source and developed under the Apache 2.0 license
https://hackmd.io/@gnark
Apache License 2.0
1.45k stars 381 forks source link

fix: expmod precompile if modulus is 1 #1294

Closed ivokub closed 1 month ago

ivokub commented 1 month ago

Description

Even though EVM yellow paper defines 0^0=1, then this holds only if modulus is not 0 or 1. In either such case any exponentiation is 0.

Fixes LA audit Issue G

Type of change

How has this been tested?

How has this been benchmarked?

Not benchmarked

Checklist: