static XY: BigInt64Array = new BigInt64Array([0xdd90n, 0xa5b7n, 0x8ab3n, 0x6dden, 0x52f5n, 0x7751n, 0x9f80n, 0x20f0n, 0xe37dn, 0x64abn, 0x4e8en, 0x66ean, 0x7665n, 0xd78bn, 0x5f0fn, 0xe787n])\r
\r
static #vn (x: Uint8Array, xi: number, y: Uint8Array, yi: number, n: number): number {\r
- let d = 0\r
+ let d: number = 0\r
for (let i = 0; i < n; i++) {\r
d |= x[xi + i] ^ y[yi + i]\r
}\r
}\r
\r
static car25519 (out: BigInt64Array): void {\r
- let v, c, s = 1n << 16n\r
+ let v: bigint, c: bigint\r
+ const s: bigint = 1n << 16n\r
c = 0n\r
for (let i = 0; i < 16; i++) {\r
v = out[i] + c + s\r
}\r
\r
static neq25519 (a: BigInt64Array, b: BigInt64Array): number {\r
- const c = new Uint8Array(32)\r
- const d = new Uint8Array(32)\r
+ const c: Uint8Array = new Uint8Array(32)\r
+ const d: Uint8Array = new Uint8Array(32)\r
this.pack25519(c, a)\r
this.pack25519(d, b)\r
return this.#vn(c, 0, d, 0, 32)\r
}\r
\r
static par25519 (a: BigInt64Array): number {\r
- const d = new Uint8Array(32)\r
+ const d: Uint8Array = new Uint8Array(32)\r
this.pack25519(d, a)\r
return d[0] & 1\r
}\r
}\r
\r
static Multiply (out: BigInt64Array, a: BigInt64Array, b: BigInt64Array): void {\r
- let v, c, s: bigint = 1n << 16n\r
+ let v: bigint, c: bigint\r
+ const s: bigint = 1n << 16n\r
const t: BigInt64Array = new BigInt64Array(31)\r
t.fill(0n)\r
\r
}\r
\r
static Square (out: BigInt64Array, a: BigInt64Array): void {\r
- let v, c, s: bigint = 1n << 16n\r
+ let v: bigint, c: bigint\r
+ const s: bigint = 1n << 16n\r
const t: BigInt64Array = new BigInt64Array(31)\r
t.fill(0n)\r
\r
}\r
\r
static reduce (r: Uint8Array): void {\r
- const x = new BigInt64Array(64)\r
+ const x: BigInt64Array = new BigInt64Array(64)\r
for (let i = 0; i < 64; i++) {\r
x[i] = BigInt(r[i])\r
}\r