Skip to content

Commit 8826b8f

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

File tree

9 files changed

+9
-55
lines changed

9 files changed

+9
-55
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
The present section describes
22
(\emph{a}) the last row of all of the \textbf{non precompile} \inst{CALL}-scenarios (a \textbf{context-row}, always)
3-
(\emph{b}) the last row of first phase of \textbf{precompile} \inst{CALL}-scenarios (a \textbf{scenario-row}, always).
3+
(\emph{b}) the last row of the first phase of \textbf{precompile} \inst{CALL}-scenarios (a \textbf{scenario-row}, always).

hub/instruction_handling/call/precompiles/_local.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
\def\locNontrivialAdd {\loc{nontrivial\_ecadd}}
5656
\def\locNontrivialMul {\loc{nontrivial\_ecmul}}
5757
\def\locNontrivialPairing {\loc{nontrivial\_ecpairing}}
58-
\def\locTrivialPairing {\phantom{\loc{non}}\loc{trivial\_ecpairing}}
58+
\def\locTrivialPairing {\phantom{\loc{non}}\loc{trivial\_ecpairing}}
5959

6060
% generic
6161
%%%%%%%%%

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
\[

spec/_all_spec-blx.bib

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
@Comment{$ biblatex control file $}
2-
@Comment{$ biblatex bcf format version 3.10 $}
3-
% Do not modify this file!
4-
%
5-
% This is an auxiliary file used by the 'biblatex' package.
6-
% This file may safely be deleted. It will be recreated as
7-
% required.
8-
9-
@Control{biblatex-control,
10-
options = {3.10:0:0:1:0:1:1:0:0:1:0:1:3:1:3:1:0:0:3:1:79:+:+:nty},
11-
}

spec/_all_spec.maf

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,2 @@
11
_all_spec.mtc
22
_all_spec.mtc0
3-
_all_spec.mtc37
4-
_all_spec.mtc36
5-
_all_spec.mtc35
6-
_all_spec.mtc34
7-
_all_spec.mtc33
8-
_all_spec.mtc32
9-
_all_spec.mtc31
10-
_all_spec.mtc30
11-
_all_spec.mtc29
12-
_all_spec.mtc28
13-
_all_spec.mtc27
14-
_all_spec.mtc26
15-
_all_spec.mtc25
16-
_all_spec.mtc24
17-
_all_spec.mtc23
18-
_all_spec.mtc22
19-
_all_spec.mtc21
20-
_all_spec.mtc20
21-
_all_spec.mtc19
22-
_all_spec.mtc18
23-
_all_spec.mtc17
24-
_all_spec.mtc16
25-
_all_spec.mtc15
26-
_all_spec.mtc14
27-
_all_spec.mtc13
28-
_all_spec.mtc12
29-
_all_spec.mtc11
30-
_all_spec.mtc10
31-
_all_spec.mtc9
32-
_all_spec.mtc8
33-
_all_spec.mtc7
34-
_all_spec.mtc6
35-
_all_spec.mtc5
36-
_all_spec.mtc4
37-
_all_spec.mtc3
38-
_all_spec.mtc2
39-
_all_spec.mtc1

spec/_all_spec.synctex(busy)

5.36 MB
Binary file not shown.

0 commit comments

Comments
 (0)