Skip to content

Commit

Permalink
only check error B p256verify
Browse files Browse the repository at this point in the history
  • Loading branch information
laisolizq committed Oct 23, 2024
1 parent c482434 commit 41412ba
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 41412ba

Please sign in to comment.