hyperledger / besu-native

Apache License 2.0
13 stars 36 forks source link

Right pad incomplete point inputs for eip-196 #191

Closed garyschulte closed 3 months ago

garyschulte commented 3 months ago

In the gnark-crypto implementation of eip-196, incomplete scalar inputs are already right padded with zero. However, points also require this treatment.

from eip-196 spec:

For both precompiled contracts, if the input is shorter than expected, it is assumed to be virtually padded with zeros at the end (i.e. compatible with the semantics of the CALLDATALOAD opcode). If the input is longer than expected, surplus bytes at the end are ignored.