From b59667c6b939b5665dc3dd0b676848415fe5f301 Mon Sep 17 00:00:00 2001 From: KimiWu Date: Thu, 19 Oct 2023 09:53:03 +0800 Subject: [PATCH] doc: complete constraints desc. --- specs/precompile/01ecRecover.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/specs/precompile/01ecRecover.md b/specs/precompile/01ecRecover.md index 5208461ce..e9aaf4084 100644 --- a/specs/precompile/01ecRecover.md +++ b/specs/precompile/01ecRecover.md @@ -20,7 +20,12 @@ A constant gas cost: 3000 ## Constraints -1. v is 27 or 28. +1. If gas_left < gas_required, then is_success == false and return data is zero. +1. v, r and s are valid + - v is 27 or 28 and the first 31 bytes of v is zero + - both of r and s are less than `secp256k1N (0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141)` + - both of r and s are greater than `1` + - r is greater than `secp256k1N/2` 2. `sig_table` lookups 3. recovered address is zero if the signature can't be recovered.