Skip to content

Shifted Value Indices

Specifying shifted components of the witness

A shifted value index is basically a witness component that has been shifted in a prescribed way by a prescribed amount. They will feature essentially in our constraints, which we describe after this. Here, we specify them in detail.

Shift Types

We support three shift types, logical left, logical right, and arithmetic right. We write these symbolically as {sll,srl,sra}\{\mathsf{sll}, \mathsf{srl}, \mathsf{sra}\}

Our shift operations do what they sound like. Each acts exclusively on 64-bit words; we allow shift amounts s{0,,63}s \in \{0, \ldots , 63\}. Logical leftshift shifts towards the more-significant end, zero-filling; logical rightshift shifts towards the less-significant end. Arithmetic rightshift "sign-extends"; whatever the most-significant (63rd) bit is will be "dragged" or populated rightwards.

Prover Data

Our system's runtime-dependent, prover-supplied data will be a long array of 64-bit words. This data will be made up of three "stretches": the constant part, the input–output part, and the witness part. Both the constant and input–output parts will be "visible" to the verifier, and will made to exactly match public data known to the verifier. The input–output part can be thought of as the "statement"; it will change from proof to proof, but will be visible to the verifier. The prover's witness data will impact the verifier's runtime only polylogarithmically.

The lengths of three these stretches will be fixed at compile-time; we can write nconstn_\text{const}, ninoutn_\text{inout}, and nwitnessn_\text{witness} for these lengths. We will write ww for the concatenation of all three of these stretches. The total length of ww will thus be nwordsnconst+ninout+nwitnessn_\text{words} \coloneqq n_\text{const} + n_\text{inout} + n_\text{witness}. Thus each element y{0,,nwords1}y \in \{0, \ldots , n_\text{words} - 1\} will index into an element of prover data. We will write w[y]w[y] for the yyth prover word.

Throughout, we use the term "prover data", and not "witness", for ww, since only part of the prover data will consist of the witness. But intuitively, ww is witness-like.

Shifted Value Indices

A shifted value index is a triple consisting of an index y{0,,nwords1}y \in \{0, \ldots , n_\text{words} - 1\}, a 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\}. We can write each such thing like (y,op,s)(y, \text{op}, s). Each shifted value index lives in the set

(y,op,s){0,,nwords1}×{sll,srl,sra}×{0,,63}.\begin{equation*}(y, \text{op}, s) \in \{0, \ldots , n_\text{words} - 1\} \times \{ \mathsf{sll}, \mathsf{srl}, \mathsf{sra}\} \times \{0, \ldots , 63\}.\end{equation*}

Each shifted value index represents a component of the prover's data, a shift operation or type, and a shift amount.

For example, the shifted value index (55,sll,10)(55, \mathsf{sll}, 10) represents w[55] << 10, "the 55th component of runtime-dependent data, shifted left by 10 steps".