From 6558eaf281c9de7ba680819952aeda9b16346dc8 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Fri, 22 Nov 2024 17:39:26 +0000 Subject: [PATCH] benchmark: fix --- benchmark/package-lock.json | 73 ++++++++++++++++++++++++++++--------- benchmark/package.json | 13 +++---- build/package.json | 3 +- package.json | 2 +- 4 files changed, 64 insertions(+), 27 deletions(-) diff --git a/benchmark/package-lock.json b/benchmark/package-lock.json index 1b185b4..0d6608c 100644 --- a/benchmark/package-lock.json +++ b/benchmark/package-lock.json @@ -6,12 +6,12 @@ "packages": { "": { "name": "benchmark", - "version": "0.1.0", - "license": "MIT", "dependencies": { + "@noble/ciphers": "file:.." + }, + "devDependencies": { "@chainsafe/as-chacha20poly1305": "0.1.0", "@devtomio/sodium": "0.3.0", - "@noble/ciphers": "file:noble-ciphers.tgz", "@stablelib/aes": "1.0.1", "@stablelib/chacha": "1.0.1", "@stablelib/chacha20poly1305": "1.0.1", @@ -31,12 +31,14 @@ "node_modules/@chainsafe/as-chacha20poly1305": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@chainsafe/as-chacha20poly1305/-/as-chacha20poly1305-0.1.0.tgz", - "integrity": "sha512-BpNcL8/lji/GM3+vZ/bgRWqJ1q5kwvTFmGPk7pxm/QQZDbaMI98waOHjEymTjq2JmdD/INdNBFOVSyJofXg7ew==" + "integrity": "sha512-BpNcL8/lji/GM3+vZ/bgRWqJ1q5kwvTFmGPk7pxm/QQZDbaMI98waOHjEymTjq2JmdD/INdNBFOVSyJofXg7ew==", + "dev": true }, "node_modules/@devtomio/sodium": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@devtomio/sodium/-/sodium-0.3.0.tgz", "integrity": "sha512-XL+alYPip4uRfeG8YizVfl0aPvIE61mnNCXGbKJWEQL4AL2q8zhLX7j9w24MYsZtHwOC7vWVcms68WeHDNm9Rw==", + "dev": true, "dependencies": { "@node-rs/helper": "^1.3.3", "tslib": "^2.3.1" @@ -61,6 +63,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "android" @@ -73,6 +76,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "darwin" @@ -85,6 +89,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "darwin" @@ -97,6 +102,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "freebsd" @@ -109,6 +115,7 @@ "cpu": [ "arm" ], + "dev": true, "optional": true, "os": [ "linux" @@ -121,6 +128,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -133,6 +141,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -145,6 +154,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -157,6 +167,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -169,6 +180,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "win32" @@ -177,13 +189,16 @@ "node_modules/@napi-rs/triples": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@napi-rs/triples/-/triples-1.2.0.tgz", - "integrity": "sha512-HAPjR3bnCsdXBsATpDIP5WCrw0JcACwhhrwIAQhiR46n+jm+a2F8kBsfseAuWtSyQ+H3Yebt2k43B5dy+04yMA==" + "integrity": "sha512-HAPjR3bnCsdXBsATpDIP5WCrw0JcACwhhrwIAQhiR46n+jm+a2F8kBsfseAuWtSyQ+H3Yebt2k43B5dy+04yMA==", + "dev": true }, "node_modules/@noble/ciphers": { - "version": "0.6.0", - "resolved": "file:noble-ciphers.tgz", - "integrity": "sha512-8YVbfZiei18sqvFBEAPxZFHeni8A4xODEenKlfsIwQLI0Y3DdTw1xKjjWAYI84oiAv7volyUX/C0+/x3bXmf5Q==", + "version": "1.0.0", + "resolved": "file:..", "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, "funding": { "url": "https://paulmillr.com/funding/" } @@ -192,6 +207,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@node-rs/helper/-/helper-1.6.0.tgz", "integrity": "sha512-2OTh/tokcLA1qom1zuCJm2gQzaZljCCbtX1YCrwRVd/toz7KxaDRFeLTAPwhs8m9hWgzrBn5rShRm6IaZofCPw==", + "dev": true, "dependencies": { "@napi-rs/triples": "^1.2.0" } @@ -199,12 +215,14 @@ "node_modules/@stablelib/aead": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/aead/-/aead-1.0.1.tgz", - "integrity": "sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==" + "integrity": "sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==", + "dev": true }, "node_modules/@stablelib/aes": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/aes/-/aes-1.0.1.tgz", "integrity": "sha512-bMiezJDeFONDHbMEa+Kic26962+bwkZfsHPAmcqTjLaHCAhEQuK3i1H0POPOkcHCdj75oVRIqFCraCA0cyHPvw==", + "dev": true, "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/blockcipher": "^1.0.1", @@ -215,6 +233,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", + "dev": true, "dependencies": { "@stablelib/int": "^1.0.1" } @@ -222,12 +241,14 @@ "node_modules/@stablelib/blockcipher": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/blockcipher/-/blockcipher-1.0.1.tgz", - "integrity": "sha512-4bkpV8HUAv0CgI1fUqkPUEEvv3RXQ3qBkuZaSWhshXGAz1JCpriesgiO9Qs4f0KzBJkCtvcho5n7d/RKvnHbew==" + "integrity": "sha512-4bkpV8HUAv0CgI1fUqkPUEEvv3RXQ3qBkuZaSWhshXGAz1JCpriesgiO9Qs4f0KzBJkCtvcho5n7d/RKvnHbew==", + "dev": true }, "node_modules/@stablelib/chacha": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", + "dev": true, "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -237,6 +258,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz", "integrity": "sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==", + "dev": true, "dependencies": { "@stablelib/aead": "^1.0.1", "@stablelib/binary": "^1.0.1", @@ -250,6 +272,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/cmac/-/cmac-1.0.1.tgz", "integrity": "sha512-q9mAkBMVJkquqSN2q2AtkcXYO0cH1qdcV4d8MUMGmqUNwdf9ACTDMBXrgMBHpxTVv7ZaPjuUwwvxhzoiVRaSRA==", + "dev": true, "dependencies": { "@stablelib/blockcipher": "^1.0.1", "@stablelib/constant-time": "^1.0.1", @@ -259,12 +282,14 @@ "node_modules/@stablelib/constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz", - "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==" + "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==", + "dev": true }, "node_modules/@stablelib/ctr": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@stablelib/ctr/-/ctr-1.0.2.tgz", "integrity": "sha512-Wq/Zr5QWNiXUu1UMhbeSIWhUm4YOhl01owaZOehxKFOKp6PPuUi9kAUAHv9cE5yQm9PLvIxzhwFco36sRpcOTQ==", + "dev": true, "dependencies": { "@stablelib/blockcipher": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -274,6 +299,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/@stablelib/gcm/-/gcm-1.0.2.tgz", "integrity": "sha512-sQIRPGti1UXm740RTI38Apbl3t0oEEQMsdKN6VbC8a2lFHff6Stg90IqbF1xSrMLmm52gDGwtODhub3rKOMkfQ==", + "dev": true, "dependencies": { "@stablelib/aead": "^1.0.1", "@stablelib/binary": "^1.0.1", @@ -286,12 +312,14 @@ "node_modules/@stablelib/int": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", - "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==", + "dev": true }, "node_modules/@stablelib/poly1305": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/poly1305/-/poly1305-1.0.1.tgz", "integrity": "sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==", + "dev": true, "dependencies": { "@stablelib/constant-time": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -301,6 +329,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/@stablelib/salsa20/-/salsa20-1.0.2.tgz", "integrity": "sha512-nfjKzw0KTKrrKBasEP+j7UP4I8Xudom8lVZIBCp0kQNARXq72IlSic0oabg2FC1NU68L4RdHrNJDd8bFwrphYA==", + "dev": true, "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/constant-time": "^1.0.1", @@ -311,6 +340,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/@stablelib/siv/-/siv-1.0.2.tgz", "integrity": "sha512-s8Ke+6qLFlZIAEJPdcS1/xUZ4npsDAYUxaeD9HITrAhKO83c7cIatQC1Kay5Pjl20LlL2UV3DvNK98EqrePifQ==", + "dev": true, "dependencies": { "@stablelib/blockcipher": "^1.0.1", "@stablelib/cmac": "^1.0.1", @@ -322,12 +352,14 @@ "node_modules/@stablelib/wipe": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", - "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==", + "dev": true }, "node_modules/@stablelib/xchacha20": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/xchacha20/-/xchacha20-1.0.1.tgz", "integrity": "sha512-1YkiZnFF4veUwBVhDnDYwo6EHeKzQK4FnLiO7ezCl/zu64uG0bCCAUROJaBkaLH+5BEsO3W7BTXTguMbSLlWSw==", + "dev": true, "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/chacha": "^1.0.1", @@ -338,6 +370,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/xchacha20poly1305/-/xchacha20poly1305-1.0.1.tgz", "integrity": "sha512-B1Abj0sMJ8h3HNmGnJ7vHBrAvxuNka6cJJoZ1ILN7iuacXp7sUYcgOVEOTLWj+rtQMpspY9tXSCRLPmN1mQNWg==", + "dev": true, "dependencies": { "@stablelib/aead": "^1.0.1", "@stablelib/chacha20poly1305": "^1.0.1", @@ -350,6 +383,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/@stablelib/xsalsa20/-/xsalsa20-1.0.2.tgz", "integrity": "sha512-7XdBGbcNgBShmuhDXv1G1WPVCkjZdkb1oPMzSidO7Fve0MHntH6TjFkj5bfLI+aRE+61weO076vYpP/jmaAYog==", + "dev": true, "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/salsa20": "^1.0.2", @@ -359,17 +393,20 @@ "node_modules/aes-js": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", - "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" + "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==", + "dev": true }, "node_modules/libsodium": { "version": "0.7.13", "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.13.tgz", - "integrity": "sha512-mK8ju0fnrKXXfleL53vtp9xiPq5hKM0zbDQtcxQIsSmxNgSxqCj6R7Hl9PkrNe2j29T4yoDaF7DJLK9/i5iWUw==" + "integrity": "sha512-mK8ju0fnrKXXfleL53vtp9xiPq5hKM0zbDQtcxQIsSmxNgSxqCj6R7Hl9PkrNe2j29T4yoDaF7DJLK9/i5iWUw==", + "dev": true }, "node_modules/libsodium-wrappers": { "version": "0.7.11", "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.11.tgz", "integrity": "sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q==", + "dev": true, "dependencies": { "libsodium": "^0.7.11" } @@ -377,12 +414,14 @@ "node_modules/tslib": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "dev": true }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true } } } diff --git a/benchmark/package.json b/benchmark/package.json index cb0b948..64e42e9 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -1,20 +1,16 @@ { "name": "benchmark", "private": true, - "version": "0.1.0", - "description": "benchmarks", - "main": "index.js", "type": "module", "scripts": { "bench": "node index.js" }, - "keywords": [], - "author": "", - "license": "MIT", "dependencies": { + "@noble/ciphers": "file:.." + }, + "devDependencies": { "@chainsafe/as-chacha20poly1305": "0.1.0", "@devtomio/sodium": "0.3.0", - "@noble/ciphers": "file:noble-ciphers.tgz", "@stablelib/aes": "1.0.1", "@stablelib/chacha": "1.0.1", "@stablelib/chacha20poly1305": "1.0.1", @@ -29,5 +25,6 @@ "aes-js": "3.1.2", "libsodium-wrappers": "0.7.11", "tweetnacl": "1.0.3" - } + }, + "version": "" } diff --git a/build/package.json b/build/package.json index 96df46d..3e29e63 100644 --- a/build/package.json +++ b/build/package.json @@ -9,6 +9,7 @@ "esbuild": "0.20.1" }, "scripts": { - "build:release": "npx esbuild --bundle input.js --outfile=`npx jsbt outfile` --global-name=`npx jsbt global`" + "build:release": "npx esbuild --bundle input.js --outfile=`npx jsbt outfile` --global-name=`npx jsbt global`", + "build:min": "npx esbuild --minify --bundle input.js --outfile=`npx jsbt outfile` --global-name=`npx jsbt global`" } } diff --git a/package.json b/package.json index 0df5ecc..a26c36f 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "bench": "node benchmark/aead.js noble && node benchmark/ciphers.js noble", "bench:all": "node benchmark/{aead,ciphers,poly}.js", - "bench:install": "npm pack && mv *.tgz benchmark/noble-ciphers.tgz && cd benchmark && npm install && cd ..", + "bench:install": "cd benchmark; npm install; npm install .. --install-links", "build": "npm run build:clean; tsc && tsc -p tsconfig.esm.json", "build:release": "cd build && npm i && npm run build:release", "build:clean": "rm *.{js,d.ts,js.map,d.ts.map} esm/*.{js,d.ts,js.map,d.ts.map} 2> /dev/null",