]> git.codecow.com Git - nano25519.git/commitdiff
Use consistent variable names.
authorChris Duncan <chris@codecow.com>
Fri, 30 Oct 2026 19:47:30 +0000 (12:47 -0700)
committerChris Duncan <chris@codecow.com>
Fri, 30 Oct 2026 19:47:30 +0000 (12:47 -0700)
src/assembly/ed25519/ge.ts

index 2ef2506708c709a00bf67181f31ad9d173cdd792..70bd3c75cd241d45133f128e1e480eea68f16f33 100644 (file)
@@ -74,7 +74,7 @@ function ge_cmov8_base (t: p_precomp, bp: usize, b: i8): void {
 const ge_frombytes_negate_vartime_u: FieldElement = fe()
 const ge_frombytes_negate_vartime_v: FieldElement = fe()
 const ge_frombytes_negate_vartime_v3: FieldElement = fe()
-const ge_frombytes_negate_vartime_vxx: FieldElement = fe()
+const ge_frombytes_negate_vartime_vx2: FieldElement = fe()
 const ge_frombytes_negate_vartime_check: FieldElement = fe()
 /**
  * Variable-time point negation converted from byte representation.
@@ -89,7 +89,7 @@ export function ge_frombytes_negate_vartime (h: p3, s: StaticArray<u8>,
        const u = ge_frombytes_negate_vartime_u
        const v = ge_frombytes_negate_vartime_v
        const v3 = ge_frombytes_negate_vartime_v3
-       const vxx = ge_frombytes_negate_vartime_vxx
+       const vx2 = ge_frombytes_negate_vartime_vx2
        const check = ge_frombytes_negate_vartime_check
 
        fe_frombytes(h.Y, s)
@@ -119,14 +119,14 @@ export function ge_frombytes_negate_vartime (h: p3, s: StaticArray<u8>,
        fe_mul(h.X, h.X, u)
 
        // vxx = vx²
-       fe_sq(vxx, h.X)
-       fe_mul(vxx, vxx, v)
+       fe_sq(vx2, h.X)
+       fe_mul(vx2, vx2, v)
 
        // m = vx²-u
-       fe_sub(check, vxx, u)
+       fe_sub(check, vx2, u)
        if (fe_iszero(check, t_fe_0, t_u8x32) == 0) {
                // p = vx²+u
-               fe_add(check, vxx, u)
+               fe_add(check, vx2, u)
                if (fe_iszero(check, t_fe_0, t_u8x32) == 0) {
                        return -1
                }