def fits
import bend-collections-laws-crypto@1.0.0.0/src/crypto/mac.bend as Macimport Base
20# Whether a key fits in the block, looking at no more than 65 of its bytes
21# (the length of a long key is never computed).
22def fits(key: List<&2, U32>, n: Nat) -> Bool:
23 match key n:
24 case Nil{} _:
25 True{}
26 case k <> rest 0n:
27 False{}
28 case k <> rest 1n+p:
29 fits(rest, p)