def mul
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/aes/poly.bend as Polyimport Base
26# The schoolbook product: (c + x*q(x)) * b(x) = c*b(x) + x*(q(x)*b(x)).
27def mul(a: List<&2, Bool>, +b: List<&2, Bool>) -> List<&2, Bool>:
28 match a:
29 case Nil{}:
30 Nil{}
31 case c <> q:
32 add(scale(c, b), False{} <> mul(q, b))