From f15ad56484b18370e50311120e6b94dc4d049808 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 9 Jan 2025 17:01:22 -0800 Subject: [PATCH] Update copyright notices. --- .gitignore | 2 +- AUTHORS.md | 2 +- LICENSES/MIT.txt | 16 +++++-- test/perf.account.js | 66 ----------------------------- test/{perf.block.js => perf.gpu.js} | 2 +- test/perf.main.mjs | 4 +- test/test.main.mjs | 2 +- 7 files changed, 18 insertions(+), 76 deletions(-) delete mode 100644 test/perf.account.js rename test/{perf.block.js => perf.gpu.js} (98%) diff --git a/.gitignore b/.gitignore index f09613a..bf9980d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2024 Chris Duncan +# SPDX-FileCopyrightText: 20245Chris Duncan # SPDX-License-Identifier: GPL-3.0-or-later # Logs diff --git a/AUTHORS.md b/AUTHORS.md index baa6f6a..77b719c 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,5 +1,5 @@ diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt index 3ed8b4d..94abb89 100644 --- a/LICENSES/MIT.txt +++ b/LICENSES/MIT.txt @@ -1,10 +1,18 @@ MIT License -Copyright (c) 2022 Miro Metsänheimo Copyright (c) 2018 Ben Green -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO +EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/perf.account.js b/test/perf.account.js deleted file mode 100644 index a62076a..0000000 --- a/test/perf.account.js +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Chris Duncan -// SPDX-License-Identifier: GPL-3.0-or-later - -'use strict' - -import { assert, average, skip, suite, test } from '#test/GLOBALS.mjs' -import { NANO_TEST_VECTORS } from '#test/VECTORS.js' -import { Bip44Wallet, Blake2bWallet } from '#dist/main.js' - -await suite('Account performance', async () => { - await test('Time to create 0x200 BIP-44 accounts', async () => { - const wallet = await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD) - await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) - const start = performance.now() - const accounts = await wallet.accounts(0, 0x1fff) - const end = performance.now() - console.log(`Total: ${end - start} ms`) - console.log(`Average: ${(end - start) / 0x2000} ms`) - assert.equals(accounts.length, 0x2000) - }) - - await test('Time to create 0x200 BLAKE2b accounts', async () => { - const wallet = await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD) - await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) - const start = performance.now() - const accounts = await wallet.accounts(0, 0x1fff) - const end = performance.now() - console.log(`Total: ${end - start} ms`) - console.log(`Average: ${(end - start) / 0x2000} ms`) - assert.equals(accounts.length, 0x2000) - }) - - await test('Time to create 1 BIP-44 account 0x20 times', async () => { - const times = [] - const wallet = await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD) - await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) - for (let i = 0; i < 0x20; i++) { - const start = performance.now() - await wallet.accounts(i) - const end = performance.now() - times.push(end - start) - } - const { total, arithmetic, harmonic, geometric } = average(times) - console.log(`Total: ${total} ms`) - console.log(`Average: ${arithmetic} ms`) - console.log(`Harmonic: ${harmonic} ms`) - console.log(`Geometric: ${geometric} ms`) - }) - - await test('Average time to create 1 BLAKE2b account 0x20 times', async () => { - const times = [] - const wallet = await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD) - await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) - for (let i = 0; i < 0x20; i++) { - const start = performance.now() - await wallet.accounts(i) - const end = performance.now() - times.push(end - start) - } - const { total, arithmetic, harmonic, geometric } = average(times) - console.log(`Total: ${total} ms`) - console.log(`Average: ${arithmetic} ms`) - console.log(`Harmonic: ${harmonic} ms`) - console.log(`Geometric: ${geometric} ms`) - }) -}) diff --git a/test/perf.block.js b/test/perf.gpu.js similarity index 98% rename from test/perf.block.js rename to test/perf.gpu.js index eb69249..28a7959 100644 --- a/test/perf.block.js +++ b/test/perf.gpu.js @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 Chris Duncan +// SPDX-FileCopyrightText: 20245Chris Duncan // SPDX-License-Identifier: GPL-3.0-or-later 'use strict' diff --git a/test/perf.main.mjs b/test/perf.main.mjs index 4a3faad..df9c5a2 100644 --- a/test/perf.main.mjs +++ b/test/perf.main.mjs @@ -1,6 +1,6 @@ -// SPDX-FileCopyrightText: 2024 Chris Duncan +// SPDX-FileCopyrightText: 20245Chris Duncan // SPDX-License-Identifier: GPL-3.0-or-later -import './perf.block.js' +import './perf.gpu.js' console.log('%cTESTING COMPLETE', 'color:orange;font-weight:bold') diff --git a/test/test.main.mjs b/test/test.main.mjs index 90d76f5..630ac3a 100644 --- a/test/test.main.mjs +++ b/test/test.main.mjs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 Chris Duncan +// SPDX-FileCopyrightText: 20245Chris Duncan // SPDX-License-Identifier: GPL-3.0-or-later import './test.calculate-pow.mjs' -- 2.47.3