feature. See also
. The project being documented here (as the example) is the Zig library itself.
argon2.blamkaGeneric
fn blamkaGeneric(x: *[16]u64) void
File
Code
fn blamkaGeneric(x: *[16]u64) void {
const rounds = comptime [_]QuarterRound{
Rp(0, 4, 8, 12),
Rp(1, 5, 9, 13),
Rp(2, 6, 10, 14),
Rp(3, 7, 11, 15),
Rp(0, 5, 10, 15),
Rp(1, 6, 11, 12),
Rp(2, 7, 8, 13),
Rp(3, 4, 9, 14),
};
inline for (rounds) |r| {
x[r.a] = fBlaMka(x[r.a], x[r.b]);
x[r.d] = math.rotr(u64, x[r.d] ^ x[r.a], 32);
x[r.c] = fBlaMka(x[r.c], x[r.d]);
x[r.b] = math.rotr(u64, x[r.b] ^ x[r.c], 24);
x[r.a] = fBlaMka(x[r.a], x[r.b]);
x[r.d] = math.rotr(u64, x[r.d] ^ x[r.a], 16);
x[r.c] = fBlaMka(x[r.c], x[r.d]);
x[r.b] = math.rotr(u64, x[r.b] ^ x[r.c], 63);
}
}