From fd71dd59f9d78119538f4ea652e68cdf5f5c3198 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 4 Oct 2026 11:17:08 -0700 Subject: [PATCH] Documentation. --- src/assembly/ed25519/fe.ts | 14 +++++++------- src/assembly/ed25519/ge.ts | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/assembly/ed25519/fe.ts b/src/assembly/ed25519/fe.ts index 919a414..393f3d2 100644 --- a/src/assembly/ed25519/fe.ts +++ b/src/assembly/ed25519/fe.ts @@ -881,10 +881,10 @@ export function fe_sq (h: FieldElement, f: FieldElement): void { * Can overlap h with f. * * Preconditions: - * |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. + * |f| bounded by 1.65*2²⁶,1.65*2²⁵,1.65*2²⁶,1.65*2²⁵,etc. * * Postconditions: - * |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc. + * |h| bounded by 1.01*2²⁵,1.01*2²⁴,1.01*2²⁵,1.01*2²⁴,etc. * * @param h FieldElement power destination * @param f FieldElement base source @@ -911,11 +911,11 @@ export function fe_sq2 (h: FieldElement, f: FieldElement): void { const f6_2: i64 = f6 * 2 const f7_2: i64 = f7 * 2 - const f5_38: i64 = f5 * 38 /* 1.959375*2^30 */ - const f6_19: i64 = f6 * 19 /* 1.959375*2^30 */ - const f7_38: i64 = f7 * 38/* 1.959375*2^30 */ - const f8_19: i64 = f8 * 19/* 1.959375*2^30 */ - const f9_38: i64 = f9 * 38/* 1.959375*2^30 */ + const f5_38: i64 = f5 * 38 /* 1.959375 * 2³⁰ */ + const f6_19: i64 = f6 * 19 /* 1.959375 * 2³⁰ */ + const f7_38: i64 = f7 * 38/* 1.959375 * 2³⁰ */ + const f8_19: i64 = f8 * 19/* 1.959375 * 2³⁰ */ + const f9_38: i64 = f9 * 38/* 1.959375 * 2³⁰ */ const f0f0: i64 = f0 * f0 const f0f1_2: i64 = f0_2 * f1 diff --git a/src/assembly/ed25519/ge.ts b/src/assembly/ed25519/ge.ts index df4dd25..0e47f27 100644 --- a/src/assembly/ed25519/ge.ts +++ b/src/assembly/ed25519/ge.ts @@ -265,6 +265,8 @@ export function ge_has_small_order (p: ge_p3): i32 { } /** + * Checks input `s` is less than the field prime `p = 2²⁵⁵ - 19` + * @param {StaticArray} s 32-byte encoded group element * @returns 0 if `s < p`, else -1 */ export function ge_is_canonical (s: StaticArray): i32 { -- 2.52.0