Index Mathematics Conjectures nbv lettuce Widgets

blake3_rotate_rows

stdlib/blake3/blake3_rotate_rows.nbv

blake3_rotate_rows(state, static kb, static kc, static kd)

Rotate the words of rows b, c and d of a batch of BLAKE3 states (see blake3_g) left by kb, kc and kd words. 1, 2, 3 lines the diagonals up as columns and 3, 2, 1 undoes it.

Calls
blake3/blake3_rotate_words, slice
Precompiles
clone!, concat!, div_exact!, len!
Used by
blake3/blake3_compress

Source

# Rotate the words of rows b, c and d of a batch of BLAKE3 states (see
# blake3_g) left by `kb`, `kc` and `kd` words. 1, 2, 3 lines the diagonals up
# as columns and 3, 2, 1 undoes it.
(state, static kb, static kc, static kd)

static w = div_exact! (len! state), 4
let b = blake3_rotate_words(slice((clone! state), w, w), kb)
let c = blake3_rotate_words(slice((clone! state), 2 * w, w), kc)
let d = blake3_rotate_words(slice((clone! state), 3 * w, w), kd)
concat! slice(state, 0, w), b, c, d