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.

polyMakeHint

Creates a hint polynomial for the difference between perturbed and original high bits. Returns the number of hint bits set to 1 (the population count).

This is used during signature generation to create hints that help verification recover the high bits without access to the secret.

ml_dsa.polyMakeHint
fn polyMakeHint(p0: Poly, p1: Poly, comptime gamma2: u32) struct

File

lib/std/crypto/ml_dsa.zig:927

Code

fn polyMakeHint(p0: Poly, p1: Poly, comptime gamma2: u32) struct { hint: Poly, count: u32 } {
    var hint = Poly.zero;
    var count: u32 = 0;

    for (0..N) |i| {
        const h = makeHint(p0.cs[i], p1.cs[i], gamma2);
        hint.cs[i] = h;
        count += h;
    }

    return .{ .hint = hint, .count = count };
}