def Mag.mul1
import bend-kit-bignum@0.1.0.0/bigint.bend as Bigintimport Base
122# a * m + c for m, c below 10^4.
123def Mag.mul1(a: List<&2, U32>, +m: U32, +c: U32) -> List<&2, U32>:
124 match a:
125 case Nil{}:
126 Mag.lone(U32.is_zero(c), c)
127 case Con{x, xs}:
128 +t = (x * m + c : U32)
129 Con{(t % 10000 : U32), Mag.mul1(xs, m, (t / 10000 : U32))}