Skip to content

MUL Constraints

Enforcing unsigned-integer-multiplication relations

Multiplication constraints let us capture the unsigned integer multiplication of 64-bit words. We now fix a total number of MUL constraints, nmuln_\text{mul}. For each x{0,,nmul1}x \in \{0, \ldots , n_\text{mul} - 1\}, the xxth MUL constraint is a tuple (Lxp,Lxq,Lxhi,Lxlo)(L^p_x, L^q_x, L^\text{hi}_x, L^\text{lo}_x) of four lists of shifted value indices.

The Constraint Arrays

Immediately adopting the constraint array formalism, we now obtain length-nmuln_\text{mul} arrays pp, qq, lo\text{lo}, and hi\text{hi} of 64-bit words, defined, for each x{0,,nmul1}x \in \{0, \ldots , n_\text{mul} - 1\}, by:

p[x](y,op,s)Lxpop(w[y],s),q[x](y,op,s)Lxqop(w[y],s),lo[x](y,op,s)Lxloop(w[y],s),hi[x](y,op,s)Lxhiop(w[y],s).\begin{align*} p[x] \coloneqq \bigoplus_{(y, \text{op}, s) \in L^p_x} \text{op}(w[y], s), \\ q[x] \coloneqq \bigoplus_{(y, \text{op}, s) \in L^q_x} \text{op}(w[y], s), \\ \text{lo}[x] \coloneqq \bigoplus_{(y, \text{op}, s) \in L^\text{lo}_x} \text{op}(w[y], s), \\ \text{hi}[x] \coloneqq \bigoplus_{(y, \text{op}, s) \in L^\text{hi}_x} \text{op}(w[y], s). \\ \end{align*}

The prover data ww fulfills the constraint system's MUL constraints if, for each x{0,,nmul1}x \in \{0, \ldots , n_\text{mul} - 1\},

p[x]q[x]=?264hi[x]+lo[x]\begin{equation*}p[x] \cdot q[x] \stackrel{?}= 2^{64} \cdot \text{hi}[x] + \text{lo}[x]\end{equation*}

holds over the integers. We interpret all of the words p[x]p[x], q[x]q[x], hi[x]\text{hi}[x] and lo[x]\text{lo}[x] as as elements of {0,,2641}\{0, \ldots , 2^{64} - 1\}, and interpret the \cdot symbol as integer multiplication. That is, the product p[x]q[x]p[x] \cdot q[x] is double-width; its high and low halves are given by hi[x]\text{hi}[x] and lo[x]\text{lo}[x].