def lc.word_lsb
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as LegacyCiphersimport Base
215# the n-bit word whose bits, least significant first, are the first n of bs
216# (False past the end)
217def lc.word_lsb(n: Nat, bs: List<&2, Bool>) -> Word(n):
218 match n:
219 case 0n:
220 WNil{}
221 case 1n+p:
222 match bs:
223 case Nil{}:
224 WCon{False{}, lc.word_lsb(p, Nil{})}
225 case Con{h, t}:
226 WCon{h, lc.word_lsb(p, t)}