Skip to content

Shifted Witness Polynomials

Expressing bitshifting algebraically

Let's say we have a length-nwordsn_\text{words} vector ww, whose components w[y]w[y] are 64-bit words.

Let's now fix some shift type op{sll,srl,sra}\text{op} \in \{\mathsf{sll}, \mathsf{srl}, \mathsf{sra}\} and a shift amount s{0,,63}s \in \{0, \ldots , 63\}. Let's say we want to shift each of ww's nwordsn_\text{words} components by ss using op\text{op}. This gives us a new nwordsn_\text{words}-word list. Let's give it a name: for each y{0,,nwords1}y \in \{0, \ldots , n_\text{words} - 1\}, we let

shiftop(w)(y,s)op(w[y],s).\begin{equation*}\textsf{shift}_{\text{op}}(w)(y, s) \coloneqq \text{op}(w[y], s).\end{equation*}

We will call these the shifted witness functions.

As Polynomials

What happens if we put both ww and shiftop(w)(y,s)\textsf{shift}_{\text{op}}(w)(y, s) through multilinearization? How will the resulting multilinears relate to each other?

At this point, we assume that nwords=2wordsn_\text{words} = 2^{\ell_\text{words}} is a power of 2. Let's review what multilinearization means, in this context. Going back to our original array ww, we can identify ww with a 6+words6 + \ell_\text{words}-variate multilinear over F2\mathbb{F}_2:

w~(J0,,J5,Y0,,Ywords1).\begin{equation*}\widetilde{w}(J_0, \ldots , J_5, Y_0, \ldots , Y_{\ell_\text{words} - 1}).\end{equation*}

The indeterminates J0,,J5J_0, \ldots , J_5 control the "bit within the word"; the indeterminates Y0,,Ywords1Y_0, \ldots , Y_{\ell_\text{words} - 1} control the "word index". In other words, for each word index yBwordsy \in \mathcal{B}_{\ell_\text{words}} and each bit index jB6j \in \mathcal{B}_6, w~(j,y)=w[y]j\widetilde{w}(j, y) = w[y]_j (i.e., the "jjth bit" of the latter).

Similarly, we can define the shifted witness polynomial

shift~op(w)(I,Y,S),\begin{equation*}\widetilde{\textsf{shift}}_{\text{op}}(w)(I, Y, S),\end{equation*}

simply by multilinear-extending shiftop(w)(y,s)\textsf{shift}_{\text{op}}(w)(y, s). Note that we again need to pick up 6 new variables—which we now call I0,,I5I_0, \ldots , I_5—that control the bit index within the word. Our defining property is that for each iB6i \in \mathcal{B}_6, yBwordsy \in \mathcal{B}_{\ell_\text{words}} and sB6s \in \mathcal{B}_6 in the cube, shift~op(w)(i,y,s)=shiftop(w)(y,s)i=op(w[y],s)i\widetilde{\textsf{shift}}_{\text{op}}(w)(i, y, s) = \textsf{shift}_{\text{op}}(w)(y, s)_i = \text{op}(w[y], s)_i (we again take the "iith bit").

How do we efficiently relate an evaluation claim on shift~op(w)(I,Y,S)\widetilde{\textsf{shift}}_{\text{op}}(w)(I, Y, S) to an evaluation claim on w~(J,Y)\widetilde{w}(J, Y)? The most naïve possible approach would read ww's entire table of values, shift them all, and compute a multilinear evaluation on 6+words+66 + \ell_\text{words} + 6 variables. This is obviously unacceptable.

The Shift Indicators

We introduce shift indicators, and explain how they help us solve this problem. We again fix a shift type op{sll,srl,sra}\text{op} \in \{\mathsf{sll}, \mathsf{srl}, \mathsf{sra}\}.

For each such op\text{op}, we define a corresponding function from B6×B6×B6{0,1}\mathcal{B}_6 \times \mathcal{B}_6 \times \mathcal{B}_6 \to \{0, 1\}:

