def window_rounds

bend-collections@1.0.0.0 · src/crypto/sha512/core.bend:83

import bend-collections@1.0.0.0/src/crypto/sha512/core.bend as Core
import Base
import bend-collections@1.0.0.0/src/crypto/sha512/types.bend as T

83# The remaining q rounds (64 after the block's own sixteen): each derives its
84# schedule word from the window, then drops the oldest word.
85def window_rounds(q: Nat, win: Sched, ks: List<&2, T.Lane>, s: T.State) -> T.State:
86  match q win ks:
87    case 0n _ _:
88      s
89    case 1n+r _ Nil{}:
90      s
91    case 1n+r Win{a, +b, c, d, e, f, +g, h, i, j, k, l, m, n, +o, +p} x <> xt:
92      +w = next(b, g, o, p)
93      window_rounds(r, Win{w, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o}, xt, step(s, x, w))

Uses (7)

Used by (1)