Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41c7af32c9 | ||
|
|
68d698502d | ||
|
|
3d4a87af6a | ||
|
|
77b1e338cf | ||
|
|
3af17400ba | ||
|
|
e16029776f | ||
|
|
61624a627b | ||
|
|
c964570806 | ||
|
|
f32846d41b | ||
|
|
705b08765b | ||
|
|
4f6771e758 | ||
|
|
731dee91e4 | ||
|
|
b82e28ad4e | ||
|
|
6d5b3f5404 | ||
|
|
1f643dd705 | ||
|
|
af9491f7fd | ||
|
|
7377da8e7e | ||
|
|
32fa12c3fa | ||
|
|
6aabb2f869 | ||
|
|
0edb0289a9 | ||
|
|
004996d772 | ||
|
|
7611fd1788 | ||
|
|
e4f85e2358 | ||
|
|
6c5e7deaa5 | ||
|
|
1f024c1da0 | ||
|
|
26b6cf843a | ||
|
|
8e54efe4a5 | ||
|
|
daecf47197 | ||
|
|
6f5ed67aad | ||
|
|
8556566c1d |
@@ -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
@@ -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
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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": "*",
|
||||
|
||||
@@ -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' };
|
||||
|
||||
@@ -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' };
|
||||
|
||||
@@ -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": "*",
|
||||
|
||||
@@ -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' };
|
||||
|
||||
@@ -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": "*"
|
||||
|
||||
@@ -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' };
|
||||
|
||||
@@ -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": "*",
|
||||
|
||||
@@ -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' };
|
||||
|
||||
@@ -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": "*"
|
||||
|
||||
@@ -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)];
|
||||
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user