def next_word
import bend-collections@1.0.0.0/src/crypto/sha/core.bend as Coreimport Base
69# Schedule histories always contain at least 16 words. Destructuring that prefix
70# avoids four independent linked-list walks for every expanded word; the fallback
71# preserves the total behavior used by the universal refinement theorem.
72def next_word(+history: List<&2, U32>) -> U32:
73 match history:
74 case a <> b <> c <> d <> e <> f <> g <> h <> i <> j <> k <> l <> m <> n <> o <> (p <> rest):
75 (small1(b) + g + small0(o) + p : U32)
76 case _:
77 next_word_slow(history)
Uses (6)
Used by (5)
- bend-collections@1.0.0.0/src/crypto/sha/core:expand
- bend-collections@1.0.0.0/src/crypto/sha/core:expanded_rounds
- bend-collections@1.0.0.0/proofs/crypto/sha/conformance:expanded_rounds_correct
- bend-collections@1.0.0.0/proofs/crypto/sha/conformance:extension_correct
- bend-collections@1.0.0.0/proofs/crypto/sha/conformance:next_correct