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.

clamp

Perform the X25519 "clamping" operation. The scalar is then guaranteed to be a multiple of the cofactor.

scalar.clamp
pub fn clamp(s: *CompressedScalar) void

File

Code

pub fn clamp(s: *CompressedScalar) void {
    s[0] &= 248;
    s[31] = (s[31] & 127) | 64;
}