- Bump dev deps to 0.81.2
- Bump TS
- Ensure CJS is exported correctly
- Bump yarn
- Add missing sideEffect declarations
- Set Deno build in CI to 1.42.x
Changes:
- Apply fixes for OOB array access
Changes:
- Drop support for Node 16 (EOL 11 Sep 2023)
Changes:
- Adjust cjs exports for consistency
- Adjust usage of
?.
as per (latest) linting rules
Changes:
- Adjust
cjs/bytes.js
generation to followexport.<var> = ...
form - Add
module
topackage.json
export map (ESM-only)
Changes:
- Apply
readonly
specifiers to private class fields where applicable - Adjust compilation output for
__internal__
class fields
Changes:
- Add
wasm-util
as dependency wherex-randomvalues
is a peer - Drop support for Node 14 (EOL 30 Apr 2023)
Changes:
- Use consistent
.js
imports in source files (TS moduleResolution)
Changes:
- Update to latest
@polkadot/dev
(w/ tsc jsx detection output changes)
Changes:
- Swap TS -> JS compiler to use tsc (from babel)
- Adjust all tests to use
node:test
runner (ESM & CJS variants)
Changes:
- Add
/*#__PURE__*/
annotations for specificexport const something = someFunction(...)
Changes:
- Optimize packed WASM base64 decoding loop
- Adjust test environment (no duplication)
- Adjust CI check steps, align with other org repos
- Remove unneeded
import_map.in.json
for Deno tests
Changes:
- Optimize WASM init with pre-allocated buffers
- Additional platform-specific tests
Changes:
- Protect against potential low-level double-sign leak in dalek-ed25519 (Don't use provided input pubKey, see https://github.com/MystenLabs/ed25519-unsafe-libs)
Changes:
- Add missing
peerDependencies
towasm-crypto
(bridge
requirement) - Adjust
WebAssembly.{Memory, ModuleImports}
usage to cater for non-dom TS
Changes:
- Adjust build outputs for Deno targets
Changes:
- Adjust build outputs for Deno targets
Changes:
- Fix bundle publish (from dev bump)
Changes:
- Adjust assert usage in all internal non-test code
- Additional comments where missing
Changes:
- Adjust init, allow RN with default ASM.js-only fallback
- Split
wasm-{bridge, util}
packages for internal re-use
- Breaking change In this major version the commonjs outputs are moved to a sub-folder. Since the
export
map andmain
field inpackage.json
does reflect this change, there should be no usage changes. However the packages here will all need to be on the same version for internal linkage.
Changes:
- Update ed25519 secret key format return description
- Output commonjs files under the
cjs/**
root
Changes:
- Swap from
libsecp256k1
tosecp256k1
(this aligns with the Substrate use) - Adjust
wasm-crypto/init*
to also exportinitWasm(): Promise<void>
(optional manual init) - Allow for
wasm-crypto/initNone
with no defined Wasm or Asm interfaces - Fix initialization on React Native with only ASM
- Breaking change For users of React Native, you are now required to add
import '@polkadot/wasm-crypto/initOnlyAsm'
at your project top-level to ensure that asm.js is initialized. (Or alternativelyimport '@polkadot/wasm-crypto/initWasmAsm'
to future-proof when WASM does become available) - Breaking change For users who used to map the
data
andempty
of the internalwasm-crypto-{wasm, asmjs}
packages in their bundlers, swap to one of the@polkadot/wasm-crypto/init*
top-level imports to set the type of interfaces you would prefer. A full writeup of the rationale and other options can be found in the FAQ
Changes:
- Add (optional)
@polkadot/wasm-crypto/init{OnlyAsm, OnlyWasm, WasmAsm}
to allow specific interface types - Add work-around for lazy secp256k1 init in asm.js environments
- Optimize asm.js output size
- Use latest
wasm-bindgen
,binaryen
&wabt
packages in build - Additional workaround for Vite bundling
Changes:
- Adjust ed25519 internals, consistency in code
- Ensure package path is available under ESM & CJS
- JS wrapped bytes interoperability test
- Adjust for bundlers where
import.meta.url
is undefined
Changes:
- Add
secp256k1{Compress, Expand, Recover, Sign}
functions - Remove all occurences of
.unwrap()
(match everywhere) - Adjust and optimize WASM function JS interface construction
- Simplify base64 bytes decoding on construction
Changes:
- Add
hmacSha256
&hmacSha512
functions
Contributed:
- Updated package.json to include repo (Thanks to https://github.com/v-zhzhou)
Changes:
- Add
keccak512
function - Add
sha256
function
Contributed:
- Add sr25519 agreement external (Thanks to https://github.com/shelvenzhou)
Changes:
- Adjust tests to align with JS coding standards
- Allow for optional build with Rust stable bootstrap
Changes:
- Bump
@polkadot/dev
to allow for bundles with new-format
Changes:
- Add an explicit
engines
field topackage.json
- Allow building as a completely stand-alone browser bundle (experimental)
Changes:
- Add import indirection for both CJS & ESM (where generated source file is commonjs)
Important In the 4.0 version the default package type has been changed to ESM modules by default. This should not affect usage, however since the output formats changed, a new major version is required.
Changes:
- Build to ESM by default (with cjs versions via export map)
Changes:
- Cleanup implicit dependencies, perform base64 decoding using base64-js
Changes:
- Change package detect import to use
.js
source, not.json
Changes:
- Remove
module
field inpackage.json
Contributed:
- Expose sr25519
ext_vrf_{sign, verify}
methods (Thanks to https://github.com/stiiifff)
Changes:
- Add explicit
.editorconfig
for Rust sources - Remove unused code bundles (
vrf_{sign,verify}_extra
,secp256k1
with tests) - Test run wrapper cleanups
Changes:
- Single-instance package detection
- Adjust WASM inflate with localized methods
Important This assumes @polkadot/util
5+ peerDependencies
Important While this package contains no external interface changes, it doe now compile and ship both cjs and esm modules. This means that modern bundlers will have more information for tree-shaking available. Additionally when using Node with .mjs
extensions, the esm version imports will be used on recent Node versions. Adding an export map, as here, may have some impacts so a major semver bump is advised. There may be (small) dragons hiding in the dark corners...
Changes:
- Build and expose both cjs and esm via exports map
- Split wasm and asmjs files into the
@polkadot/wasm-crypto-{wasm,asmjs}
packages - Add fflate WASM compression, with 180K raw savings (37K over-the-wire)
- Convert the package to full TypeScript sources
Changes:
- Rework generation of WASM interfaces (proper cross-platform JS support)
- Remove explicit
crypto
dependency, this is now applied by@polkadot/x-randomvalues
- Build via xargo for panic abort, an overall small sizes without stack (Pinned nightly)
- Move Rust library sources in to
rs/
subfolder
Changes:
- Re-add the BTC/ETH compatible
bip39ToSeed
dropped in the previous version (ETH-compatible pairs)
Changes:
- Add
scrypt
function for KDF generation - Remove
bip39ToSeed
, we only use thebip39ToMiniSecret
variant in Substrate - Update ed25519-dalek to 1.0.0-pre.4
- Rework generation based on latest wasm-pack generator
Changes:
- Adjust build process for smaller wasm bundle outputs (~50K dropped from base bundle)
- Unpin nightly from nightly-2020-02-17 version
- Swap to yarn 2 and add support for use by yarn 2 projects
- Important The sr25519 interface dropped the use of
verify_simple_preaudit_deprecated
for signature verification, instead it now usesverify_simple
. Only schnorrkel 0.8+ signatures will now pass verification. This is a follow-up of the 0.1 signing support that was dropped in a previous version.
Changes:
- Rework schnorrkel signatures test vectors based on the above change (Rust, WASM and ASM.js tests)
- Rust nightly pinned to last-known-working 2020-02-17 on CI (compiler issues, should to be reverted in a future release)
Changes:
- No functionality changes from 0.20.1. The interfaces here are stable in the current iteration.
Changes:
- Pull in schnorrkel 0.8.5 for full Substrate 2.x compatibility
Changes:
- No functionality changes at all, everything done is "under the hood" to give the codebase better maintainability
Changes:
- Added an asm.js fallback which is active for React Native via the
"react-native"
entry inpackage.json
. Ensure that you run the build step with theNODE_OPTIONS=--max_old_space_size=8192
flags, since the asm.js bundle is large. (For RN the full command would therefore beNODE_OPTIONS=--max_old_space_size=8192 npm start
)
Changes:
- Remove deprecated
@polkadot/wasm-schnorrkel
&@polkadot/wasm-dalek-ed25519
source (all combined in@polkadot/wasm-crypto
, was kept for historical purposes) - Security dependency bumps
- Updated Rust
hex-literal
for recent versions of the compiler (used in tests only)
Changes:
- Security dependency bumps
Changes:
- w3f/schnorrkel updated to 0.1.1 as per substrate
- Added known subkey signature test (Rust & JS)
Changes:
- Dependency bumps
Changes:
- Pull ed25519 & sr25519 into
@polkadot/wasm-crypto
as well (smaller final size) - Disable build/publish of
wasm-dalek-ed25519
&wasm-schnorrkel
- Improve error messaging, instead of
__wasm_malloc of null
Changes:
- Fix build scripts to properly attach errors in the log (dropped in 0.6.1)
Changes:
- Log init errors for both non-WebAssembly usage as well as WebAssembly errors
Changes:
- Add password argument to bip39ToSeed
Changes:
- Add bip39ToSeed
Changes:
- Add wasm-dalek-ed25519 for all used crypto there
- Add keccak256
- Try secp256k1 (bloating code, not used atm)
Changes:
- Add basic crypto functions, creation of wasm-crypto package
- blake2, bip39, sha2, xxhash
Changes:
- Initial release