mirror of
https://github.com/pezkuwichain/pezkuwi-wasm.git
synced 2026-11-02 00:11:06 +00:00
Ship the whole wasm-crypto again, not just sr25519
7.5.15-7.5.18 shipped a wasm built from a separate sr25519-only module
(4 exports) and replaced every other function in bundle.ts with a stub
that throws "not yet implemented": ed25519 pair/sign/verify, sr25519
agree and hard/soft derivation, VRF, and all of secp256k1. Because the
wasm still initialised, isReady() was true and @pezkuwi/util-crypto
called those stubs instead of falling back to JS, so ed25519 and
ethereum accounts and any // derivation failed at runtime wherever the
package is used. bip39Generate threw as well, and bip39ToSeed hashed with
SHA-256 where BIP39 specifies SHA-512.
The Rust in packages/wasm-crypto/src/rs already implemented all of it,
with sr25519 under the "bizinikiwi" context. This builds that crate and
binds it again:
- bundle.ts: the withWasm bindings for every ext_* export, as in
b61206c; getSigningContext() kept, returning "bizinikiwi".
- wasm-bridge: wasm-bindgen 0.2.90 passes an alignment to
__wbindgen_malloc/__wbindgen_free (without it Rust aborts with
`unreachable`); __wbindgen_memory returns a heap index; the two-argument
getRandomValues import takes the crypto object and a Uint8Array by heap
index, not a pointer and length.
- build-wasm.sh: source rust-version.sh relative to the script; strip the
`import * as wbg` line newer wasm2js emits and call asmFunc({ wbg }),
which is the shape its output expects.
- pack-wasm-base.mjs: also write build/bytes.js. The package exports
./bytes from there for ESM, and it was still the old sr25519-only wasm.
The committed src copies are now empty placeholders, so a build that
skips the wasm step fails instead of shipping a stale binary.
- Tests: the sr25519 known-signature vectors were substrate-context
vectors; they are replaced by vectors signed by 7.5.18, plus a test that
the same seed yields the same public key. A rename had changed the
substrate-bip39 vector's password to "Bizinikiwi"; it is "Substrate".
Compatibility with 7.5.18, measured in separate processes:
mnemonic -> mini secret -> public key is identical for every phrase with
an empty or ASCII password (12/12). It differs when the BIP39 password has
characters NFKD changes: 7.5.18 normalised it, while the Rust crate and
util-crypto's JS path do not, so this returns to the canonical result.
Rust 43/43, JS 55/55, wasm and asm.js runners pass. With this build in
place, pezkuwi-extension's suite goes from 19 failing to 3 (the 3 left
are unrelated sorting tests).
All wasm packages move to 7.5.19 and pin each other at 7.5.19.
This commit is contained in:
1 parent
c3b5de65ae
commit
f1eee23fdf
27 files changed
+353
-666
No files matched your search
@@ -1,10 +1,13 @@
|
||||
// Copyright 2019-2026 @pezkuwi/wasm-crypto-wasm authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Generated with bizinikiwi signing context from pezkuwi-sdk
|
||||
// Placeholder. scripts/pack-wasm-base.mjs writes the real bytes into build/,
|
||||
// build/cjs and build-deno from the wasm compiled out of packages/wasm-crypto.
|
||||
// Left empty on purpose: a build that skipped the wasm step fails loudly here
|
||||
// instead of shipping whatever wasm was last committed.
|
||||
|
||||
export const lenIn = 69227;
|
||||
export const lenIn = 0;
|
||||
|
||||
export const lenOut = 111597;
|
||||
export const lenOut = 0;
|
||||
|
||||
export const bytes = 'eNqsfQ18HUd1787u3s+9V7r6li3ZnrtRYjmJE9mJLTnpC97bZzvGmPBaXsvr66vjDznkKsSRLExoZUnBlrGLE0wIYEgoJi8QF2JwIVDzLdJQDAQwkIIhAdwQEgOhuIUUU0zyzv+c2b0r3WtLtM/5RXt3Ps6cOXNm5pwzZ85aG7e/RlmWpf5FXXSjMzY2psZutMO/FqdYNyr636IktU3+bKMU+pUYG+NsVx7yaupvuzE5Fr1v20b1TTl6NzmUxik3WlThRmcb16IGURi/tm0zLW0DBPqbGotAGhBS3w5/EAY7BaGdBqEReR0xr6Pyiod9d11HxxVX3tb/lwOvfd3NG15HdNiweej1tw1v27DppivK2y/esOF1m27aMLTx1i3bXrP65ltu+ePX37p5w9a+zUuWXbWpd8XWpX3L+pb0WnUXgrFAYGx/7aaNQ0MbX79h44rl/Uu29m9d0tu/ZelVmzdZzReqfYnUvql/+I8YiT/ZeMtr+7dv2HTV1iXLtm7etHXjpk09W/s2XRiFeQLklv5bbxp+9YarlvZvWbFxae+KjZu39Cy7erOVvFDdhVL3tqFtw9uGX39b//b+4c0bb7llw6Ytm7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ated
|
||||
export const bytes = '';
|
||||
Reference in new issue
Block a user