shift-indop(i,j,s){1 if the ith bit of op(v,s) is the jth bit of v0 otherwise\begin{equation*}\textsf{shift-ind}_\text{op}(i, j, s) \coloneqq \begin{cases} 1 & \text{ if the $i^{\text{th}}$ bit of $\text{op}(v, s)$ \text{is the $j^{\text{th}}$ bit of $v$}} \\ 0 & \text{ otherwise} \end{cases}\end{equation*}

For each triple of inputs ii, jj and ss, it either is or isn't true that the iith bit position of op(v,s)\text{op}(v, s) is precisely the jjth bit position of vv (i.e., for each possible input vv). The shift indicator picks up that fact.

With a bit of work we can unwind exactly what these mean. For each ii, jj and ss in B6\mathcal{B}_6,

  • shift-ind~sll(i,j,s)=1\widetilde{\textsf{shift-ind}}_{\mathsf{sll}}(i, j, s) = 1 if and only if {j}+{s}={i}\{j\} + \{s\} = \{i\}.
  • shift-ind~srl(i,j,s)=1\widetilde{\textsf{shift-ind}}_{\mathsf{srl}}(i, j, s) = 1 if and only if {i}+{s}={j}\{i\} + \{s\} = \{j\}.
  • shift-ind~sra(i,j,s)=1\widetilde{\textsf{shift-ind}}_{\mathsf{sra}}(i, j, s) = 1 if and only if {i}+{s}={j}\{i\} + \{s\} = \{j\} or both {j}=63\{j\} = 63 and {i}64{s}\{i\} \geq 64 - \{s\} hold.

We will come back to these descriptions when we arithmetize the functions, in the next two pages.

Multilinear Shift Indicators

Now, we will write

shift-ind~op(I,J,S)\begin{equation*}\widetilde{\textsf{shift-ind}}_\text{op}(I, J, S)\end{equation*}

for the multilinear extension of shift-indop(i,j,s)\textsf{shift-ind}_\text{op}(i, j, s). This extension is a multilinear polynomial, with F2\mathbb{F}_2-coefficients, on 6×3=186 \times 3 = 18 variables.

We now note the equality of multilinears:

shift~op(w~)(I,Y,S)=jB6shift-ind~op(I,j,S)w~(j,Y).\begin{equation*}\widetilde{\textsf{shift}}_\text{op}(\widetilde{w})(I, Y, S) = \sum_{j \in \mathcal{B}_6} \widetilde{\textsf{shift-ind}}_\text{op}(I, j, S) \cdot \widetilde{w}(j, Y).\end{equation*}

To check this equality, it's enough to check it on the cube. We fix iB6i \in \mathcal{B}_6, yBwordsy \in \mathcal{B}_{\ell_\text{words}} and sB6s \in \mathcal{B}_6. Our goal is to show that for each such specialization,

shift~op(w~)(i,y,s)=?jB6shift-ind~op(i,j,s)w~(j,y).\begin{equation*}\widetilde{\textsf{shift}}_\text{op}(\widetilde{w})(i, y, s) \stackrel{?}= \sum_{j \in \mathcal{B}_6} \widetilde{\textsf{shift-ind}}_\text{op}(i, j, s) \cdot \widetilde{w}(j, y).\end{equation*}

This is basically an exercise. The sum jB6shift-ind~op(i,j,s)w~(j,y)\sum_{j \in \mathcal{B}_6} \widetilde{\textsf{shift-ind}}_\text{op}(i, j, s) \cdot \widetilde{w}(j, y) has at most one nonzero summand. If, for some jB6j \in \mathcal{B}_6, shift-indop(i,j,s)=1\textsf{shift-ind}_\text{op}(i, j, s) = 1, the sum will pick up exactly the jjth bit w~(j,y)\widetilde{w}(j, y), which itself equals w[y]jw[y]_j. On the other hand, by definition of shift-indop\textsf{shift-ind}_\text{op}, w[y]j=op(w[y],s)iw[y]_j = \text{op}(w[y], s)_i, which itself equals shiftop(w)(y,s)i=shift~op(w~)(i,y,s)\textsf{shift}_\text{op}(w)(y, s)_i = \widetilde{\textsf{shift}}_\text{op}(\widetilde{w})(i, y, s), by definition of the latter things. This is basically an idea from [DP25, § 4.3].

This equality opens up the door to using the sumcheck to relate a claim on shift~op(w)(I,Y,S)\widetilde{\textsf{shift}}_{\text{op}}(w)(I, Y, S) to one on w~(J,Y)\widetilde{w}(J, Y). Indeed, given an evaluation claim on the former, by running a 6-round sumcheck, the verifier can reduce it to two evaluation claims, on shift-ind~op\widetilde{\textsf{shift-ind}}_\text{op} and w~\widetilde{w} respectively.

If the former, i.e. shift-ind~op\widetilde{\textsf{shift-ind}}_\text{op}, is succinct, then we have solved our problem. Indeed, the verifier can evaluate that one himself, and then output the single, final evaluation claim on w~\widetilde{w}.

The rest of this site section will be devoted to arguing that the polynomials shift-ind~op(I,J,S)\widetilde{\textsf{shift-ind}}_\text{op}(I, J, S) are succinct, for each op\text{op}.