def expanded_rounds
import bend-collections@1.0.0.0/src/crypto/sha/core.bend as Coreimport Base
import bend-collections@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))