Skip to main content

evaluate_shift_inds

Function evaluate_shift_inds 

Source
pub fn evaluate_shift_inds<E: FieldOps>(
    r_i: &[E],
    r_j: &[E],
    r_s: &[E],
) -> [E; 8]
Expand description

Evaluates the eight shift indicator multilinear extensions at one point.

A shift indicator is the 3·Word::LOG_BITS-variate multilinear extension of the predicate relating an output bit index i, an input bit index j and a shift amount s:

sll   i == j + s            sll32   i / 32 == j / 32 and i % 32 == j % 32 + s % 32
srl   j == i + s            srl32   likewise, over each half independently
sra   j == min(i + s, 63)   sra32
rotr  j == (i + s) % 64     rotr32

The results are ordered by ShiftVariant, so the array indexes straight by variant.

§Preconditions