Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f55a3e75a2 | ||
|
|
6c8b0afd8d | ||
|
|
9c6611087c | ||
|
|
dc34df3b54 | ||
|
|
8bf7e88458 | ||
|
|
e8f1fb3aed | ||
|
|
ba6155880e | ||
|
|
1e696a5520 | ||
|
|
b6c704eca8 | ||
|
|
c7053fa112 | ||
|
|
d76ab093a8 | ||
|
|
4a54a37ae1 | ||
|
|
0eb433f3c2 | ||
|
|
278ecc7210 | ||
|
|
03fe7dcb1d | ||
|
|
d99abde915 | ||
|
|
06502e8fe8 | ||
|
|
f3004fdb31 | ||
|
|
f5834e684f | ||
|
|
d7a1060824 | ||
|
|
c6f8748878 | ||
|
|
24a46c7262 | ||
|
|
78a282bda3 | ||
|
|
1713dccba3 | ||
|
|
0a22251212 | ||
|
|
540d46717b | ||
|
|
e5112e690d | ||
|
|
2f8c91fc15 | ||
|
|
6d552f1ced | ||
|
|
afa992b40b | ||
|
|
401c6e5763 | ||
|
|
76d051b16e | ||
|
|
5b69d5aadc | ||
|
|
780323538a | ||
|
|
042d653852 | ||
|
|
da47390fa4 | ||
|
|
488abd68bb | ||
|
|
d926ee63f4 | ||
|
|
6777f8ef5e | ||
|
|
1001083009 | ||
|
|
898b067081 |
@@ -11,6 +11,6 @@ jobs:
|
||||
steps:
|
||||
- uses: jacogr/action-approve@795afd1dd096a2071d7ec98740661af4e853b7da
|
||||
with:
|
||||
authors: jacogr, TarikGul
|
||||
authors: jacogr, TarikGul, valentinfernandez1
|
||||
labels: -auto
|
||||
token: ${{ secrets.GH_PAT_BOT }}
|
||||
|
||||
@@ -22,11 +22,15 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GH_PAT_BOT }}
|
||||
ref: ${{ github.ref }}
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- name: Set Execute Permissions
|
||||
run: chmod +x ./scripts/*
|
||||
- name: Run Install Build Deps
|
||||
run: bash ./scripts/install-build-deps.sh
|
||||
- name: build
|
||||
run: |
|
||||
yarn install --immutable
|
||||
./scripts/install-build-deps.sh
|
||||
yarn ${{ matrix.step }}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
module.exports = require('@polkadot/dev/config/prettier.cjs');
|
||||
|
||||
Vendored
-925
File diff suppressed because one or more lines are too long
+934
File diff suppressed because one or more lines are too long
+1
-1
@@ -12,4 +12,4 @@ logFilters:
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.4.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-4.6.0.cjs
|
||||
|
||||
@@ -1,5 +1,53 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 7.5.4 Dec 9, 2025
|
||||
|
||||
Changes:
|
||||
|
||||
- Bump polkadot-js dependencies ([#605](https://github.com/polkadot-js/wasm/pull/605))
|
||||
|
||||
|
||||
## 7.5.3 Nov 24, 2025
|
||||
|
||||
Changes:
|
||||
|
||||
- Bump @polkadot dependencies ([#603](https://github.com/polkadot-js/wasm/pull/603))
|
||||
|
||||
|
||||
## 7.5.2 Nov 10, 2025
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix/Revert asm build ([#599](https://github.com/polkadot-js/wasm/pull/599))
|
||||
- Bump @polkadot dependencies ([#601](https://github.com/polkadot-js/wasm/pull/601))
|
||||
|
||||
|
||||
## 7.5.1 aug 25, 2025
|
||||
|
||||
Changes:
|
||||
|
||||
- Bump yarn to 4.5.1 ([#573](https://github.com/polkadot-js/wasm/pull/573))
|
||||
- Update comments and labels from 2024 to 2025 ([#574](https://github.com/polkadot-js/wasm/pull/574))
|
||||
- Bump yarn to 4.6.0 ([#575](https://github.com/polkadot-js/wasm/pull/575))
|
||||
- Set execute for build script in CI ([#576](https://github.com/polkadot-js/wasm/pull/576))
|
||||
- Set permissions on all scripts ([#577](https://github.com/polkadot-js/wasm/pull/577))
|
||||
- Bump dev to 0.83.2 ([#578](https://github.com/polkadot-js/wasm/pull/578))
|
||||
- chore: added check in ext_secp_recover for signature normalization ([#579](https://github.com/polkadot-js/wasm/pull/579))
|
||||
- chore: Improve CI ([#580](https://github.com/polkadot-js/wasm/pull/580))
|
||||
- Revert CI improvements and wasm-bindgen version ([#583](https://github.com/polkadot-js/wasm/pull/583))
|
||||
- Added validation checks in PBKDF2 and Scrypt hashing functions ([#584](https://github.com/polkadot-js/wasm/pull/584))
|
||||
- Rollback wasm-bindgen version change ([#586](https://github.com/polkadot-js/wasm/pull/586))
|
||||
- Fix rust version to 1.84 ([#587](https://github.com/polkadot-js/wasm/pull/587))
|
||||
- Default to installed rust version ([#588](https://github.com/polkadot-js/wasm/pull/588))
|
||||
- Default to nightly rust version ([#589](https://github.com/polkadot-js/wasm/pull/589))
|
||||
- Ci Fix ([#590](https://github.com/polkadot-js/wasm/pull/590))
|
||||
- Read lock file ([#591](https://github.com/polkadot-js/wasm/pull/591))
|
||||
- Setup nightly as default ([#592](https://github.com/polkadot-js/wasm/pull/592))
|
||||
- Tweak install-build-deps.sh script ([#593](https://github.com/polkadot-js/wasm/pull/593))
|
||||
- Remove ASM build ([#594](https://github.com/polkadot-js/wasm/pull/594))
|
||||
- Bump @polkadot deps ([#595](https://github.com/polkadot-js/wasm/pull/595))
|
||||
|
||||
|
||||
## 7.4.1 Oct 20, 2024
|
||||
|
||||
- Bump dev deps to 0.81.2
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
618 Jaco 2024 (#559)
|
||||
13 Tarik Gul 7.4.1 (#572)
|
||||
19 Tarik Gul Bump dev to 0.83.2 (#578)
|
||||
12 Valentin Fernandez 7.5.1 (#596)
|
||||
10 rajk93 7.5.4 (#606)
|
||||
1 Evgeny Fixed type (#121)
|
||||
1 Shunfan Zhou Support sr25519 agreement (#209)
|
||||
1 Steve Degosserie Expose Schnorrkel's VRF capabilities (#170)
|
||||
|
||||
+7
-2
@@ -1,8 +1,13 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import baseConfig from '@polkadot/dev/config/eslint';
|
||||
|
||||
export default [
|
||||
...baseConfig
|
||||
...baseConfig,
|
||||
{
|
||||
ignores: [
|
||||
'mod.ts'
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
+6
-6
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/wasm#readme",
|
||||
"license": "Apache-2.0",
|
||||
"packageManager": "yarn@4.4.1",
|
||||
"packageManager": "yarn@4.6.0",
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,10 +14,10 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"version": "7.4.1",
|
||||
"version": "7.5.4",
|
||||
"versions": {
|
||||
"git": "7.4.1",
|
||||
"npm": "7.4.1"
|
||||
"git": "7.5.4",
|
||||
"npm": "7.5.4"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
@@ -43,8 +43,8 @@
|
||||
"test:wasm-crypto:rust": "cd packages/wasm-crypto && RUST_BACKTRACE=full cargo test --release -- --test-threads=1 --nocapture"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/dev": "^0.81.2",
|
||||
"@polkadot/util": "^13.1.1",
|
||||
"@polkadot/dev": "^0.83.3",
|
||||
"@polkadot/util": "^14.0.1",
|
||||
"@types/node": "^20.16.1",
|
||||
"fflate": "^0.8.2"
|
||||
},
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
"./packageDetect.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.4.1",
|
||||
"version": "7.5.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/wasm-util": "7.4.1",
|
||||
"@polkadot/wasm-util": "7.5.4",
|
||||
"tslib": "^2.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^13.1.1",
|
||||
"@polkadot/x-randomvalues": "^13.1.1"
|
||||
"@polkadot/util": "^14.0.1",
|
||||
"@polkadot/x-randomvalues": "^14.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// A number of functions are "unsafe" and purposefully so - it is
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './bridge.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './packageDetect.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { InitFn, InitPromise, InitResult, WasmBaseInstance, WasmImports } from './types.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/wasm-bridge', path: 'auto', type: 'auto', version: '7.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/wasm-bridge', path: 'auto', type: 'auto', version: '7.5.4' };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Use non-strong types instead of WasmImports which may not
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-bridge authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-bridge authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BridgeBase, WasmBaseInstance } from './types.js';
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
"./packageDetect.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.4.1",
|
||||
"version": "7.5.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"tslib": "^2.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^13.1.1"
|
||||
"@polkadot/util": "^14.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { asmJsInit } from './cjs/data.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const data = require('../data.js');
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export declare const asmJsInit: null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const asmJsInit = null;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export declare const asmJsInit: null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export const asmJsInit = null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './packageDetect.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto-asmjs authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/wasm-crypto-asmjs', path: 'auto', type: 'auto', version: '7.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/wasm-crypto-asmjs', path: 'auto', type: 'auto', version: '7.5.4' };
|
||||
|
||||
@@ -18,20 +18,20 @@
|
||||
"./packageDetect.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.4.1",
|
||||
"version": "7.5.4",
|
||||
"browser": "wasm.js",
|
||||
"main": "wasm.js",
|
||||
"react-native": "asm.js",
|
||||
"dependencies": {
|
||||
"@polkadot/wasm-bridge": "7.4.1",
|
||||
"@polkadot/wasm-crypto-asmjs": "7.4.1",
|
||||
"@polkadot/wasm-crypto-wasm": "7.4.1",
|
||||
"@polkadot/wasm-util": "7.4.1",
|
||||
"@polkadot/wasm-bridge": "7.5.4",
|
||||
"@polkadot/wasm-crypto-asmjs": "7.5.4",
|
||||
"@polkadot/wasm-crypto-wasm": "7.5.4",
|
||||
"@polkadot/wasm-util": "7.5.4",
|
||||
"tslib": "^2.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^13.1.1",
|
||||
"@polkadot/x-randomvalues": "^13.1.1"
|
||||
"@polkadot/util": "^14.0.1",
|
||||
"@polkadot/x-randomvalues": "^14.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { InitFn } from '@polkadot/wasm-bridge/types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { InitFn } from '@polkadot/wasm-bridge/types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './wasm.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './wasm.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { InitFn } from '@polkadot/wasm-bridge/types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/wasm-crypto-init', path: 'auto', type: 'auto', version: '7.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/wasm-crypto-init', path: 'auto', type: 'auto', version: '7.5.4' };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { WasmBaseInstance } from '@polkadot/wasm-bridge/types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-init authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-init authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { InitFn } from '@polkadot/wasm-bridge/types';
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
"./packageDetect.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.4.1",
|
||||
"version": "7.5.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/wasm-util": "7.4.1",
|
||||
"@polkadot/wasm-util": "7.5.4",
|
||||
"tslib": "^2.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^13.1.1"
|
||||
"@polkadot/util": "^14.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { base64Decode, unzlibSync } from '@polkadot/wasm-util';
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export declare const bytes: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
exports.lenIn = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const bytes = require('../bytes.js');
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export declare const bytes: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export const bytes = '';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './packageDetect.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/wasm-crypto-wasm', path: 'auto', type: 'auto', version: '7.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/wasm-crypto-wasm', path: 'auto', type: 'auto', version: '7.5.4' };
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
[dependencies]
|
||||
std = { default-features = false, features = ["panic_immediate_abort"] }
|
||||
std = { default-features = false, features = ["panic_immediate_abort"] }
|
||||
@@ -26,19 +26,19 @@
|
||||
"./packageDetect.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.4.1",
|
||||
"version": "7.5.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/wasm-bridge": "7.4.1",
|
||||
"@polkadot/wasm-crypto-asmjs": "7.4.1",
|
||||
"@polkadot/wasm-crypto-init": "7.4.1",
|
||||
"@polkadot/wasm-crypto-wasm": "7.4.1",
|
||||
"@polkadot/wasm-util": "7.4.1",
|
||||
"@polkadot/wasm-bridge": "7.5.4",
|
||||
"@polkadot/wasm-crypto-asmjs": "7.5.4",
|
||||
"@polkadot/wasm-crypto-init": "7.5.4",
|
||||
"@polkadot/wasm-crypto-wasm": "7.5.4",
|
||||
"@polkadot/wasm-util": "7.5.4",
|
||||
"tslib": "^2.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^13.1.1",
|
||||
"@polkadot/x-randomvalues": "^13.1.1"
|
||||
"@polkadot/util": "^14.0.1",
|
||||
"@polkadot/x-randomvalues": "^14.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { WasmCryptoInstance } from '@polkadot/wasm-crypto-init/types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './packageDetect.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { InitFn } from '@polkadot/wasm-bridge/types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { createWasm } from '@polkadot/wasm-crypto-init/none';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { createWasm } from '@polkadot/wasm-crypto-init/asm';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { createWasm } from '@polkadot/wasm-crypto-init/wasm';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { createWasm } from '@polkadot/wasm-crypto-init/both';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Use `wee_alloc` as the global allocator.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/wasm-crypto', path: 'auto', type: 'auto', version: '7.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/wasm-crypto', path: 'auto', type: 'auto', version: '7.5.4' };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use bip39::{Mnemonic, MnemonicType, Language, Seed};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use blake2_rfc::blake2b::blake2b;
|
||||
@@ -100,6 +100,11 @@ pub fn ext_keccak512(data: &[u8]) -> Vec<u8> {
|
||||
/// Returns a vector with the hashed result
|
||||
#[wasm_bindgen]
|
||||
pub fn ext_pbkdf2(data: &[u8], salt: &[u8], rounds: u32) -> Vec<u8> {
|
||||
// As per RFC 2898 [https://datatracker.ietf.org/doc/html/rfc2898], the number of rounds must be greater than 0
|
||||
if rounds == 0 {
|
||||
panic!("PBKDF2 rounds must be greater than 0");
|
||||
}
|
||||
|
||||
let mut res = [0u8; 64];
|
||||
|
||||
// we cast to usize here - due to the WASM, we'd rather have u32 inputs
|
||||
@@ -119,6 +124,11 @@ pub fn ext_pbkdf2(data: &[u8], salt: &[u8], rounds: u32) -> Vec<u8> {
|
||||
/// Returns vector with the hashed result
|
||||
#[wasm_bindgen]
|
||||
pub fn ext_scrypt(password: &[u8], salt: &[u8], log2_n: u8, r: u32, p: u32) -> Vec<u8> {
|
||||
// As per RFC 7914 [https://datatracker.ietf.org/doc/html/rfc7914.html], the cost parameter N (2 ^ log2_n) must be larger than 1
|
||||
if log2_n == 0 {
|
||||
panic!("Scrypt cost parameter N must be larger than 1, log2_n must be at least 1");
|
||||
}
|
||||
|
||||
match ScryptParams::new(log2_n, r, p) {
|
||||
Ok(p) => {
|
||||
let mut res = [0u8; 64];
|
||||
@@ -254,6 +264,14 @@ pub mod tests {
|
||||
assert_eq!(hash[..], expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "PBKDF2 rounds must be greater than 0")]
|
||||
fn pbkdf2_zero_rounds_panics() {
|
||||
let salt = b"this is a salt";
|
||||
let data = b"hello world";
|
||||
ext_pbkdf2(data, salt, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_scrypt() {
|
||||
let password = b"password";
|
||||
@@ -264,6 +282,14 @@ pub mod tests {
|
||||
assert_eq!(hash[..], expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "Scrypt cost parameter N must be larger than 1, log2_n must be at least 1")]
|
||||
fn scrypt_zero_log2_n_panics() {
|
||||
let password = b"password";
|
||||
let salt = b"salt";
|
||||
ext_scrypt(password, salt, 0, 8, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_sha256() {
|
||||
let data = b"hello world";
|
||||
|
||||
@@ -1,130 +1,150 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use secp256k1::{ecdsa::{RecoverableSignature, RecoveryId}, Message, PublicKey, SecretKey, SECP256K1};
|
||||
use secp256k1::{
|
||||
ecdsa::{RecoverableSignature, RecoveryId},
|
||||
Message, PublicKey, SecretKey, SECP256K1,
|
||||
};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn ext_secp_pub_compress(pubkey: &[u8]) -> Vec<u8> {
|
||||
match PublicKey::from_slice(&pubkey) {
|
||||
Ok(p) => p
|
||||
.serialize()
|
||||
.to_vec(),
|
||||
_ => panic!("Invalid pubkey provided.")
|
||||
}
|
||||
match PublicKey::from_slice(&pubkey) {
|
||||
Ok(p) => p.serialize().to_vec(),
|
||||
_ => panic!("Invalid pubkey provided."),
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn ext_secp_pub_expand(pubkey: &[u8]) -> Vec<u8> {
|
||||
match PublicKey::from_slice(&pubkey) {
|
||||
Ok(p) => p
|
||||
.serialize_uncompressed()
|
||||
.to_vec(),
|
||||
_ => panic!("Invalid pubkey provided.")
|
||||
}
|
||||
match PublicKey::from_slice(&pubkey) {
|
||||
Ok(p) => p.serialize_uncompressed().to_vec(),
|
||||
_ => panic!("Invalid pubkey provided."),
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn ext_secp_from_seed(seed: &[u8]) -> Vec<u8> {
|
||||
match SecretKey::from_slice(seed) {
|
||||
Ok(s) => {
|
||||
let mut res = vec![];
|
||||
let pubkey = PublicKey::from_secret_key(SECP256K1, &s);
|
||||
match SecretKey::from_slice(seed) {
|
||||
Ok(s) => {
|
||||
let mut res = vec![];
|
||||
let pubkey = PublicKey::from_secret_key(SECP256K1, &s);
|
||||
|
||||
res.extend_from_slice(&s.serialize_secret());
|
||||
res.extend_from_slice(&pubkey.serialize());
|
||||
res.extend_from_slice(&s.serialize_secret());
|
||||
res.extend_from_slice(&pubkey.serialize());
|
||||
|
||||
res
|
||||
},
|
||||
_ => panic!("Invalid seed provided.")
|
||||
}
|
||||
res
|
||||
}
|
||||
_ => panic!("Invalid seed provided."),
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn ext_secp_recover(hash: &[u8], sig: &[u8], rec: i32) -> Vec<u8> {
|
||||
match RecoveryId::from_i32(rec) {
|
||||
Ok(r) => match (Message::from_slice(hash), RecoverableSignature::from_compact(&sig, r)) {
|
||||
(Ok(m), Ok(s)) => match s.recover(&m) {
|
||||
Ok(k) => k
|
||||
.serialize()
|
||||
.to_vec(),
|
||||
_ => panic!("Unable to recover.")
|
||||
},
|
||||
_ => panic!("Invalid signature provided.")
|
||||
},
|
||||
_ => panic!("Invalid recovery data provided.")
|
||||
}
|
||||
match RecoveryId::from_i32(rec) {
|
||||
Ok(r) => match (
|
||||
Message::from_slice(hash),
|
||||
RecoverableSignature::from_compact(&sig, r),
|
||||
) {
|
||||
(Ok(m), Ok(s)) => {
|
||||
let standard = s.to_standard();
|
||||
let mut normalized = standard;
|
||||
normalized.normalize_s();
|
||||
|
||||
// check if the signature is normalized
|
||||
if normalized.ne(&standard) {
|
||||
panic!("Non-normalized signature provided.");
|
||||
}
|
||||
|
||||
match s.recover(&m) {
|
||||
Ok(k) => k.serialize().to_vec(),
|
||||
_ => panic!("Unable to recover."),
|
||||
}
|
||||
}
|
||||
_ => panic!("Invalid signature provided."),
|
||||
},
|
||||
_ => panic!("Invalid recovery data provided."),
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn ext_secp_sign(hash: &[u8], seckey: &[u8]) -> Vec<u8> {
|
||||
match (Message::from_slice(hash), SecretKey::from_slice(seckey)) {
|
||||
(Ok(m), Ok(s)) => {
|
||||
let mut res = vec![];
|
||||
let (rec, sig) = SECP256K1
|
||||
.sign_ecdsa_recoverable(&m, &s)
|
||||
.serialize_compact();
|
||||
match (Message::from_slice(hash), SecretKey::from_slice(seckey)) {
|
||||
(Ok(m), Ok(s)) => {
|
||||
let mut res = vec![];
|
||||
let (rec, sig) = SECP256K1.sign_ecdsa_recoverable(&m, &s).serialize_compact();
|
||||
|
||||
res.extend_from_slice(&sig);
|
||||
res.push(rec.to_i32() as u8);
|
||||
res.extend_from_slice(&sig);
|
||||
res.push(rec.to_i32() as u8);
|
||||
|
||||
res
|
||||
},
|
||||
_ => panic!("Invalid message or secret provided.")
|
||||
}
|
||||
res
|
||||
}
|
||||
_ => panic!("Invalid message or secret provided."),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod tests {
|
||||
use hex_literal::hex;
|
||||
use super::*;
|
||||
use super::*;
|
||||
use hex_literal::hex;
|
||||
|
||||
#[test]
|
||||
fn can_create_pair() {
|
||||
let seckey = hex!("4380de832af797688026ce24f85204d508243f201650c1a134929e5458b7fbae");
|
||||
let expected = hex!("4380de832af797688026ce24f85204d508243f201650c1a134929e5458b7fbae03fd8c74f795ced92064b86191cb2772b1e3a0947740aa0a5a6e379592471fd85b");
|
||||
let res = ext_secp_from_seed(&seckey);
|
||||
#[test]
|
||||
fn can_create_pair() {
|
||||
let seckey = hex!("4380de832af797688026ce24f85204d508243f201650c1a134929e5458b7fbae");
|
||||
let expected = hex!("4380de832af797688026ce24f85204d508243f201650c1a134929e5458b7fbae03fd8c74f795ced92064b86191cb2772b1e3a0947740aa0a5a6e379592471fd85b");
|
||||
let res = ext_secp_from_seed(&seckey);
|
||||
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_pub_compress_full() {
|
||||
let pubkey = hex!("04b9dc646dd71118e5f7fda681ad9eca36eb3ee96f344f582fbe7b5bcdebb1307763fe926c273235fd979a134076d00fd1683cbd35868cb485d4a3a640e52184af");
|
||||
let expected = hex!("03b9dc646dd71118e5f7fda681ad9eca36eb3ee96f344f582fbe7b5bcdebb13077");
|
||||
let res = ext_secp_pub_compress(&pubkey);
|
||||
#[test]
|
||||
fn can_pub_compress_full() {
|
||||
let pubkey = hex!("04b9dc646dd71118e5f7fda681ad9eca36eb3ee96f344f582fbe7b5bcdebb1307763fe926c273235fd979a134076d00fd1683cbd35868cb485d4a3a640e52184af");
|
||||
let expected = hex!("03b9dc646dd71118e5f7fda681ad9eca36eb3ee96f344f582fbe7b5bcdebb13077");
|
||||
let res = ext_secp_pub_compress(&pubkey);
|
||||
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_pub_expand_comp() {
|
||||
let pubkey = hex!("03b9dc646dd71118e5f7fda681ad9eca36eb3ee96f344f582fbe7b5bcdebb13077");
|
||||
let expected = hex!("04b9dc646dd71118e5f7fda681ad9eca36eb3ee96f344f582fbe7b5bcdebb1307763fe926c273235fd979a134076d00fd1683cbd35868cb485d4a3a640e52184af");
|
||||
let res = ext_secp_pub_expand(&pubkey);
|
||||
#[test]
|
||||
fn can_pub_expand_comp() {
|
||||
let pubkey = hex!("03b9dc646dd71118e5f7fda681ad9eca36eb3ee96f344f582fbe7b5bcdebb13077");
|
||||
let expected = hex!("04b9dc646dd71118e5f7fda681ad9eca36eb3ee96f344f582fbe7b5bcdebb1307763fe926c273235fd979a134076d00fd1683cbd35868cb485d4a3a640e52184af");
|
||||
let res = ext_secp_pub_expand(&pubkey);
|
||||
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_recover() {
|
||||
let expected = hex!("028d13da15a02f3a70677339d51b14177ee9b49657662b35e56a9d9dee17db1d30");
|
||||
let sig = hex!("7505f2880114da51b3f5d535f8687953c0ab9af4ab81e592eaebebf53b728d2b6dfd9b5bcd70fee412b1f31360e7c2774009305cb84fc50c1d0ff8034dfa5fff");
|
||||
let msg = hex!("a30b64ce1eedf409c8afb801d72c05234e64849ea538c15dd3c8cf4ffcf166c9");
|
||||
let res = ext_secp_recover(&msg, &sig, 0);
|
||||
#[test]
|
||||
fn can_recover() {
|
||||
let expected = hex!("028d13da15a02f3a70677339d51b14177ee9b49657662b35e56a9d9dee17db1d30");
|
||||
let sig = hex!("7505f2880114da51b3f5d535f8687953c0ab9af4ab81e592eaebebf53b728d2b6dfd9b5bcd70fee412b1f31360e7c2774009305cb84fc50c1d0ff8034dfa5fff");
|
||||
let msg = hex!("a30b64ce1eedf409c8afb801d72c05234e64849ea538c15dd3c8cf4ffcf166c9");
|
||||
let res = ext_secp_recover(&msg, &sig, 0);
|
||||
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_sign() {
|
||||
// JS expectation - doesn't match?
|
||||
// let expected = hex!("df92f73d9f060cefacf187b5414491cb992998ace017fa48839b5cda3e264ba8c4efa521361678d9b8582744d77aa4b8d886d7380b7808a683174afad9c4700300");
|
||||
let expected = hex!("df92f73d9f060cefacf187b5414491cb992998ace017fa48839b5cda3e264ba83b105adec9e9872647a7d8bb28855b45e22805aea3d097953cbb1391f671d13e01");
|
||||
let seckey = hex!("4380de832af797688026ce24f85204d508243f201650c1a134929e5458b7fbae");
|
||||
let msg = hex!("68c731589a583d08b70861683b59ce3dd56284cb2f0da5b6cd83e6641dac3aab");
|
||||
let res = ext_secp_sign(&msg, &seckey);
|
||||
#[test]
|
||||
fn can_sign() {
|
||||
// JS expectation - doesn't match?
|
||||
// let expected = hex!("df92f73d9f060cefacf187b5414491cb992998ace017fa48839b5cda3e264ba8c4efa521361678d9b8582744d77aa4b8d886d7380b7808a683174afad9c4700300");
|
||||
let expected = hex!("df92f73d9f060cefacf187b5414491cb992998ace017fa48839b5cda3e264ba83b105adec9e9872647a7d8bb28855b45e22805aea3d097953cbb1391f671d13e01");
|
||||
let seckey = hex!("4380de832af797688026ce24f85204d508243f201650c1a134929e5458b7fbae");
|
||||
let msg = hex!("68c731589a583d08b70861683b59ce3dd56284cb2f0da5b6cd83e6641dac3aab");
|
||||
let res = ext_secp_sign(&msg, &seckey);
|
||||
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
assert_eq!(res[..], expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "Non-normalized signature provided.")]
|
||||
fn rejects_high_s_signature() {
|
||||
// valid ECDSA signature with a high S value (non-normalized)
|
||||
let sig = hex!(
|
||||
"fa1b7a71500322d70bcd5b982c678c96c95f68893063e1621b8b85c867b80b1caae8c7c4f8b5c6d181e4c8898a3f4c329da0e2c21f6f80552a660e6c1d9fa201");
|
||||
let msg = hex!("9a3c9be3a14a94df8cda1c474c0e9f8b1b35b1d85d2122cb87e6eb3c518e3be3");
|
||||
|
||||
let _ = ext_secp_recover(&msg, &sig, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Copyright 2019 Paritytech via https://github.com/paritytech/schnorrkel-js/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Copyright 2019 Paritytech via https://github.com/paritytech/schnorrkel-js/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* global it */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* global it */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* global it */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* global describe */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* global it */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* global it */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* global it */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import '@polkadot/wasm-crypto/initOnlyAsm';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// This is a Deno file, so we can allow .ts imports
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import path from 'node:path';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import * as wasm from '@polkadot/wasm-crypto';
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
"./packageDetect.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.4.1",
|
||||
"version": "7.5.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"tslib": "^2.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^13.1.1"
|
||||
"@polkadot/util": "^14.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-util authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-util authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-util authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-util authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Use an array for our indexer - this is faster than using map access. In
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-util authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-util authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { base64Decode } from './base64.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-util authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-util authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// MIT License
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-util authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-util authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './packageDetect.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-util authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-util authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-util authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-util authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2024 @polkadot/wasm-util authors & contributors
|
||||
// Copyright 2017-2025 @polkadot/wasm-util authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/wasm-util', path: 'auto', type: 'auto', version: '7.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/wasm-util', path: 'auto', type: 'auto', version: '7.5.4' };
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { createBundle } from '@polkadot/dev/config/rollup';
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2024 @polkadot/wasm authors & contributors
|
||||
# Copyright 2019-2025 @polkadot/wasm authors & contributors
|
||||
# This software may be modified and distributed under the terms
|
||||
# of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2024 @polkadot/wasm authors & contributors
|
||||
# Copyright 2019-2025 @polkadot/wasm authors & contributors
|
||||
# This software may be modified and distributed under the terms
|
||||
# of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@@ -19,7 +19,7 @@ cd $PKG_NAME
|
||||
if [ "$RUST_VER" == "stable" ]; then
|
||||
RUSTC_BOOTSTRAP=1 cargo build --target wasm32-unknown-unknown --release -Z build-std=std,panic_abort
|
||||
else
|
||||
rustup run $RUST_VER xargo build --target wasm32-unknown-unknown --release
|
||||
rustup run $RUST_VER xargo build --target wasm32-unknown-unknown --release --locked
|
||||
fi
|
||||
cd ..
|
||||
|
||||
@@ -56,4 +56,4 @@ sed -i -e 's/var retasmFunc = .*/export const asmJsInit = (wbg) => asmFunc(wbg);
|
||||
rm -rf $PKG_NAME-asmjs/build/cjs/*-e
|
||||
rm -rf $PKG_NAME-asmjs/build-deno/deno/*-e
|
||||
rm -rf $PKG_NAME-wasm/build/cjs/*-e
|
||||
rm -rf $PKG_NAME-wasm/build-deno/deno/*-e
|
||||
rm -rf $PKG_NAME-wasm/build-deno/deno/*-e
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2024 @polkadot/wasm authors & contributors
|
||||
# Copyright 2019-2025 @polkadot/wasm authors & contributors
|
||||
# This software may be modified and distributed under the terms
|
||||
# of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2024 @polkadot/wasm authors & contributors
|
||||
# Copyright 2019-2025 @polkadot/wasm authors & contributors
|
||||
# This software may be modified and distributed under the terms
|
||||
# of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2024 @polkadot/wasm authors & contributors
|
||||
# Copyright 2019-2025 @polkadot/wasm authors & contributors
|
||||
# This software may be modified and distributed under the terms
|
||||
# of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@@ -12,6 +12,9 @@ BINDGEN_REPO=https://github.com/rustwasm/wasm-bindgen
|
||||
BINDGEN_VER=0.2.79
|
||||
BINDGEN_ZIP=
|
||||
|
||||
|
||||
|
||||
|
||||
BINARYEN_REPO=https://github.com/WebAssembly/binaryen
|
||||
BINARYEN_VER=version_105
|
||||
BINARYEN_ZIP=
|
||||
@@ -24,6 +27,7 @@ unamestr=`uname`
|
||||
|
||||
# toolchain with rust-src (for panic overrdides) and the right wasm32 toolchain
|
||||
rustup toolchain install $RUST_VER -c rust-src -t wasm32-unknown-unknown
|
||||
rustup default $RUST_VER
|
||||
|
||||
if [ "$RUST_VER" != "stable" ]; then
|
||||
cargo install xargo
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 @polkadot/wasm-crypto authors & contributors
|
||||
// Copyright 2019-2025 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { zlibSync } from 'fflate/node';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2024 @polkadot/wasm authors & contributors
|
||||
# Copyright 2019-2025 @polkadot/wasm authors & contributors
|
||||
# This software may be modified and distributed under the terms
|
||||
# of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
RUST_VER=nightly-2021-12-02
|
||||
# RUST_VER=stable
|
||||
RUST_VER=nightly-2022-06-24
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user