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 standard library.
std › crypto › Certificate › rsa › PSSSignature › MGF1 Private Function MGF1 Doc Source Private Function std.crypto.Certificate.rsa.PSSSignature.MGF1
fn MGF1 (comptime Hash : type , out : []u8 , seed : *const [Hash .digest_length ]u8 , len : usize ) ![]u8 Params Hash : type out : []u8 seed : *const [Hash .digest_length ]u8 len : usize File crypto/Certificate.zig: 1166
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179 fn MGF1 (comptime Hash : type , out : []u8 , seed : *const [Hash .digest_length ]u8 , len : usize ) ![]u8 {
var counter : u32 = 0 ;
var idx : usize = 0 ;
var hash = seed .* ++ @as ([4 ]u8 , undefined );
while (idx < len ) {
std .mem .writeInt (u32 , hash [seed .len ..][0 ..4 ], counter , .big );
Hash .hash (&hash , out [idx ..][0 ..Hash .digest_length ], .{});
idx += Hash .digest_length ;
counter += 1 ;
}
return out [0 ..len ];
}