Compare commits

...
41 Commits
Author SHA1 Message Date
github-actions[bot] f55a3e75a2 [CI Skip] release/stable 7.5.4
skip-checks: true
2025-12-09 10:03:06 +00:00
rajk93 6c8b0afd8d 7.5.4 (#606) 2025-12-09 15:27:27 +05:30
github-actions[bot] 9c6611087c [CI Skip] bump/beta 7.5.4-0-x
skip-checks: true
2025-12-09 09:23:51 +00:00
rajk93 dc34df3b54 chore: bump polkadot dependencies (#605) 2025-12-09 14:48:23 +05:30
github-actions[bot] 8bf7e88458 [CI Skip] release/stable 7.5.3
skip-checks: true
2025-11-24 08:24:07 +00:00
rajk93 e8f1fb3aed 7.5.3 (#604) 2025-11-24 13:50:24 +05:30
github-actions[bot] ba6155880e [CI Skip] bump/beta 7.5.3-0-x
skip-checks: true
2025-11-24 07:25:14 +00:00
rajk93 1e696a5520 chore: bump polkadot dependencies (#603) 2025-11-24 12:51:27 +05:30
github-actions[bot] b6c704eca8 [CI Skip] release/stable 7.5.2
skip-checks: true
2025-11-11 03:02:29 +00:00
rajk93 c7053fa112 7.5.2 (#602) 2025-11-11 08:24:34 +05:30
github-actions[bot] d76ab093a8 [CI Skip] bump/beta 7.5.2-1-x
skip-checks: true
2025-11-10 13:40:53 +00:00
rajk93 4a54a37ae1 chore: bump polkadot dependencies (#601) 2025-11-10 19:03:00 +05:30
github-actions[bot] 0eb433f3c2 [CI Skip] bump/beta 7.5.2-0-x
skip-checks: true
2025-11-10 13:09:40 +00:00
rajk93andFrancisco Valentim Castilho 278ecc7210 Fix/Revert asm build (#599)
* chore: revert asm build

* chore: revert info in build-wasm.sh

* chore: revert install-build-deps.sh

* chore: lock libc version

* chore: lock libc version in xargo

* chore: use --locked while building

* Fix: Switch `RUST_VER` to 1.63.0-nightly

* chore(CI): revert continue-on-error to false

* Revert "chore(CI): revert continue-on-error to false"

This reverts commit 425a93ea4d6c18e94ca04a0142818dd440442182.

---------

Co-authored-by: Francisco Valentim Castilho <franciscoannyon@gmail.com>
2025-11-10 18:31:44 +05:30
github-actions[bot] 03fe7dcb1d [CI Skip] release/stable 7.5.1
skip-checks: true
2025-08-25 14:05:16 +00:00
Valentin Fernandezandgithub-actions[bot] d99abde915 7.5.1 (#596)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-25 17:03:27 +03:00
github-actions[bot] 06502e8fe8 [CI Skip] bump/beta 7.4.2-4-x
skip-checks: true
2025-08-25 13:48:20 +00:00
Valentin Fernandezandgithub-actions[bot] f3004fdb31 bump deps (#595)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-25 16:46:30 +03:00
github-actions[bot] f5834e684f [CI Skip] bump/beta 7.4.2-3-x
skip-checks: true
2025-08-13 17:01:23 +00:00
Valentin Fernandezandgithub-actions[bot] d7a1060824 Remove ASM build (#594)
* Remove ASM build

* remove CI build blag

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-13 13:59:40 -03:00
c6f8748878 Tweak install-build-deps.sh script (#593)
* add additional flag

* downgrade bindgen

* Fix rust build

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: José Molina <jose@blockdeep.io>
2025-08-13 13:34:01 -03:00
Valentin Fernandezandgithub-actions[bot] 24a46c7262 Setup nightly as default (#592)
* run CI

* run CI

* setup nightly as default

* install  nightly-2024-11-22

* rustup show

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-13 17:01:17 +03:00
Valentin Fernandezandgithub-actions[bot] 78a282bda3 Readd lock file (#591)
* get rust versions

* modify build-wasm

* switch to nightly on build-wasm

* prevent script from using stable

* extra log

* new log

* run CI on current branch

* run CI on current branch

* Minor fixes

* Remove rust installation

* nightly on build.sh

* add log

* logs

* small change

* rust version is nightly

* auto-approve

* re add lock file

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-12 12:02:48 -03:00
Valentin Fernandezandgithub-actions[bot] 1713dccba3 Ci Fix (#590)
* get rust versions

* modify build-wasm

* switch to nightly on build-wasm

* prevent script from using stable

* extra log

* new log

* run CI on current branch

* run CI on current branch

* Minor fixes

* Remove rust installation

* nightly on build.sh

* add log

* logs

* small change

* rust version is nightly

* auto-approve

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-12 11:40:51 -03:00
Valentin Fernandezandgithub-actions[bot] 0a22251212 default to nightly build (#589)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-12 09:56:45 -03:00
Valentin Fernandezandgithub-actions[bot] 540d46717b default to installed rust version (#588)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-11 13:33:46 -03:00
Valentin Fernandezandgithub-actions[bot] e5112e690d fix rust version to 1.84 (#587)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-11 12:01:58 -03:00
Valentin Fernandezandgithub-actions[bot] 2f8c91fc15 rollback bindgen version change (#586)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-11 11:41:17 -03:00
rajk93 6d552f1ced Added validation checks in PBKDF2 and Scrypt hashing functions (#584)
* chore: added validation checks in PBKDF2 and Scrypt functions

* chore(eslint): ignore linting for mod.ts

* chore(ci): bump RUST_VER

* chore(ci): bump RUST_VER

* chore(CI): downgrade RUST_VER and update xargo build script

* chore(CI): revert last change and use RUST_VER as stable

* chore(CI): bump BINDGEN_VER

* chore(CI): bump BINDGEN_VER

* chore(CI): bump BINARYEN_VER

* chore(CI): downgrade BINARYEN_VER

* chore(CI): recomended fix for wasm-bindgen

* chore(test): point wasm to package

* Revert "chore(test): point wasm to package"

This reverts commit 66104540fdff0e760ca0a6a666d4e09d162c5769.

* chore(test): temporary test

* Revert "chore(test): temporary test"

This reverts commit af10b8d8b9bb597e02ea9c8d6cc3bf62676a6609.

* chore(test): added more logs to build-wasm.sh script

* Revert "chore(test): added more logs to build-wasm.sh script"

This reverts commit c5073005ae9daa84308296736a41636da8f3d21b.

* chore(test): added more logs to test all

* Revert "chore(test): added more logs to test all"

This reverts commit 9b0ac43c2c053ac408164bbf9b31b46d0844af1b.

* chore: add references for RFCs
2025-07-23 12:10:03 +05:30
rajk93 afa992b40b Revert CI improvements and wasm-bindgen version (#583)
* chore: revert wasm-bindgen

* chore: revert pull_request in github action workflow

* chore: revert CI improvements

* chore: revert CI improvements
2025-07-16 13:01:04 +05:30
Valentin Fernandez 401c6e5763 chore: Improve CI (#580)
* Prevent false possitive result

* Use stable cargo version

* Remove 2nd continue-on-error
2025-06-26 09:53:32 -03:00
rajk93andValentin Fernandez 76d051b16e chore: added check in ext_secp_recover for signature normalization (#579)
* chore: added check in ext_secp_recover for signature normalization

* update wasm-bindgen

* Add test for non-normalized signature

---------

Co-authored-by: Valentin Fernandez <tinchofernandez8@gmail.com>
2025-06-24 12:01:13 -03:00
github-actions[bot] 5b69d5aadc [CI Skip] bump/beta 7.4.2-2-x
skip-checks: true
2025-01-17 22:18:32 +00:00
Tarik Gul 780323538a Bump dev to 0.83.2 (#578) 2025-01-18 00:14:18 +02:00
github-actions[bot] 042d653852 [CI Skip] bump/beta 7.4.2-1-x
skip-checks: true
2025-01-02 19:57:35 +00:00
Tarik Gul da47390fa4 Set permissions on all scripts (#577)
* Set permissions on all scripts

* cleanup
2025-01-02 21:53:46 +02:00
Tarik Gul 488abd68bb Set execute for build script in CI (#576) 2025-01-02 21:40:37 +02:00
Tarik Gul d926ee63f4 Bump yarn to 4.6.0 (#575) 2025-01-02 21:26:31 +02:00
Tarik Gul 6777f8ef5e 2025 (#574)
* 2025

* include more files
2025-01-02 17:31:20 +02:00
github-actions[bot] 1001083009 [CI Skip] bump/beta 7.4.2-0-x
skip-checks: true
2024-10-22 14:24:12 +00:00
Tarik Gul 898b067081 Bump yarn to 4.5.1 (#573) 2024-10-22 17:20:13 +03:00
101 changed files with 1375 additions and 1261 deletions
+1 -1
View File
@@ -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 }}
+5 -1
View File
@@ -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
View File
@@ -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');
-925
View File
File diff suppressed because one or more lines are too long
+934
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -12,4 +12,4 @@ logFilters:
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.4.1.cjs
yarnPath: .yarn/releases/yarn-4.6.0.cjs
+48
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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"
},
+4 -4
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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
+2 -2
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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';
+2 -2
View File
@@ -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 -1
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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' };
+7 -7
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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
+2 -2
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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';
+3 -3
View File
@@ -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 -1
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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
+2 -2
View File
@@ -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 -1
View File
@@ -1,2 +1,2 @@
[dependencies]
std = { default-features = false, features = ["panic_immediate_abort"] }
std = { default-features = false, features = ["panic_immediate_abort"] }
+8 -8
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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
+2 -2
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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;
+27 -1
View File
@@ -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";
+109 -89
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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';
+2 -2
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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.
+3 -3
View File
@@ -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
View File
@@ -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
View File
@@ -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.
+5 -1
View File
@@ -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 -1
View File
@@ -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';
+2 -3
View File
@@ -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