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.

compressPre

blake3.compressPre
fn compressPre(state: *[16]u32, cv: *const [8]u32, block: []const u8, block_len: u8, counter: u64, flags: Flags) void

File

lib/std/crypto/blake3.zig:140

Code

fn compressPre(state: *[16]u32, cv: *const [8]u32, block: []const u8, block_len: u8, counter: u64, flags: Flags) void {
    var block_words: [16]u32 = undefined;
    for (0..16) |i| {
        block_words[i] = load32(block[i * 4 ..][0..4]);
    }

    for (0..8) |i| {
        state[i] = cv[i];
    }
    for (0..4) |i| {
        state[i + 8] = iv[i];
    }
    state[12] = counterLow(counter);
    state[13] = counterHigh(counter);
    state[14] = @as(u32, block_len);
    state[15] = @as(u32, flags.toInt());

    for (0..7) |round| {
        roundFn(state, &block_words, round);
    }
}