Functions

inline fn clamp(s: *CompressedScalar) void

Perform the X25519 “clamping” operation. The scalar is then guaranteed to be a …

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

fn mul8(s: CompressedScalar) CompressedScalar

Return a*8 (mod L)

fn neg(s: CompressedScalar) CompressedScalar

Return -s (mod L)

fn random() CompressedScalar

Return a random scalar < L

fn reduce(s: CompressedScalar) CompressedScalar

Reduce a scalar to the field size.

fn reduce64(s: [64]u8) CompressedScalar

Reduce a 64-bytes scalar to the field size.

fn rejectNonCanonical(s: CompressedScalar) NonCanonicalError!void

Reject a scalar whose encoding is not canonical.

Values

field_order
u256

The scalar field order.

zero
undefined

Zero