Skip to content

Commit fb8e529

Browse files
authored
Merge pull request #42 from AAU-Dat/correctiones
Correctiones
2 parents 3ec191e + 6ce2e17 commit fb8e529

File tree

5 files changed

+68
-66
lines changed

5 files changed

+68
-66
lines changed

report/src/sections/04-Approach.tex

Lines changed: 60 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ \subsection{Springproofs}\label{sec:approach-springproofs}
1414
In a general~\gls{ipa}, Curdleproofs included, if the size of the vectors were not a power of two, the argument would not recurse down to size 1, as they work by halving the vectors every recursive round.
1515

1616

17-
The core concept of the Springproofs scheme function is to split the vectors into sets, $T$ and $S$, before each recursive round of the protocol.
18-
Then, the fold for that round is only done on one of the two sets,~$T$, before the other set,~$S$, is appended again at the end of the recursive round.
17+
The core concept of the Springproofs scheme function is to split the vectors into sets, $\mathbf{\mathcal{T}}$ and $\mathbf{\mathcal{S}}$, before each recursive round of the protocol.
18+
Then, the fold for that round is only done on one of the two sets,~$\mathbf{\mathcal{T}}$, before the other set,~$\mathbf{\mathcal{S}}$, is appended again at the end of the recursive round.
1919

2020
Springproofs present different scheme functions and prove some of them to be optimal.
2121
One of these optimal functions is an optimized version of their \textit{pre-compression method}, which splits the vectors as seen in~\autoref{lst:schemefunc}.
22-
The computation is for finding the set,~$T$.
22+
The computation is for finding the set,~$\mathbf{\mathcal{T}}$.
2323

2424
\begin{figure}[!htb]
2525
\begin{lstlisting}[language=Python,mathescape=true,label={lst:schemefunc},numbers=right,caption={Scheme function \textbf{\textit{f}} used in CAAUrdleproofs},captionpos=b,frame=single]
2626
input: $n$, where $n>0$
2727

28-
$\{n\}\gets n$
28+
$\mathbf{n}\gets \{1..n\}$
2929
$N\gets 2^{\lceil\log n\rceil-1}$
3030
$i_h \gets \lfloor (2N-n)/2\rfloor+1$
3131
$i_t=\lfloor n/2\rfloor$
3232
if $n\neq N$: #Not power of 2
33-
$\{T\}\gets(i_h:i_t)\cup(N+1:n)$
33+
$\mathbf{\mathcal{T}}\gets\{i_h:i_t\}\cup\{N+1:n\}$
3434
else if $n=N$: #Power of 2
35-
$\{T\}\gets(1:n)$ #Meaning S is empty
36-
$\{S\}\gets\{n\}-\{T\}$
35+
$\mathbf{\mathcal{T}}\gets\{1:n\}$ #Meaning S is empty
36+
$\mathbf{\mathcal{S}}\gets\mathbf{n}-\mathbf{\mathcal{T}}$
3737
\end{lstlisting}
3838
\label{fig:schemefunc}
3939
\end{figure}
@@ -65,8 +65,9 @@ \subsubsection*{Prover computation}
6565
The construction can be seen in~\autoref{lst:ipa-prover}.
6666

