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 › ff › testCt Private Function testCt Doc Source Private Function std.crypto.ff.testCt
fn testCt (ct_ : anytype ) !void Params File crypto/ff.zig: 1066
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082 fn testCt (ct_ : anytype ) !void {
const l0 : Limb = 0 ;
const l1 : Limb = 1 ;
try testing .expectEqual (l1 , ct_ .select (true , l1 , l0 ));
try testing .expectEqual (l0 , ct_ .select (false , l1 , l0 ));
try testing .expectEqual (false , ct_ .eql (l1 , l0 ));
try testing .expectEqual (true , ct_ .eql (l1 , l1 ));
const M = Modulus (256 );
const m = try M .fromPrimitive (u256 , 3429938563481314093726330772853735541133072814650493833233 );
const x = try M .Fe .fromPrimitive (u256 , m , 80169837251094269539116136208111827396136208141182357733 );
const y = try M .Fe .fromPrimitive (u256 , m , 24620149608466364616251608466389896540098571 );
try testing .expectEqual (false , ct_ .limbsCmpLt (x .v , y .v ));
try testing .expectEqual (true , ct_ .limbsCmpGeq (x .v , y .v ));
try testing .expectEqual (WideLimb { .hi = 0 , .lo = 0x88 }, ct_ .mulWide (1 << 3 , (1 << 4 ) + 1 ));
}