Computes mat * vec over GF(2), where mat is a 32x32 binary matrix and vec
is a 32-bit vector. This somewhat "simulates" how bits propagate through the CRC register
during shifting.
AND, and addition is XOR.vec has 1s.fn times(mat: *const [32]u32, vec: u32) u32
fn times(mat: *const [32]u32, vec: u32) u32 {
var sum: u32 = 0;
var v = vec;
var i: u32 = 0;
while (v != 0) {
if (v & 1 != 0) sum ^= mat[i];
v >>= 1;
i += 1;
}
return sum;
}