]> git.codecow.com Git - nano25519.git/commitdiff
Documentation.
authorChris Duncan <chris@codecow.com>
Sun, 4 Oct 2026 18:17:08 +0000 (11:17 -0700)
committerChris Duncan <chris@codecow.com>
Sun, 4 Oct 2026 18:17:08 +0000 (11:17 -0700)
src/assembly/ed25519/fe.ts
src/assembly/ed25519/ge.ts

index 919a414490b211fe5a216e51c51ba38f7cb1bcdf..393f3d2197cde47234870ea186bd0291560a3e9b 100644 (file)
@@ -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
index df4dd2545ca93334a832a612e4fbcd63fb2e993e..0e47f27172698cb91e2a33142f27cc4c64bbfc6d 100644 (file)
@@ -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<u8>} s 32-byte encoded group element
  * @returns 0 if `s < p`, else -1
  */
 export function ge_is_canonical (s: StaticArray<u8>): i32 {