From: Chris Duncan Date: Sat, 30 Aug 2025 07:41:34 +0000 (-0700) Subject: Remove privatization. X-Git-Tag: v0.10.5~38^2~6 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=59c7076f51ecf42035ac1762ac68f7f99ebff37a;p=libnemo.git Remove privatization. --- diff --git a/src/lib/crypto/nano-nacl.ts b/src/lib/crypto/nano-nacl.ts index 3c82cb4..8ce4bd3 100644 --- a/src/lib/crypto/nano-nacl.ts +++ b/src/lib/crypto/nano-nacl.ts @@ -31,7 +31,7 @@ export class NanoNaCl { * * @returns 0 if first 32 bytes are equal, else 1 if there is at least one bit difference */ - static #vn (x: Uint8Array, y: Uint8Array): number { + static vn (x: Uint8Array, y: Uint8Array): number { let d: number = 0 for (let i = 0; i < 32; i++) { d |= x[i] ^ y[i] @@ -87,7 +87,7 @@ export class NanoNaCl { const d: Uint8Array = new Uint8Array(32) this.pack25519(c, a) this.pack25519(d, b) - return this.#vn(c, d) + return this.vn(c, d) } static pack25519 (out: Uint8Array, n: Float64Array): void { @@ -453,7 +453,7 @@ export class NanoNaCl { n -= 64 // if any bits unequal, zero out and return -1 - const vn = this.#vn(sm, t) ^ 1 + const vn = this.vn(sm, t) ^ 1 for (let i = 0; i < n; i++) { m[i] = sm[i + 64] * vn }