Compare commits

..
30 Commits
Author SHA1 Message Date
github-actions[bot] 41c7af32c9 [CI Skip] release/stable 7.3.2
skip-checks: true
2023-12-06 09:28:24 +00:00
Jaco 68d698502d 7.3.2 (#553) 2023-12-06 11:23:54 +02:00
github-actions[bot] 3d4a87af6a [CI Skip] bump/beta 7.3.2-2-x
skip-checks: true
2023-12-06 08:57:15 +00:00
Jaco 77b1e338cf Sync fflate huffman tree with upstream (#552) 2023-12-06 10:52:27 +02:00
github-actions[bot] 3af17400ba [CI Skip] bump/beta 7.3.2-1-x
skip-checks: true
2023-12-06 08:48:37 +00:00
Jaco e16029776f Fix base64 last decoding offset (#551) 2023-12-06 10:44:07 +02:00
github-actions[bot] 61624a627b [CI Skip] bump/beta 7.3.2-0-x
skip-checks: true
2023-11-18 08:41:17 +00:00
Jaco c964570806 Bump common (#549) 2023-11-18 10:34:43 +02:00
github-actions[bot] f32846d41b [CI Skip] release/stable 7.3.1
skip-checks: true
2023-11-17 09:20:13 +00:00
Jaco 705b08765b 7.3.1 (#548) 2023-11-17 11:13:36 +02:00
github-actions[bot] 4f6771e758 [CI Skip] bump/beta 7.2.3-9-x
skip-checks: true
2023-11-17 08:15:49 +00:00
Jaco 731dee91e4 Update dev, drop Node 16 (#547) 2023-11-17 10:09:14 +02:00
github-actions[bot] b82e28ad4e [CI Skip] bump/beta 7.2.3-8-x
skip-checks: true
2023-10-15 10:55:03 +00:00
Jaco 6d5b3f5404 Bump TS (#546) 2023-10-15 13:46:13 +03:00
github-actions[bot] 1f643dd705 [CI Skip] bump/beta 7.2.3-7-x
skip-checks: true
2023-10-11 08:57:16 +00:00
Jaco af9491f7fd Bump deps (#545) 2023-10-11 11:49:18 +03:00
github-actions[bot] 7377da8e7e [CI Skip] bump/beta 7.2.3-6-x
skip-checks: true
2023-09-15 07:00:35 +00:00
Jaco 32fa12c3fa Bump deps (w/ util) (#543) 2023-09-15 09:53:57 +03:00
github-actions[bot] 6aabb2f869 [CI Skip] bump/beta 7.2.3-5-x
skip-checks: true
2023-09-14 05:23:44 +00:00
Jaco 0edb0289a9 Bump dev deps (#542) 2023-09-14 08:16:59 +03:00
github-actions[bot] 004996d772 [CI Skip] bump/beta 7.2.3-4-x
skip-checks: true
2023-08-31 12:51:49 +00:00
Jaco 7611fd1788 Collapse build:mac command into build (w/ detect) (#541) 2023-08-31 15:44:26 +03:00
github-actions[bot] e4f85e2358 [CI Skip] bump/beta 7.2.3-3-x
skip-checks: true
2023-08-30 06:37:28 +00:00
Jaco 6c5e7deaa5 Bump dev deps (#540) 2023-08-30 09:31:36 +03:00
github-actions[bot] 1f024c1da0 [CI Skip] bump/beta 7.2.3-2-x
skip-checks: true
2023-08-23 10:42:00 +00:00
Jaco 26b6cf843a Bump deps (#539) 2023-08-23 13:35:59 +03:00
github-actions[bot] 8e54efe4a5 [CI Skip] bump/beta 7.2.3-1-x
skip-checks: true
2023-08-20 06:57:44 +00:00
Jaco daecf47197 Bump deps (#537) 2023-08-20 09:51:51 +03:00
github-actions[bot] 6f5ed67aad [CI Skip] bump/beta 7.2.3-0-x
skip-checks: true
2023-08-18 06:44:50 +00:00
Jaco 8556566c1d Bump common (#536) 2023-08-18 09:38:25 +03:00
19 changed files with 756 additions and 516 deletions
+14
View File
@@ -1,5 +1,19 @@
# CHANGELOG
## 7.3.2 Dec 6, 2023
Changes:
- Apply fixes for OOB array access
## 7.3.1 Nov 17, 2023
Changes:
- Drop support for Node 16 (EOL 11 Sep 2023)
## 7.2.2 Aug 17, 2023
Changes:
+1 -1
View File
@@ -1,4 +1,4 @@
597 Jaco 7.2.2 (#535)
612 Jaco 7.3.2 (#553)
1 Evgeny Fixed type (#121)
1 Shunfan Zhou Support sr25519 agreement (#209)
1 Steve Degosserie Expose Schnorrkel's VRF capabilities (#170)
+8 -9
View File
@@ -14,10 +14,10 @@
},
"sideEffects": false,
"type": "module",
"version": "7.2.2",
"version": "7.3.2",
"versions": {
"git": "7.2.2",
"npm": "7.2.2"
"git": "7.3.2",
"npm": "7.3.2"
},
"workspaces": [
"packages/*"
@@ -25,7 +25,6 @@
"scripts": {
"build": "yarn build:wasm",
"build:js": "./scripts/build-js.sh",
"build:mac": "PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\" CC=/opt/homebrew/opt/llvm/bin/clang AR=/opt/homebrew/opt/llvm/bin/llvm-ar yarn build",
"build:release": "polkadot-ci-ghact-build",
"build:rollup": "polkadot-exec-rollup --config",
"build:wasm": "./scripts/build.sh",
@@ -44,12 +43,12 @@
"test:wasm-crypto:rust": "cd packages/wasm-crypto && RUST_BACKTRACE=full cargo test --release -- --test-threads=1 --nocapture"
},
"devDependencies": {
"@polkadot/dev": "^0.76.15",
"@polkadot/util": "^12.3.2",
"@types/node": "^20.5.0",
"fflate": "^0.8.0"
"@polkadot/dev": "^0.77.1",
"@polkadot/util": "^12.6.1",
"@types/node": "^20.9.1",
"fflate": "^0.8.1"
},
"resolutions": {
"typescript": "^5.1.6"
"typescript": "^5.2.2"
}
}
+6 -6
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/wasm/issues",
"description": "A bridge layer between JS and Wasm",
"engines": {
"node": ">=16"
"node": ">=18"
},
"homepage": "https://github.com/polkadot-js/wasm/tree/master/packages/wasm-bridge#readme",
"license": "Apache-2.0",
@@ -18,15 +18,15 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.2.2",
"version": "7.3.2",
"main": "index.js",
"dependencies": {
"@polkadot/wasm-util": "7.2.2",
"tslib": "^2.6.1"
"@polkadot/wasm-util": "7.3.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/util": "^12.3.2",
"@polkadot/x-randomvalues": "^12.3.2"
"@polkadot/util": "^12.6.1",
"@polkadot/x-randomvalues": "^12.6.1"
},
"peerDependencies": {
"@polkadot/util": "*",
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/wasm-bridge', path: 'auto', type: 'auto', version: '7.2.2' };
export const packageInfo = { name: '@polkadot/wasm-bridge', path: 'auto', type: 'auto', version: '7.3.2' };
+4 -4
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/wasm/issues",
"description": "Asm.js content for wasm-crypto",
"engines": {
"node": ">=16"
"node": ">=18"
},
"homepage": "https://github.com/polkadot-js/wasm/tree/master/packages/wasm-crypto-asmjs#readme",
"license": "Apache-2.0",
@@ -15,13 +15,13 @@
},
"sideEffects": false,
"type": "module",
"version": "7.2.2",
"version": "7.3.2",
"main": "index.js",
"dependencies": {
"tslib": "^2.6.1"
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/util": "^12.3.2"
"@polkadot/util": "^12.6.1"
},
"peerDependencies": {
"@polkadot/util": "*"
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/wasm-crypto-asmjs', path: 'auto', type: 'auto', version: '7.2.2' };
export const packageInfo = { name: '@polkadot/wasm-crypto-asmjs', path: 'auto', type: 'auto', version: '7.3.2' };
+9 -9
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/wasm/issues",
"description": "Init handlers for wasm-crypto",
"engines": {
"node": ">=16"
"node": ">=18"
},
"homepage": "https://github.com/polkadot-js/wasm/tree/master/packages/wasm-crypto-init#readme",
"license": "Apache-2.0",
@@ -18,20 +18,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.2.2",
"version": "7.3.2",
"browser": "wasm.js",
"main": "wasm.js",
"react-native": "asm.js",
"dependencies": {
"@polkadot/wasm-bridge": "7.2.2",
"@polkadot/wasm-crypto-asmjs": "7.2.2",
"@polkadot/wasm-crypto-wasm": "7.2.2",
"@polkadot/wasm-util": "7.2.2",
"tslib": "^2.6.1"
"@polkadot/wasm-bridge": "7.3.2",
"@polkadot/wasm-crypto-asmjs": "7.3.2",
"@polkadot/wasm-crypto-wasm": "7.3.2",
"@polkadot/wasm-util": "7.3.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/util": "^12.3.2",
"@polkadot/x-randomvalues": "^12.3.2"
"@polkadot/util": "^12.6.1",
"@polkadot/x-randomvalues": "^12.6.1"
},
"peerDependencies": {
"@polkadot/util": "*",
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/wasm-crypto-init', path: 'auto', type: 'auto', version: '7.2.2' };
export const packageInfo = { name: '@polkadot/wasm-crypto-init', path: 'auto', type: 'auto', version: '7.3.2' };
+5 -5
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/wasm/issues",
"description": "Wasm content for wasm-crypto",
"engines": {
"node": ">=16"
"node": ">=18"
},
"homepage": "https://github.com/polkadot-js/wasm/tree/master/packages/wasm-crypto-wasm#readme",
"license": "Apache-2.0",
@@ -15,14 +15,14 @@
},
"sideEffects": false,
"type": "module",
"version": "7.2.2",
"version": "7.3.2",
"main": "index.js",
"dependencies": {
"@polkadot/wasm-util": "7.2.2",
"tslib": "^2.6.1"
"@polkadot/wasm-util": "7.3.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/util": "^12.3.2"
"@polkadot/util": "^12.6.1"
},
"peerDependencies": {
"@polkadot/util": "*"
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/wasm-crypto-wasm', path: 'auto', type: 'auto', version: '7.2.2' };
export const packageInfo = { name: '@polkadot/wasm-crypto-wasm', path: 'auto', type: 'auto', version: '7.3.2' };
+10 -10
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/wasm/issues",
"description": "A wasm interface layer for use by @polkadot/util-crypto",
"engines": {
"node": ">=16"
"node": ">=18"
},
"homepage": "https://github.com/polkadot-js/wasm/tree/master/packages/wasm-crypto#readme",
"license": "Apache-2.0",
@@ -26,19 +26,19 @@
"./initWasmAsm.cjs"
],
"type": "module",
"version": "7.2.2",
"version": "7.3.2",
"main": "index.js",
"dependencies": {
"@polkadot/wasm-bridge": "7.2.2",
"@polkadot/wasm-crypto-asmjs": "7.2.2",
"@polkadot/wasm-crypto-init": "7.2.2",
"@polkadot/wasm-crypto-wasm": "7.2.2",
"@polkadot/wasm-util": "7.2.2",
"tslib": "^2.6.1"
"@polkadot/wasm-bridge": "7.3.2",
"@polkadot/wasm-crypto-asmjs": "7.3.2",
"@polkadot/wasm-crypto-init": "7.3.2",
"@polkadot/wasm-crypto-wasm": "7.3.2",
"@polkadot/wasm-util": "7.3.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/util": "^12.3.2",
"@polkadot/x-randomvalues": "^12.3.2"
"@polkadot/util": "^12.6.1",
"@polkadot/x-randomvalues": "^12.6.1"
},
"peerDependencies": {
"@polkadot/util": "*",
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/wasm-crypto', path: 'auto', type: 'auto', version: '7.2.2' };
export const packageInfo = { name: '@polkadot/wasm-crypto', path: 'auto', type: 'auto', version: '7.3.2' };
+4 -4
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/wasm/issues",
"description": "Utilities used exclusively inside Wasm decoding",
"engines": {
"node": ">=16"
"node": ">=18"
},
"homepage": "https://github.com/polkadot-js/wasm/tree/master/packages/wasm-util#readme",
"license": "Apache-2.0",
@@ -18,13 +18,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.2.2",
"version": "7.3.2",
"main": "index.js",
"dependencies": {
"tslib": "^2.6.1"
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/util": "^12.3.2"
"@polkadot/util": "^12.6.1"
},
"peerDependencies": {
"@polkadot/util": "*"
+8 -8
View File
@@ -3,33 +3,33 @@
// Use an array for our indexer - this is faster than using map access. In
// this case we assume ASCII-only inputs, so we cannot overflow the array
const chr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const CHR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' as const;
const map = new Array<number>(256);
// We use charCodeAt for access here and in the decoder loop - this is faster
// on lookups (array + numbers) and also faster than accessing the specific
// character via data[i]
for (let i = 0, count = chr.length; i < count; i++) {
map[chr.charCodeAt(i)] = i;
for (let i = 0, count = CHR.length; i < count; i++) {
map[CHR.charCodeAt(i)] = i;
}
/**
* @name base64Decode
* @description
* A base64Decoding function that operates in all environments. Unlike decoding
* A base64 decoding function that operates in all environments. Unlike decoding
* from Buffer (Node.js only) or atob (browser-only) this implementation is
* slightly slower, but it is platform independent.
*
* For our usage, since we have access to the static final size (where used), we
* decode to a specified output buffer. This also means we have applied a number
* of optimizations based on this - checking output position instead of chars.
* For our usage, since we have access to the static final size, so we decode
* to a specified output buffer. This also means we have applied a number of
* optimizations based on this - checking output position instead of chars.
*/
export function base64Decode (data: string, out: Uint8Array): Uint8Array {
let byte = 0;
let bits = 0;
let pos = -1;
for (let i = 0, count = out.length; pos < count; i++) {
for (let i = 0, last = out.length - 1; pos !== last; i++) {
// each character represents 6 bits
byte = (byte << 6) | map[data.charCodeAt(i)];
+10 -4
View File
@@ -92,10 +92,12 @@ const hMap = ((cd: Uint8Array, mb: number, r: 0 | 1) => {
// u16 "map": index -> # of codes with bit length = index
const l = new u16(mb);
// length of cd must be 288 (total # of codes)
for (; i < s; ++i) ++l[cd[i] - 1];
for (; i < s; ++i) {
if (cd[i]) ++l[cd[i] - 1];
}
// u16 "map": index -> minimum code for bit length = index
const le = new u16(mb);
for (i = 0; i < mb; ++i) {
for (i = 1; i < mb; ++i) {
le[i] = (le[i - 1] + l[i - 1]) << 1;
}
let co: Uint16Array;
@@ -116,13 +118,17 @@ const hMap = ((cd: Uint8Array, mb: number, r: 0 | 1) => {
// m is end value
for (const m = v | ((1 << r) - 1); v <= m; ++v) {
// every 16 bit value starting with the code yields the same result
co[rev[v] >>> rvb] = sv;
co[rev[v] >> rvb] = sv;
}
}
}
} else {
co = new u16(s);
for (i = 0; i < s; ++i) co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);
for (i = 0; i < s; ++i) {
if (cd[i]) {
co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);
}
}
}
return co;
});
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/wasm-util', path: 'auto', type: 'auto', version: '7.2.2' };
export const packageInfo = { name: '@polkadot/wasm-util', path: 'auto', type: 'auto', version: '7.3.2' };
+13 -1
View File
@@ -11,7 +11,19 @@ echo "*** Building JavaScript"
echo "*** Building WASM"
cd packages
PKG_NAME=wasm-crypto ../scripts/build-wasm.sh
unamestr=`uname`
# For Mac we set extra paths for clang
if [[ "$unamestr" == "Darwin" ]]; then
if [ ! -f "/opt/homebrew/opt/llvm/bin/clang" ]; then
echo "FATAL: Ensure you have clang installed via homebrew"
exit 1
fi
PATH="/opt/homebrew/opt/llvm/bin:$PATH" CC=/opt/homebrew/opt/llvm/bin/clang AR=/opt/homebrew/opt/llvm/bin/llvm-ar PKG_NAME=wasm-crypto ../scripts/build-wasm.sh
else
PKG_NAME=wasm-crypto ../scripts/build-wasm.sh
fi
if [ -z "$WITH_DENO" ]; then
yarn test:wasm-crypto:js
+658 -449
View File
File diff suppressed because it is too large Load Diff