feature. See also
. The project being documented here (as the example) is the Zig library itself.
argon2.initBlocks
fn initBlocks(
blocks: *Blocks,
h0: *H0,
memory: u32,
threads: u24,
) void
File
Code
fn initBlocks(
blocks: *Blocks,
h0: *H0,
memory: u32,
threads: u24,
) void {
var block0: [1024]u8 = undefined;
var lane: u24 = 0;
while (lane < threads) : (lane += 1) {
const j = lane * (memory / threads);
mem.writeInt(u32, h0[Blake2b512.digest_length + 4 ..][0..4], lane, .little);
mem.writeInt(u32, h0[Blake2b512.digest_length..][0..4], 0, .little);
blake2bLong(&block0, h0);
for (&blocks.items[j + 0], 0..) |*v, i| {
v.* = mem.readInt(u64, block0[i * 8 ..][0..8], .little);
}
mem.writeInt(u32, h0[Blake2b512.digest_length..][0..4], 1, .little);
blake2bLong(&block0, h0);
for (&blocks.items[j + 1], 0..) |*v, i| {
v.* = mem.readInt(u64, block0[i * 8 ..][0..8], .little);
}
}
}