// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>\r
// SPDX-License-Identifier: GPL-3.0-or-later\r
-\r
+//@ts-nocheck\r
'use strict'\r
\r
// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\r
}\r
\r
// Note: difference from TweetNaCl - BLAKE2b used to hash instead of SHA-512.\r
- function crypto_hash (out, m, n) {\r
- const input = new Uint8Array(n)\r
- for (let i = 0; i < n; ++i) {\r
- input[i] = m[i]\r
- }\r
- const hash = new Blake2b(64).update(input).digest()\r
+ function crypto_hash (out: Uint8Array, m: Uint8Array, n: number) {\r
+ const hash = new Blake2b(64).update(m).digest()\r
for (let i = 0; i < 64; ++i) {\r
out[i] = hash[i]\r
}\r
}\r
\r
// Note: difference from C - smlen returned, not passed as argument.\r
- function crypto_sign (sm, m, n, sk) {\r
+ function crypto_sign (sm: Uint8Array, m: Uint8Array, n: number, sk: Uint8Array) {\r
var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64)\r
var i, j, x = new Float64Array(64)\r
var p = [gf(), gf(), gf(), gf()]\r
return 0\r
}\r
\r
- function crypto_sign_open (m, sm, n, pk) {\r
+ function crypto_sign_open (m: Uint8Array, sm: Uint8Array, n: number, pk: Uint8Array) {\r
var i\r
var t = new Uint8Array(32), h = new Uint8Array(64)\r
var p = [gf(), gf(), gf(), gf()],\r