Skip to content

Commit

Permalink
unpack result before serializing in ECMUL and ECADD
Browse files Browse the repository at this point in the history
  • Loading branch information
pipermerriam committed Nov 20, 2017
1 parent df89614 commit 1a815fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions evm/precompiles/ecadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ def ecadd(computation):
except ValidationError:
raise VMError("Invalid ECADD parameters")

result_x, result_y = result
result_bytes = b''.join((
pad32(int_to_big_endian(result[0].n)),
pad32(int_to_big_endian(result[1].n)),
pad32(int_to_big_endian(result_x.n)),
pad32(int_to_big_endian(result_y.n)),
))
computation.output = result_bytes
return computation
Expand Down
5 changes: 3 additions & 2 deletions evm/precompiles/ecmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ def ecmul(computation):
except ValidationError:
raise VMError("Invalid ECMUL parameters")

result_x, result_y = result
result_bytes = b''.join((
pad32(int_to_big_endian(result[0].n)),
pad32(int_to_big_endian(result[1].n)),
pad32(int_to_big_endian(result_x.n)),
pad32(int_to_big_endian(result_y.n)),
))
computation.output = result_bytes
return computation
Expand Down

0 comments on commit 1a815fd

Please sign in to comment.