def expanded_rounds

bend-collections-laws-crypto@1.0.0.0 · src/crypto/sha/core.bend:104

import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha/core.bend as Core
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha/state.bend as S

104# Generate each derived schedule word immediately before its round. The reverse
105# history is still retained for the recurrence, but the chronological 48-word
106# extension is never materialized.
107def expanded_rounds(n: Nat, +history: List<&2, U32>, ks: List<&2, U32>, s: S.State) -> S.State:
108  match n ks:
109    case 0n _:
110      s
111    case 1n+p Nil{}:
112      s
113    case 1n+p k <> kt:
114      +w = next_word(history)
115      expanded_rounds(p, w <> history, kt, step(s, k, w))

Uses (6)

Used by (3)