6767
\begin{figure}[!htb]
68-
\begin{lstlisting}[language=Python,mathescape=true,label={lst:ipa-prover},numbers=left,caption={Prover computation for CAAU-IPA in CAAUrdleproofs},captionpos=b,frame=single]
68+
\begin{lstlisting}[language=Python,mathescape=true,label={lst:ipa-prover},numbers=right,caption={Prover computation for CAAU-IPA in CAAUrdleproofs},captionpos=b,frame=single]
6969
$\textbf{Step 1:}$ #Setup phase
70+
$(\mathbf{c},\mathbf{d},z,C,D)\gets$parse$(input)$
7071
$(\textbf{G},\textbf{G}',H)\gets$parse$(crs_{dl_{inner}})$
7172
$\textbf{r}_C,\textbf{r}_D\overset{\$}{\leftarrow}\mathbb{F}^n$ #Vector blinders
7273
where $(\textbf{r}_C\times \textbf{d} + \textbf{r}_D\times \textbf{c})=0\text{ and }\textbf{r}_C\times \textbf{r}_D=0$
@@ -79,12 +80,12 @@ \subsubsection*{Prover computation}
7980
$\textbf{Step 2:}$ #Recursive protocol
8081
$m\gets \lceil \log n\rceil$
8182
while $1\leq j\leq m:$
82-
$T,S\gets \textbf{\textit{f(}}n\textbf{\textit{)}}$ #Scheme function
83-
$n\gets \frac{|T|}{2}$
84-
$\textbf{c}\gets\textbf{c}_T$, $\textbf{cS}\gets\textbf{c}_S$ #Vector splitting
85-
$\textbf{d}\gets\textbf{d}_T$, $\textbf{dS}\gets\textbf{d}_S$
86-
$\textbf{G}\gets\textbf{G}_T$, $\textbf{GS}\gets\textbf{G}_S$
87-
$\textbf{G}'\gets\textbf{G}'_T$, $\textbf{GS}'\gets\textbf{G}'_T$
83+
$\mathbf{\mathcal{T}},\mathbf{\mathcal{S}}\gets \textbf{\textit{f(}}n\textbf{\textit{)}}$ #Scheme function
84+
$n\gets \frac{|\mathbf{\mathcal{T}}|}{2}$
85+
$\textbf{c}\gets\textbf{c}_\mathbf{\mathcal{T}}$, $\textbf{cS}\gets\textbf{c}_\mathbf{\mathcal{S}}$ #Vector splitting
86+
$\textbf{d}\gets\textbf{d}_\mathbf{\mathcal{T}}$, $\textbf{dS}\gets\textbf{d}_\mathbf{\mathcal{S}}$
87+
$\textbf{G}\gets\textbf{G}_\mathbf{\mathcal{T}}$, $\textbf{GS}\gets\textbf{G}_\mathbf{\mathcal{S}}$
88+
$\textbf{G}'\gets\textbf{G}'_\mathbf{\mathcal{T}}$, $\textbf{GS}'\gets\textbf{G}'_\mathbf{\mathcal{S}}$
8889
$L_{C,j}\gets\textbf{c}_{[:n]}\times\textbf{G}_{[n:]}+(\textbf{c}_{[:n]}\times\textbf{d}_{[n:]})H$ #Cross-comm
8990
$L_{D,j}\gets\textbf{d}_{[n:]}\times\textbf{G}'_{[:n]}$
9091
$R_{C,j}\gets\textbf{c}_{[n:]}\times\textbf{G}_{[:n]}+(\textbf{c}_{[n:]}\times\textbf{d}_{[:n]})H$
@@ -106,37 +107,38 @@ \subsubsection*{Prover computation}
106107
\end{figure}
107108
First, we have step 1, which is the setup phase.
108109
It is implemented the same way as in Curdleproofs.
109-
In line 2, the prover gets the cryptographic generators, $\mathbf{G}$, $\mathbf{G}'$ and $H$, which are going to be used for commitment constructions.
110-
To ensure zero-knowledge, two blinding vectors for each commitment are constructed on lines 3--4.
110+
From the prover input, line 2, we obtain the vectors $\mathbf{c}$ and $\mathbf{d}$, whose inner product we aim to prove is equal to $z$, as well as the commitments $C$ and $D$.
111+
In line 3, the prover gets the cryptographic generators, $\mathbf{G}$, $\mathbf{G}'$ and $H$, which are going to be used for commitment constructions.
112+
To ensure zero-knowledge, two blinding vectors for each commitment are constructed on lines 4--5.
111113
These are also given the properties, $(\mathbf{r}_C\times \mathbf{d}+\mathbf{r}_D\times \mathbf{c})=0$~and~ $\mathbf{r}_C\times\mathbf{r}_D=0$, ensuring the completeness of the protocol.
112114

113-
After this, commitments to the blinding vectors are constructed as $B_C$ and $B_D$ on lines 5--6.
115+
After this, commitments to the blinding vectors are constructed as $B_C$ and $B_D$ on lines 6--7.
114116
These will eventually be used for verification by the verifier.
115117

116-
From the public input, hash values $\alpha,\beta$ are then computed on line 7.
118+
From the public input, hash values $\alpha,\beta$ are then computed on line 8.
117119
These are used to ensure the soundness of the protocol.
118120

119-
On lines 8--10, the two vectors are then blinded and multiplied by the $\alpha$ hash to ensure the zero-knowledge and soundness, as well as $H=\beta H$.
121+
On lines 9--11, the two vectors are then blinded and multiplied by the $\alpha$ hash to ensure the zero-knowledge and soundness, as well as $H=\beta H$.
120122

121123

122124
Now, the recursive proof construction, and step 2, begins.
123-
As explained, at the start of the recursive round, line 13, we find the split of the vectors on line 14, with $f(n)$ being the scheme function from~\autoref{lst:schemefunc}.
124-
Then, on line 15, we find half the length of the $T$ set, as it is the set we are doing the recursive folding round on.
125-
Equally, on lines 16--19, we split our witness vectors and the group vectors using $T$ and $S$.
125+
As explained, at the start of the recursive round, line 14, we find the split of the vectors on line 15, with $f(n)$ being the scheme function from~\autoref{lst:schemefunc}.
126+
Then, on line 16, we find half the length of the $\mathbf{\mathcal{T}}$ set, as it is the set we are doing the recursive folding round on.
127+
Equally, on lines 17--20, we split our witness vectors and the group vectors using $\mathbf{\mathcal{T}}$ and $\mathbf{\mathcal{S}}$.
126128

127-
After this, the prover constructs cross-commitment elements on lines 20--23 that are computed on the $T$ set.
128-
These are added to the proof on line 24, which eventually is available to the verifier.
129-
They are also used to construct a hash value,~$\gamma_j$, in the next step on line 25.
129+
After this, the prover constructs cross-commitment elements on lines 21--24 that are computed on the $\mathbf{\mathcal{T}}$ set.
130+
These are added to the proof on line 25, which eventually is available to the verifier.
131+
They are also used to construct a hash value,~$\gamma_j$, in the next step on line 26.
130132

131-
This value is used on lines 26--29 for completing the folding of $\mathbf{c},\mathbf{d},\mathbf{G},\mathbf{G'}$.
132-
We do the fold as in the original Curdleproofs protocol while also appending the elements of $S$ back onto the vectors.
133+
This value is used on lines 27--30 for completing the folding of $\mathbf{c},\mathbf{d},\mathbf{G},\mathbf{G'}$.
134+
We do the fold as in the original Curdleproofs protocol while also appending the elements of $\mathbf{\mathcal{S}}$ back onto the vectors.
133135
The figure shows a concatenation, but it is important to know that the vectors are appended together as shown in~\autoref{fig:fold}(b).
134136

135-
At the end of the recursive round, on line 30,~$n$ is updated to the length of the concatenated vectors before starting a new round.
137+
At the end of the recursive round, on line 31,~$n$ is updated to the length of the concatenated vectors before starting a new round.
136138

137139
The result of this is a proof,~$\mathbf{\pi}$, constructed in $\lceil \log n \rceil$ rounds, but with the proof size being smaller than if the shuffle size was a power of 2.
138140

139-
In step 3, lines 31--35, the folded vectors of size 1 are added to the proof as values as well as the commitments to the blinding values,~$B_C$ and~$B_D$.
141+
In step 3, lines 32--36, the folded vectors of size 1 are added to the proof as values as well as the commitments to the blinding values,~$B_C$ and~$B_D$.
140142
The proof, folded vectors, and updated commitment are saved for the verifier to use for verification.
141143

142144

@@ -160,10 +162,10 @@ \subsubsection*{Verifier computation}
160162
$\textbf{Step 2:}$ #Recursive round
161163
$m\gets \lceil\log n\rceil$
162164
for $1\leq j\leq m$
163-
$T,S\gets \textbf{\textit{f(}}n\textbf{\textit{)}}$ #Scheme function
164-
$n\gets \frac{|T|}{2}$
165-
$\textbf{G}=\textbf{G}_T$, $\textbf{GS}=\textbf{G}_S$ #Vector splitting
166-
$\textbf{G}'=\textbf{G}'_T$, $\textbf{GS}'=\textbf{G}'_T$
165+
$\mathbf{\mathcal{T}},\mathbf{\mathcal{S}}\gets \textbf{\textit{f(}}n\textbf{\textit{)}}$ #Scheme function
166+
$n\gets \frac{|\mathbf{\mathcal{T}}|}{2}$
167+
$\textbf{G}=\textbf{G}_\mathbf{\mathcal{T}}$, $\textbf{GS}=\textbf{G}_\mathbf{\mathcal{S}}$ #Vector splitting
168+
$\textbf{G}'=\textbf{G}'_\mathbf{\mathcal{T}}$, $\textbf{GS}'=\textbf{G}'_\mathbf{\mathcal{S}}$
167169
$(L_{C,j},L_{D,j},R_{C,j},R_{D,j})\gets$parse$(\pi_j)$ #Proof elem
168170
$\gamma_j\gets$Hash$(\pi_j)$ #Folding challenges
169171
$C\gets\gamma_j L_{C,j}+C+\gamma_j^{-1}R_{C,j}$ #Update comms
@@ -175,7 +177,7 @@ \subsubsection*{Verifier computation}
175177
$\textbf{Step 3:}$ #Final check
176178
Check $C=c\times G_1+cdH$ #Initial ?= Folded
177179
Check $D=d\times G'_1$
178-
return 1 $\text{if both checks pass, else}$ return 0
180+
return 1 $\text{if both checks pass, otherwise}$ return 0
179181
\end{lstlisting}
180182
\label{fig:ipa-verifier}
181183
\end{figure}
@@ -194,8 +196,8 @@ \subsubsection*{Verifier computation}
194196
Those modifications mean that the commitments~$C$ and~$D$ need to be commitments to the modified witnesses instead.
195197

196198
The setup phase is now complete, and the verifier then executes the recursive protocol, as shown in step 2.
197-
First, the vectors are divided into two sets,~$T$ and $S$, on line 13, as in~\autoref{lst:ipa-prover}.
198-
After this, the group vectors are in lines 14--16 split according to those sets, along with updating~$n$ to be half the size of~$T$.
199+
First, the vectors are divided into two sets,~$\mathbf{\mathcal{T}}$ and $\mathbf{\mathcal{S}}$, on line 13, as in~\autoref{lst:ipa-prover}.
200+
After this, the group vectors are in lines 14--16 split according to those sets, along with updating~$n$ to be half the size of~$\mathbf{\mathcal{T}}$.
199201

200202
The verifier then, on line 17, retrieves from the proof the cross-product commitment update values for the given round,~$L_{C,j},L_{D,j},R_{C,j},R_{D,j}$.
201203
These are used for constructing a new commitment, lines 19--20, according to the fold made at round $i$.
@@ -233,25 +235,25 @@ \subsection{Shuffle security}\label{subsec:approach-shuffle-security}
233235
\rule{\linewidth}{0.4pt}
234236

235237
\noindent
236-
\textbf{For} $t \in [T]$ \textbf{:}
238+
\textbf{For} $q \in [Q]$ \textbf{:}
237239
\begin{itemize}
238-
\item[$S_t$] picks random $\{i_1, \ldots, i_\ell\} \subset [n]$
239-
\item[$S_t$] computes $(\tilde{c}_{i_1}, \ldots, \tilde{c}_{i_\ell}) \leftarrow \text{Shuffle}(c_{i_1}, \ldots, c_{i_\ell})$
240-
\item[$S_t$] publishes $(\tilde{c}_{i_1}, \ldots, \tilde{c}_{i_\ell})$
240+
\item[$S_q$] picks random $\{i_1, \ldots, i_\ell\} \subset [n]$
241+
\item[$S_q$] computes $(\tilde{c}_{i_1}, \ldots, \tilde{c}_{i_\ell}) \leftarrow \text{Shuffle}(c_{i_1}, \ldots, c_{i_\ell})$
242+
\item[$S_q$] publishes $(\tilde{c}_{i_1}, \ldots, \tilde{c}_{i_\ell})$
241243
\end{itemize}
242244
\end{framed}
243245
\caption{Distributed shuffling protocol. Source:~\cite{cryptoeprint:2022/560}}
244246
\label{fig:shuffle}
245247
\end{figure}
246248

247-
Here the set $(c_1, \ldots, c_n)$ is a set of ciphertexts that are shuffled over $T$ slots.
248-
In each slot $t$, a subset of the ciphertexts ${i_1, \ldots, i_\ell}$ is chosen randomly, shuffled and added back to the list of ciphertexts.
249+
Here the set $(c_1, \ldots, c_n)$ is a set of ciphertexts that are shuffled over $Q$ slots.
250+
In each slot $q$, a subset of the ciphertexts ${i_1, \ldots, i_\ell}$ is chosen randomly, shuffled and added back to the list of ciphertexts.
249251
The shuffler then re-encrypts the ciphertexts and publishes them.
250-
This process is repeated for $T$ slots, and the shuffle is complete.
251-
During the $T$ shuffles, some shuffles may be adversarial.
252+
This process is repeated for $Q$ slots, and the shuffle is complete.
253+
During the $Q$ shuffles, some shuffles may be adversarial.
252254
An adversary can choose to do anything with its shuffle, including not shuffling.
253255
Hence, an adversarial shuffle can be seen as no shuffling being done.
254-
Therefore, the number of honest shuffles that happen during the shuffle process is $T_H = T - \beta$, where $\beta$ is the number of adversarial shuffles.
256+
Therefore, the number of honest shuffles that happen during the shuffle process is $Q_H = Q - \beta$, where $\beta$ is the number of adversarial shuffles.
255257

256258
The adversary can also track ciphertexts.
257259
For instance, if the adversary owns some of the ciphertexts.
@@ -265,12 +267,12 @@ \subsection{Shuffle security}\label{subsec:approach-shuffle-security}
265267
So, if a shuffle contains many ciphertexts with a larger-than-average chance of containing a specific ciphertext, then that would imply that there is a higher chance of that ciphertext being in that slot.
266268

267269
It is theoretically possible to find a number of shuffles, given a shuffle size and a number of adversarial shufflers, which guarantees that the shuffle is secure.
268-
For any $0 < \delta < 1/3$, if $T \geq 20 n / \ell \ln(n/\delta) + \beta $ and $ \ell \geq 256 \ln^2(n/\delta)(1 - \alpha/n)^{-2}$.
269-
If $T$ and $\ell$ are chosen such that the above two conditions are met, then the protocol is an $(\epsilon , \delta)$-secure $(T,n,\ell)$-shuffle in the presence of a $(\alpha, \beta)$-adversary where $\epsilon = 2/(n-\alpha)$.
270+
For any $0 < \delta < 1/3$, if $Q \geq 20 n / \ell \ln(n/\delta) + \beta $ and $ \ell \geq 256 \ln^2(n/\delta)(1 - \alpha/n)^{-2}$.
271+
If $Q$ and $\ell$ are chosen such that the above two conditions are met, then the protocol is an $(\epsilon , \delta)$-secure $(Q,n,\ell)$-shuffle in the presence of a $(\alpha, \beta)$-adversary where $\epsilon = 2/(n-\alpha)$.
270272

271-
This formula is the lowest theoretically proven bound for $T$ and $\ell$.
273+
This formula is the lowest theoretically proven bound for $Q$ and $\ell$.
272274
Plotting numbers relevant to Whisk will show that this theoretical bound is too large to use for argumentation of security.
273-
It is, however, possible to find lower secure values for $T$ and $\ell$, but this has to be done experimentally.
275+
It is, however, possible to find lower secure values for $Q$ and $\ell$, but this has to be done experimentally.
274276

275277

276278
\subsection{Implementation}\label{subsec:approach-implementation}
@@ -309,25 +311,25 @@ \subsubsection{CAAUrdleproofs}
309311
$\textbf{Step 2:}$ #Recursive phase
310312
$m\gets \lceil\log n\rceil$
311313
for $1\leq j\leq m$
312-
$T,S\gets \textbf{\textit{f(}}n\textbf{\textit{)}}$ #Scheme function
313-
$n\gets \frac{|T|}{2}$
314+
$\mathbf{\mathcal{T}},\mathbf{\mathcal{S}}\gets \textbf{\textit{f(}}n\textbf{\textit{)}}$ #Scheme function
315+
$n\gets \frac{|\mathbf{\mathcal{T}}|}{2}$
314316
$(L_{C,j},L_{D,j},R_{C,j},R_{D,j})\gets$parse$(\pi_j)$ #Proof elem
315317
$\gamma_j\gets$Hash$(\pi_j)$ #Folding challenges
316-
$n\gets n+\text{len}(S)$
318+
$n\gets n+|\mathbf{\mathcal{S}}|$
317319

318320
$\textbf{Step 3:}$ # Accumulated checking phase
319-
$\mathbf{CP}\text{: }\mathbf{\gamma}\gets(\gamma_m,...,\gamma_1)$ #Construction difference
320-
$\mathbf{CAAUP}\text{: }\mathbf{\gamma}\gets(\gamma_1,...,\gamma_m)$
321+
$\mathbf{CP}\text{: }\mathbf{\delta}\gets(\gamma_m,...,\gamma_1)$ #Construction difference
322+
$\mathbf{CAAUP}\text{: }\mathbf{\delta}\gets(\gamma_1,...,\gamma_m)$
321323
$\textit{Compute }\mathbf{s}\textit{: see below for difference}$
322324

323325
AccumulateCheck$(\mathbf{\gamma}\times\mathbf{L}_C+(B_C+\alpha C+(\alpha^2z)H)$
324326
$+\mathbf{\gamma}^{-1}\times\mathbf{R}_C\stackrel{?}{=}(c\mathbf{s}\| cd\beta)\times(\mathbf{G}\| H))$
325327
AccumulateCheck$(\mathbf{\gamma}\times\mathbf{L}_D+(B_D+\alpha D)$
326328
$+\mathbf{\gamma}^{-1}\times\mathbf{R}_D\stackrel{?}{=}d(\mathbf{s'}\circ\mathbf{u})\times\mathbf{G})$
327-
$\text{return 1}$
329+
return 1 $\text{if checks pass, otherwise}$ return 0
328330

329331
$\textbf{s-step Curdleproofs:}$
330-
for $1\leq j\leq n$: Simulate halving each round
332+
for $1\leq j\leq n$: #Simulate halving each round
331333
$s_i=\sum_{j=1}^m\delta_j^{b_{i,j}}\text{, }b_{i,j}\in\{0,1\}\text{ s.t. }i=\sum_{j=1}^mb_{i,j}2^j$
332334
$s'_i=\sum_{j=1}^m\delta_j^{-b_{i,j}}$
333335
$\textbf{s-step CAAUrdleproofs:}$
@@ -364,9 +366,9 @@ \subsubsection{CAAUrdleproofs}
364366

365367
In Curdleproofs, both the~\gls{sameperm} and~\gls{samemsm} proof are recursive~\glspl{ipa}.
366368
So, the modifications and optimization used on the~\gls{sameperm} argument are also used on the~\gls{samemsm} argument.
367-
The modifications include the split into set $T$ and $S$ before recursion and the construction of the bit matrix,~$b_{i,j}$, to keep track of multiplications on individual elements.
369+
The modifications include the split into set $\mathbf{\mathcal{T}}$ and $\mathbf{\mathcal{S}}$ before recursion and the construction of the bit matrix,~$b_{i,j}$, to keep track of multiplications on individual elements.
368370

369-
It is also worth noting that the concatenation of $T$ and $S$ in the recursive phase, lines 26--29 in~\autoref{lst:ipa-prover}, is handled effectively in the code.
371+
It is also worth noting that the concatenation of $\mathbf{\mathcal{T}}$ and $\mathbf{\mathcal{S}}$ in the recursive phase, lines 26--29 in~\autoref{lst:ipa-prover}, is handled effectively in the code.
370372
Instead of concatenating, the computation uses pointers to the original vector, so it never practically concatenates.
371373

372374
The code also uses the fact that the used scheme function will always end up with vectors being a power of two after the first round.

0 commit comments

Comments
 (0)