]> git.codecow.com Git - nano25519.git/commitdiff
Remove unused imports and commented code.
authorChris Duncan <chris@codecow.com>
Sun, 8 Nov 2026 07:45:16 +0000 (23:45 -0800)
committerChris Duncan <chris@codecow.com>
Sun, 8 Nov 2026 07:45:16 +0000 (23:45 -0800)
src/assembly/ed25519/ge/scalarmult_base.ts

index ae91de7a52b93ae31ce6b00e47e4346af15c9403..709334a2add9c0d00f778182c0f4d0006f349eee 100644 (file)
@@ -3,7 +3,7 @@
 //! SPDX-License-Identifier: ISC
 
 import { base } from '../constants/base'
-import { p1p1, p1p1_0, p1p1_to_p3, p2, p2_0, p2_dbl_to_p2, p2_dbl_to_p3, p3, p3_0, p3_add_precomp, p3_add_precomp_to_p3, p3_dbl_to_p2, p3_tobytes, p_precomp, precomp_0 } from '../p'
+import { p1p1, p1p1_0, p2, p2_0, p2_dbl_to_p2, p2_dbl_to_p3, p3, p3_0, p3_add_precomp_to_p3, p3_dbl_to_p2, p3_tobytes, p_precomp, precomp_0 } from '../p'
 
 const h: p3 = new p3()
 const e: usize = changetype<usize>(new StaticArray<i8>(64))
@@ -30,8 +30,6 @@ const t: p_precomp = new p_precomp()
  */
 export function ge_scalarmult_base_tobytes (S: StaticArray<u8>, a: StaticArray<u8>): void {
        for (let i = 0; i < 32; ++i) {
-               // e[(i << 1) + 0] = (a[i] >> 0) & 15
-               // e[(i << 1) + 1] = (a[i] >> 4) & 15
                store<i8>(e + (i << 1), (a[i] >> 0) & 15)
                store<i8>(e + ((i << 1) + 1), (a[i] >> 4) & 15)
        }
@@ -41,17 +39,12 @@ export function ge_scalarmult_base_tobytes (S: StaticArray<u8>, a: StaticArray<u
        let carry: i8 = 0
        for (let ei = e; ei < e + 63; ei++) {
                let n = load<i8>(ei)
-               // e[i] += carry
                n += carry
-               // carry = e[i] + 8
-               // carry >>= 4
                carry = (n + 8) >> 4
-               // e[i] -= carry * (i8(1) << 4)
                n -= carry * (i8(1) << 4)
                store<i8>(ei, n)
 
        }
-       // e[63] += carry
        store<i8>(e + 63, load<i8>(e + 63) + carry)
        /* each e[i] is between -8 and 8 */
 
@@ -81,7 +74,6 @@ export function ge_scalarmult_base_tobytes (S: StaticArray<u8>, a: StaticArray<u
        p2_0(s)
        precomp_0(t)
        p3_0(h)
-       // e.fill(0)
        v128.store(e, i64x2.splat(0), 0)
        v128.store(e, i64x2.splat(0), 16)
        v128.store(e, i64x2.splat(0), 32)