Skip to content

Commit e18c08d

Browse files
committed
feat: add pverify to bls representation, and forbd empty call data for pverify
1 parent becb7bb commit e18c08d

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

hub/instruction_handling/call/precompiles/bls/lua/common.lua.tex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
| | | scen/PRC_PAIRING_CHECK | |
4949
| | | scen/PRC_MAP_FP_TO_G1 | |
5050
| | | scen/PRC_MAP_FP_TO_G2 | |
51+
| | | scen/PRC_P256_VERIFY | |
5152
|-------+--------+-----------------------------------+------------------------------------------------------------|
5253
| i + 1 | MISC | | OOB🚩 = 1 |
5354
| | | | OOB_INST = ⟦OOB_INST_point_evaluation⟧ |
@@ -58,6 +59,7 @@
5859
| | | | . ∨ ⟦OOB_INST_pairing_check⟧ |
5960
| | | | . ∨ ⟦OOB_INST_map_fp_to_g1⟧ |
6061
| | | | . ∨ ⟦OOB_INST_map_fp_to_g2⟧ |
62+
| | | | . ∨ ⟦OOB_INST_p256_verify⟧ |
6163
| | | | |
6264
| | | | TRUSTED INPUTS: |
6365
| | | | * cds |
@@ -99,15 +101,16 @@
99101
to denote the integer that equals 'val_T' whenever 'condition' is 'true', and 'val_F' whenever 'condition' is 'false'.
100102
101103
102-
NOTE. The BLS precompiles added with
104+
NOTE. The BLS precompiles and P256_Verify added with
103105
104106
+ EIP-4844:
105107
- POINT_EVALUATION
106108
+ EIP-2537:
107109
- G1ADD - G2ADD - PAIRING_CHECK
108110
- G1MSM - G2MSM
109111
- MAP_FP_TO_G1 - MAP_FP_TO_G2
110-
112+
+ EIP-7951:
113+
- P256_VERIFY
111114
all have the nice-to-have property that providing them with empty call data, and more generally: call data that isn't the right
112115
(prescribed) size in bytes or a (nonzero) multiple of some reference size, results in a failure (FAILURE_KNOWN_TO_HUB in the
113116
way we arithmetize things) of the precompile, and thus the precompile burning all provided gas, clearing out its caller's

hub/instruction_handling/call/precompiles/common/lua/setup.lua.tex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
| | | * SCEN/IDENTITY = 1 | . <== SCEN/PREC_FKTR ≡ 0 (always!) |
4949
| | | * SCEN/ECADD = 1 | |
5050
| | | * SCEN/ECMUL = 1 | |
51-
| | | * SCEN/P256-VERIFY = 1 | |
5251
| | | | |
5352
|-------+--------+---------------------------+------------------------------------------------------|
5453
| i + 1 | MISC | | OOB🏴 = 1 |
@@ -59,7 +58,6 @@
5958
| | | | * ⟦OOB_INST_identity⟧ |
6059
| | | | * ⟦OOB_INST_ecadd⟧ |
6160
| | | | * ⟦OOB_INST_ecmul⟧ |
62-
| | | | * ⟦OOB_INST_p256-verify⟧ |
6361
| | | | |
6462
| | | | TRUSTED INPUTS: |
6563
| | | | * cds |

hub/instruction_handling/call/precompiles/ecadd_ecmul_ecpairing_bls_pverify/empty.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
\instBlsPairingCheck{},
1111
\instBlsMapFpToGOne{} and
1212
\instBlsMapFpTwoToGTwo{}}
13+
and \ instPVerify{}
1314
\emph{actively disallow} empty call data.
1415

1516
\noindent In the \hubMod{} a (common) precompile call being provided with empty call data is measured \emph{precisely} by

hub/instruction_handling/call/precompiles/nsr_and_flagsum_II.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
\item[\underline{\underline{Shorthands for \instEcadd{}, \instEcmul{}, \instEcpairing{} and \instPVerify{}:}}]
137137
for
138138
\[
139-
\loc{xxx} \in \left\{ \loc{ecadd}, ~ \loc{ecmul}, ~ \loc{ecpairing} \right\}
139+
\loc{xxx} \in \left\{ \loc{ecadd}, ~ \loc{ecmul}, ~ \loc{ecpairing}, ~ \loc{p256\_verify} \right\}
140140
\]
141141
we set
142142
\[

0 commit comments

Comments
 (0)