You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var dgst {.noinit.}: array[32, byte] # keccak256 digest
keccak256.hash(dgst, rawPubkey)
# 5. and effectively truncate to last 20 bytes of digest
r.rawCopy(12, dgst, 12, 20)
result= cttEVM_Success
However there is no setZero called at a high-level for the obvious MalformedSignature (this can be handled by caller)
and there is no part of the code that handles seemingly valid inputs revealed invalid by this internal proc:
We are passing the tests in https://github.com/mratsim/constantine/blob/master/tests/protocol_ethereum_evm_precompiles/ecRecover.json but I'm not sure what code path is doing that.
So Looking at the high-level function, it claims that on invalid signature, the neutral element is returned:
constantine/constantine/ethereum_evm_precompiles.nim
Lines 1308 to 1380 in b581c0f
However there is no
setZero
called at a high-level for the obvious MalformedSignature (this can be handled by caller)and there is no part of the code that handles seemingly valid inputs revealed invalid by this internal proc:
constantine/constantine/signatures/ecdsa.nim
Lines 312 to 334 in b581c0f
We go straight to keccak-ing the recovered pubkey without checking if it's the neutral element
constantine/constantine/ethereum_evm_precompiles.nim
Lines 1365 to 1380 in b581c0f
Instead we should be shortcutting here, and possibly return an error code (and replace MalformedSignature with VerificationFailure)
The text was updated successfully, but these errors were encountered: