diff --git a/main/ecrecover/constEc.zkasm b/main/ecrecover/constEc.zkasm index f17f43a2..b858190e 100644 --- a/main/ecrecover/constEc.zkasm +++ b/main/ecrecover/constEc.zkasm @@ -1,6 +1,6 @@ CONSTL %FPEC = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2Fn CONSTL %FPEC_MINUS_ONE = %FPEC - 1 -CONSTL %FNEC_DIV_TWO = 57896044618658097711785492504343953926418782139537452191302581570759080747169n +CONSTL %FNEC_DIV_TWO = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0n CONSTL %FPEC_C2_256 = 0x1000003D1n CONSTL %FPEC_NON_SQRT = (1n << 256n) - 1n diff --git a/test/ecrecover.zkasm b/test/ecrecover.zkasm index eb9f904a..354cdf51 100644 --- a/test/ecrecover.zkasm +++ b/test/ecrecover.zkasm @@ -329,15 +329,26 @@ repeat_ecrecover_test: :CALL(ecrecover_tx) 0x0000000000000000000000000000000000000000n :ASSERT - ; #34 s == field/2 + 1. Valid + ; #34 s == field/2 + 1. Valid (precompiled) 0x456e9aea5e197a1f1af7a3e85a3212fa4049a3ba34c2289b4c860fc0b0c64ef3n => A 0x9242685bf161793cc25603c231bc2f568eb630ea16aa137d2664ac8038825608n => B 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1n => C 0x1cn => D - :CALL(ecrecover_tx) + :CALL(ecrecover_precompiled) 0x4ef445CADd8bEe8A02bc79b30A97e6Fe3AE3B7a3n :ASSERT + ; #34' s == field/2 + 1. Invalid (tx) + + 0x456e9aea5e197a1f1af7a3e85a3212fa4049a3ba34c2289b4c860fc0b0c64ef3n => A + 0x9242685bf161793cc25603c231bc2f568eb630ea16aa137d2664ac8038825608n => B + 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1n => C + 0x1cn => D + :CALL(ecrecover_tx) + 0n :ASSERT + B => A + 4n :ASSERT + ; #35 s == field/2. Valid 0x456e9aea5e197a1f1af7a3e85a3212fa4049a3ba34c2289b4c860fc0b0c64ef3n => A