Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

square

Computes the square of a matrix in GF(2), i.e dst = dst x src.

This produces the operator for doubling the number of zeroes: if src represents advancing the CRC by k zeroes, then dest will represent advancing by 2k zeroes.

Since polynomial multiplication mod POLY is linear, mat(mat(x)) = mat^2(x) gives the effect of two sequential applications of the operator.

Crc32c.square
fn square(dst: *[32]u32, src: *const [32]u32) void

File

lib/std/hash/crc/Crc32c.zig:134

Code

fn square(dst: *[32]u32, src: *const [32]u32) void {
    for (dst, src) |*d, s| {
        d.* = times(src, s);
    }
}