Skip to content

Commit

Permalink
Merge pull request #414 from 0xPolygonHermez/feature/fix-pre-p256verify
Browse files Browse the repository at this point in the history
fix return pre-p256verify
  • Loading branch information
laisolizq authored Oct 24, 2024
2 parents b8daac7 + 41412ba commit 9c519ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main/precompiled/pre-p256verify.zkasm
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ funcP256VERIFY:
$ => D :MLOAD(readXFromCalldataResult)
; read y [32 bytes]
E + 32 => E :MSTORE(readXFromCalldataOffset), CALL(readFromCalldataOffset); in: [readXFromCalldataOffset: offset value, readXFromCalldataLength: length value], out: [readXFromCalldataResult: result value]
$ => E :MLOAD(readXFromCalldataResult), CALL(p256verify) ;in: [A: hash, B: r, C: s, D: x, E: y], out: [A: result, B: result_code]
$ => E :MLOAD(readXFromCalldataResult)

; call p256verify
:CALL(p256verify) ;in: [A: hash, B: r, C: s, D: x, E: y], out: [A: result, B: result_code]
B :JMPNZ(endP256VERIFYFail)
A :JMPZ(preEndP256VERIFY)

; write result p256verify into memory
0 => E
A :MSTORE(bytesToStore), CALL(MSTORE32); in: [bytesToStore, E: offset] out: [E: new offset]
1 :MSTORE(bytesToStore), CALL(MSTORE32); in: [bytesToStore, E: offset] out: [E: new offset]

; prepare return data
0 :MSTORE(retDataOffset)
Expand Down

0 comments on commit 9c519ee

Please sign in to comment.