@polkadot/wasm-crypto
Advanced tools
Comparing version 6.3.1 to 6.4.1
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { bridge, initBridge } from "./init.js"; | ||
export { packageInfo } from "./packageInfo.js"; | ||
export { bridge }; // Removes the first parameter (expected as WasmCryptoInstance) and leaves the | ||
export { bridge }; | ||
// Removes the first parameter (expected as WasmCryptoInstance) and leaves the | ||
// rest of the parameters in-tack. This allows us to dynamically create a function | ||
@@ -28,132 +31,130 @@ // return from the withWasm helper | ||
} | ||
return fn(bridge.wasm, ...params); | ||
}; | ||
} | ||
export const bip39Generate = withWasm((wasm, words) => { | ||
export const bip39Generate = /*#__PURE__*/withWasm((wasm, words) => { | ||
wasm.ext_bip39_generate(8, words); | ||
return bridge.resultString(); | ||
}); | ||
export const bip39ToEntropy = withWasm((wasm, phrase) => { | ||
export const bip39ToEntropy = /*#__PURE__*/withWasm((wasm, phrase) => { | ||
wasm.ext_bip39_to_entropy(8, ...bridge.allocString(phrase)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const bip39ToMiniSecret = withWasm((wasm, phrase, password) => { | ||
export const bip39ToMiniSecret = /*#__PURE__*/withWasm((wasm, phrase, password) => { | ||
wasm.ext_bip39_to_mini_secret(8, ...bridge.allocString(phrase), ...bridge.allocString(password)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const bip39ToSeed = withWasm((wasm, phrase, password) => { | ||
export const bip39ToSeed = /*#__PURE__*/withWasm((wasm, phrase, password) => { | ||
wasm.ext_bip39_to_seed(8, ...bridge.allocString(phrase), ...bridge.allocString(password)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const bip39Validate = withWasm((wasm, phrase) => { | ||
export const bip39Validate = /*#__PURE__*/withWasm((wasm, phrase) => { | ||
const ret = wasm.ext_bip39_validate(...bridge.allocString(phrase)); | ||
return ret !== 0; | ||
}); | ||
export const ed25519KeypairFromSeed = withWasm((wasm, seed) => { | ||
export const ed25519KeypairFromSeed = /*#__PURE__*/withWasm((wasm, seed) => { | ||
wasm.ext_ed_from_seed(8, ...bridge.allocU8a(seed)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const ed25519Sign = withWasm((wasm, pubkey, seckey, message) => { | ||
export const ed25519Sign = /*#__PURE__*/withWasm((wasm, pubkey, seckey, message) => { | ||
wasm.ext_ed_sign(8, ...bridge.allocU8a(pubkey), ...bridge.allocU8a(seckey), ...bridge.allocU8a(message)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const ed25519Verify = withWasm((wasm, signature, message, pubkey) => { | ||
export const ed25519Verify = /*#__PURE__*/withWasm((wasm, signature, message, pubkey) => { | ||
const ret = wasm.ext_ed_verify(...bridge.allocU8a(signature), ...bridge.allocU8a(message), ...bridge.allocU8a(pubkey)); | ||
return ret !== 0; | ||
}); | ||
export const secp256k1FromSeed = withWasm((wasm, seckey) => { | ||
export const secp256k1FromSeed = /*#__PURE__*/withWasm((wasm, seckey) => { | ||
wasm.ext_secp_from_seed(8, ...bridge.allocU8a(seckey)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const secp256k1Compress = withWasm((wasm, pubkey) => { | ||
export const secp256k1Compress = /*#__PURE__*/withWasm((wasm, pubkey) => { | ||
wasm.ext_secp_pub_compress(8, ...bridge.allocU8a(pubkey)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const secp256k1Expand = withWasm((wasm, pubkey) => { | ||
export const secp256k1Expand = /*#__PURE__*/withWasm((wasm, pubkey) => { | ||
wasm.ext_secp_pub_expand(8, ...bridge.allocU8a(pubkey)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const secp256k1Recover = withWasm((wasm, msgHash, sig, recovery) => { | ||
export const secp256k1Recover = /*#__PURE__*/withWasm((wasm, msgHash, sig, recovery) => { | ||
wasm.ext_secp_recover(8, ...bridge.allocU8a(msgHash), ...bridge.allocU8a(sig), recovery); | ||
return bridge.resultU8a(); | ||
}); | ||
export const secp256k1Sign = withWasm((wasm, msgHash, seckey) => { | ||
export const secp256k1Sign = /*#__PURE__*/withWasm((wasm, msgHash, seckey) => { | ||
wasm.ext_secp_sign(8, ...bridge.allocU8a(msgHash), ...bridge.allocU8a(seckey)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const sr25519DeriveKeypairHard = withWasm((wasm, pair, cc) => { | ||
export const sr25519DeriveKeypairHard = /*#__PURE__*/withWasm((wasm, pair, cc) => { | ||
wasm.ext_sr_derive_keypair_hard(8, ...bridge.allocU8a(pair), ...bridge.allocU8a(cc)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const sr25519DeriveKeypairSoft = withWasm((wasm, pair, cc) => { | ||
export const sr25519DeriveKeypairSoft = /*#__PURE__*/withWasm((wasm, pair, cc) => { | ||
wasm.ext_sr_derive_keypair_soft(8, ...bridge.allocU8a(pair), ...bridge.allocU8a(cc)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const sr25519DerivePublicSoft = withWasm((wasm, pubkey, cc) => { | ||
export const sr25519DerivePublicSoft = /*#__PURE__*/withWasm((wasm, pubkey, cc) => { | ||
wasm.ext_sr_derive_public_soft(8, ...bridge.allocU8a(pubkey), ...bridge.allocU8a(cc)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const sr25519KeypairFromSeed = withWasm((wasm, seed) => { | ||
export const sr25519KeypairFromSeed = /*#__PURE__*/withWasm((wasm, seed) => { | ||
wasm.ext_sr_from_seed(8, ...bridge.allocU8a(seed)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const sr25519Sign = withWasm((wasm, pubkey, secret, message) => { | ||
export const sr25519Sign = /*#__PURE__*/withWasm((wasm, pubkey, secret, message) => { | ||
wasm.ext_sr_sign(8, ...bridge.allocU8a(pubkey), ...bridge.allocU8a(secret), ...bridge.allocU8a(message)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const sr25519Verify = withWasm((wasm, signature, message, pubkey) => { | ||
export const sr25519Verify = /*#__PURE__*/withWasm((wasm, signature, message, pubkey) => { | ||
const ret = wasm.ext_sr_verify(...bridge.allocU8a(signature), ...bridge.allocU8a(message), ...bridge.allocU8a(pubkey)); | ||
return ret !== 0; | ||
}); | ||
export const sr25519Agree = withWasm((wasm, pubkey, secret) => { | ||
export const sr25519Agree = /*#__PURE__*/withWasm((wasm, pubkey, secret) => { | ||
wasm.ext_sr_agree(8, ...bridge.allocU8a(pubkey), ...bridge.allocU8a(secret)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const vrfSign = withWasm((wasm, secret, context, message, extra) => { | ||
export const vrfSign = /*#__PURE__*/withWasm((wasm, secret, context, message, extra) => { | ||
wasm.ext_vrf_sign(8, ...bridge.allocU8a(secret), ...bridge.allocU8a(context), ...bridge.allocU8a(message), ...bridge.allocU8a(extra)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const vrfVerify = withWasm((wasm, pubkey, context, message, extra, outAndProof) => { | ||
export const vrfVerify = /*#__PURE__*/withWasm((wasm, pubkey, context, message, extra, outAndProof) => { | ||
const ret = wasm.ext_vrf_verify(...bridge.allocU8a(pubkey), ...bridge.allocU8a(context), ...bridge.allocU8a(message), ...bridge.allocU8a(extra), ...bridge.allocU8a(outAndProof)); | ||
return ret !== 0; | ||
}); | ||
export const blake2b = withWasm((wasm, data, key, size) => { | ||
export const blake2b = /*#__PURE__*/withWasm((wasm, data, key, size) => { | ||
wasm.ext_blake2b(8, ...bridge.allocU8a(data), ...bridge.allocU8a(key), size); | ||
return bridge.resultU8a(); | ||
}); | ||
export const hmacSha256 = withWasm((wasm, key, data) => { | ||
export const hmacSha256 = /*#__PURE__*/withWasm((wasm, key, data) => { | ||
wasm.ext_hmac_sha256(8, ...bridge.allocU8a(key), ...bridge.allocU8a(data)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const hmacSha512 = withWasm((wasm, key, data) => { | ||
export const hmacSha512 = /*#__PURE__*/withWasm((wasm, key, data) => { | ||
wasm.ext_hmac_sha512(8, ...bridge.allocU8a(key), ...bridge.allocU8a(data)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const keccak256 = withWasm((wasm, data) => { | ||
export const keccak256 = /*#__PURE__*/withWasm((wasm, data) => { | ||
wasm.ext_keccak256(8, ...bridge.allocU8a(data)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const keccak512 = withWasm((wasm, data) => { | ||
export const keccak512 = /*#__PURE__*/withWasm((wasm, data) => { | ||
wasm.ext_keccak512(8, ...bridge.allocU8a(data)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const pbkdf2 = withWasm((wasm, data, salt, rounds) => { | ||
export const pbkdf2 = /*#__PURE__*/withWasm((wasm, data, salt, rounds) => { | ||
wasm.ext_pbkdf2(8, ...bridge.allocU8a(data), ...bridge.allocU8a(salt), rounds); | ||
return bridge.resultU8a(); | ||
}); | ||
export const scrypt = withWasm((wasm, password, salt, log2n, r, p) => { | ||
export const scrypt = /*#__PURE__*/withWasm((wasm, password, salt, log2n, r, p) => { | ||
wasm.ext_scrypt(8, ...bridge.allocU8a(password), ...bridge.allocU8a(salt), log2n, r, p); | ||
return bridge.resultU8a(); | ||
}); | ||
export const sha256 = withWasm((wasm, data) => { | ||
export const sha256 = /*#__PURE__*/withWasm((wasm, data) => { | ||
wasm.ext_sha256(8, ...bridge.allocU8a(data)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const sha512 = withWasm((wasm, data) => { | ||
export const sha512 = /*#__PURE__*/withWasm((wasm, data) => { | ||
wasm.ext_sha512(8, ...bridge.allocU8a(data)); | ||
return bridge.resultU8a(); | ||
}); | ||
export const twox = withWasm((wasm, data, rounds) => { | ||
export const twox = /*#__PURE__*/withWasm((wasm, data, rounds) => { | ||
wasm.ext_twox(8, ...bridge.allocU8a(data), rounds); | ||
@@ -160,0 +161,0 @@ return bridge.resultU8a(); |
@@ -24,7 +24,4 @@ "use strict"; | ||
exports.waitReady = waitReady; | ||
var _init = require("./init"); | ||
var _packageInfo = require("./packageInfo"); | ||
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
@@ -52,12 +49,9 @@ // SPDX-License-Identifier: Apache-2.0 | ||
} | ||
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) { | ||
params[_key] = arguments[_key]; | ||
} | ||
return fn(_init.bridge.wasm, ...params); | ||
}; | ||
} | ||
const bip39Generate = withWasm((wasm, words) => { | ||
const bip39Generate = /*#__PURE__*/withWasm((wasm, words) => { | ||
wasm.ext_bip39_generate(8, words); | ||
@@ -67,3 +61,3 @@ return _init.bridge.resultString(); | ||
exports.bip39Generate = bip39Generate; | ||
const bip39ToEntropy = withWasm((wasm, phrase) => { | ||
const bip39ToEntropy = /*#__PURE__*/withWasm((wasm, phrase) => { | ||
wasm.ext_bip39_to_entropy(8, ..._init.bridge.allocString(phrase)); | ||
@@ -73,3 +67,3 @@ return _init.bridge.resultU8a(); | ||
exports.bip39ToEntropy = bip39ToEntropy; | ||
const bip39ToMiniSecret = withWasm((wasm, phrase, password) => { | ||
const bip39ToMiniSecret = /*#__PURE__*/withWasm((wasm, phrase, password) => { | ||
wasm.ext_bip39_to_mini_secret(8, ..._init.bridge.allocString(phrase), ..._init.bridge.allocString(password)); | ||
@@ -79,3 +73,3 @@ return _init.bridge.resultU8a(); | ||
exports.bip39ToMiniSecret = bip39ToMiniSecret; | ||
const bip39ToSeed = withWasm((wasm, phrase, password) => { | ||
const bip39ToSeed = /*#__PURE__*/withWasm((wasm, phrase, password) => { | ||
wasm.ext_bip39_to_seed(8, ..._init.bridge.allocString(phrase), ..._init.bridge.allocString(password)); | ||
@@ -85,3 +79,3 @@ return _init.bridge.resultU8a(); | ||
exports.bip39ToSeed = bip39ToSeed; | ||
const bip39Validate = withWasm((wasm, phrase) => { | ||
const bip39Validate = /*#__PURE__*/withWasm((wasm, phrase) => { | ||
const ret = wasm.ext_bip39_validate(..._init.bridge.allocString(phrase)); | ||
@@ -91,3 +85,3 @@ return ret !== 0; | ||
exports.bip39Validate = bip39Validate; | ||
const ed25519KeypairFromSeed = withWasm((wasm, seed) => { | ||
const ed25519KeypairFromSeed = /*#__PURE__*/withWasm((wasm, seed) => { | ||
wasm.ext_ed_from_seed(8, ..._init.bridge.allocU8a(seed)); | ||
@@ -97,3 +91,3 @@ return _init.bridge.resultU8a(); | ||
exports.ed25519KeypairFromSeed = ed25519KeypairFromSeed; | ||
const ed25519Sign = withWasm((wasm, pubkey, seckey, message) => { | ||
const ed25519Sign = /*#__PURE__*/withWasm((wasm, pubkey, seckey, message) => { | ||
wasm.ext_ed_sign(8, ..._init.bridge.allocU8a(pubkey), ..._init.bridge.allocU8a(seckey), ..._init.bridge.allocU8a(message)); | ||
@@ -103,3 +97,3 @@ return _init.bridge.resultU8a(); | ||
exports.ed25519Sign = ed25519Sign; | ||
const ed25519Verify = withWasm((wasm, signature, message, pubkey) => { | ||
const ed25519Verify = /*#__PURE__*/withWasm((wasm, signature, message, pubkey) => { | ||
const ret = wasm.ext_ed_verify(..._init.bridge.allocU8a(signature), ..._init.bridge.allocU8a(message), ..._init.bridge.allocU8a(pubkey)); | ||
@@ -109,3 +103,3 @@ return ret !== 0; | ||
exports.ed25519Verify = ed25519Verify; | ||
const secp256k1FromSeed = withWasm((wasm, seckey) => { | ||
const secp256k1FromSeed = /*#__PURE__*/withWasm((wasm, seckey) => { | ||
wasm.ext_secp_from_seed(8, ..._init.bridge.allocU8a(seckey)); | ||
@@ -115,3 +109,3 @@ return _init.bridge.resultU8a(); | ||
exports.secp256k1FromSeed = secp256k1FromSeed; | ||
const secp256k1Compress = withWasm((wasm, pubkey) => { | ||
const secp256k1Compress = /*#__PURE__*/withWasm((wasm, pubkey) => { | ||
wasm.ext_secp_pub_compress(8, ..._init.bridge.allocU8a(pubkey)); | ||
@@ -121,3 +115,3 @@ return _init.bridge.resultU8a(); | ||
exports.secp256k1Compress = secp256k1Compress; | ||
const secp256k1Expand = withWasm((wasm, pubkey) => { | ||
const secp256k1Expand = /*#__PURE__*/withWasm((wasm, pubkey) => { | ||
wasm.ext_secp_pub_expand(8, ..._init.bridge.allocU8a(pubkey)); | ||
@@ -127,3 +121,3 @@ return _init.bridge.resultU8a(); | ||
exports.secp256k1Expand = secp256k1Expand; | ||
const secp256k1Recover = withWasm((wasm, msgHash, sig, recovery) => { | ||
const secp256k1Recover = /*#__PURE__*/withWasm((wasm, msgHash, sig, recovery) => { | ||
wasm.ext_secp_recover(8, ..._init.bridge.allocU8a(msgHash), ..._init.bridge.allocU8a(sig), recovery); | ||
@@ -133,3 +127,3 @@ return _init.bridge.resultU8a(); | ||
exports.secp256k1Recover = secp256k1Recover; | ||
const secp256k1Sign = withWasm((wasm, msgHash, seckey) => { | ||
const secp256k1Sign = /*#__PURE__*/withWasm((wasm, msgHash, seckey) => { | ||
wasm.ext_secp_sign(8, ..._init.bridge.allocU8a(msgHash), ..._init.bridge.allocU8a(seckey)); | ||
@@ -139,3 +133,3 @@ return _init.bridge.resultU8a(); | ||
exports.secp256k1Sign = secp256k1Sign; | ||
const sr25519DeriveKeypairHard = withWasm((wasm, pair, cc) => { | ||
const sr25519DeriveKeypairHard = /*#__PURE__*/withWasm((wasm, pair, cc) => { | ||
wasm.ext_sr_derive_keypair_hard(8, ..._init.bridge.allocU8a(pair), ..._init.bridge.allocU8a(cc)); | ||
@@ -145,3 +139,3 @@ return _init.bridge.resultU8a(); | ||
exports.sr25519DeriveKeypairHard = sr25519DeriveKeypairHard; | ||
const sr25519DeriveKeypairSoft = withWasm((wasm, pair, cc) => { | ||
const sr25519DeriveKeypairSoft = /*#__PURE__*/withWasm((wasm, pair, cc) => { | ||
wasm.ext_sr_derive_keypair_soft(8, ..._init.bridge.allocU8a(pair), ..._init.bridge.allocU8a(cc)); | ||
@@ -151,3 +145,3 @@ return _init.bridge.resultU8a(); | ||
exports.sr25519DeriveKeypairSoft = sr25519DeriveKeypairSoft; | ||
const sr25519DerivePublicSoft = withWasm((wasm, pubkey, cc) => { | ||
const sr25519DerivePublicSoft = /*#__PURE__*/withWasm((wasm, pubkey, cc) => { | ||
wasm.ext_sr_derive_public_soft(8, ..._init.bridge.allocU8a(pubkey), ..._init.bridge.allocU8a(cc)); | ||
@@ -157,3 +151,3 @@ return _init.bridge.resultU8a(); | ||
exports.sr25519DerivePublicSoft = sr25519DerivePublicSoft; | ||
const sr25519KeypairFromSeed = withWasm((wasm, seed) => { | ||
const sr25519KeypairFromSeed = /*#__PURE__*/withWasm((wasm, seed) => { | ||
wasm.ext_sr_from_seed(8, ..._init.bridge.allocU8a(seed)); | ||
@@ -163,3 +157,3 @@ return _init.bridge.resultU8a(); | ||
exports.sr25519KeypairFromSeed = sr25519KeypairFromSeed; | ||
const sr25519Sign = withWasm((wasm, pubkey, secret, message) => { | ||
const sr25519Sign = /*#__PURE__*/withWasm((wasm, pubkey, secret, message) => { | ||
wasm.ext_sr_sign(8, ..._init.bridge.allocU8a(pubkey), ..._init.bridge.allocU8a(secret), ..._init.bridge.allocU8a(message)); | ||
@@ -169,3 +163,3 @@ return _init.bridge.resultU8a(); | ||
exports.sr25519Sign = sr25519Sign; | ||
const sr25519Verify = withWasm((wasm, signature, message, pubkey) => { | ||
const sr25519Verify = /*#__PURE__*/withWasm((wasm, signature, message, pubkey) => { | ||
const ret = wasm.ext_sr_verify(..._init.bridge.allocU8a(signature), ..._init.bridge.allocU8a(message), ..._init.bridge.allocU8a(pubkey)); | ||
@@ -175,3 +169,3 @@ return ret !== 0; | ||
exports.sr25519Verify = sr25519Verify; | ||
const sr25519Agree = withWasm((wasm, pubkey, secret) => { | ||
const sr25519Agree = /*#__PURE__*/withWasm((wasm, pubkey, secret) => { | ||
wasm.ext_sr_agree(8, ..._init.bridge.allocU8a(pubkey), ..._init.bridge.allocU8a(secret)); | ||
@@ -181,3 +175,3 @@ return _init.bridge.resultU8a(); | ||
exports.sr25519Agree = sr25519Agree; | ||
const vrfSign = withWasm((wasm, secret, context, message, extra) => { | ||
const vrfSign = /*#__PURE__*/withWasm((wasm, secret, context, message, extra) => { | ||
wasm.ext_vrf_sign(8, ..._init.bridge.allocU8a(secret), ..._init.bridge.allocU8a(context), ..._init.bridge.allocU8a(message), ..._init.bridge.allocU8a(extra)); | ||
@@ -187,3 +181,3 @@ return _init.bridge.resultU8a(); | ||
exports.vrfSign = vrfSign; | ||
const vrfVerify = withWasm((wasm, pubkey, context, message, extra, outAndProof) => { | ||
const vrfVerify = /*#__PURE__*/withWasm((wasm, pubkey, context, message, extra, outAndProof) => { | ||
const ret = wasm.ext_vrf_verify(..._init.bridge.allocU8a(pubkey), ..._init.bridge.allocU8a(context), ..._init.bridge.allocU8a(message), ..._init.bridge.allocU8a(extra), ..._init.bridge.allocU8a(outAndProof)); | ||
@@ -193,3 +187,3 @@ return ret !== 0; | ||
exports.vrfVerify = vrfVerify; | ||
const blake2b = withWasm((wasm, data, key, size) => { | ||
const blake2b = /*#__PURE__*/withWasm((wasm, data, key, size) => { | ||
wasm.ext_blake2b(8, ..._init.bridge.allocU8a(data), ..._init.bridge.allocU8a(key), size); | ||
@@ -199,3 +193,3 @@ return _init.bridge.resultU8a(); | ||
exports.blake2b = blake2b; | ||
const hmacSha256 = withWasm((wasm, key, data) => { | ||
const hmacSha256 = /*#__PURE__*/withWasm((wasm, key, data) => { | ||
wasm.ext_hmac_sha256(8, ..._init.bridge.allocU8a(key), ..._init.bridge.allocU8a(data)); | ||
@@ -205,3 +199,3 @@ return _init.bridge.resultU8a(); | ||
exports.hmacSha256 = hmacSha256; | ||
const hmacSha512 = withWasm((wasm, key, data) => { | ||
const hmacSha512 = /*#__PURE__*/withWasm((wasm, key, data) => { | ||
wasm.ext_hmac_sha512(8, ..._init.bridge.allocU8a(key), ..._init.bridge.allocU8a(data)); | ||
@@ -211,3 +205,3 @@ return _init.bridge.resultU8a(); | ||
exports.hmacSha512 = hmacSha512; | ||
const keccak256 = withWasm((wasm, data) => { | ||
const keccak256 = /*#__PURE__*/withWasm((wasm, data) => { | ||
wasm.ext_keccak256(8, ..._init.bridge.allocU8a(data)); | ||
@@ -217,3 +211,3 @@ return _init.bridge.resultU8a(); | ||
exports.keccak256 = keccak256; | ||
const keccak512 = withWasm((wasm, data) => { | ||
const keccak512 = /*#__PURE__*/withWasm((wasm, data) => { | ||
wasm.ext_keccak512(8, ..._init.bridge.allocU8a(data)); | ||
@@ -223,3 +217,3 @@ return _init.bridge.resultU8a(); | ||
exports.keccak512 = keccak512; | ||
const pbkdf2 = withWasm((wasm, data, salt, rounds) => { | ||
const pbkdf2 = /*#__PURE__*/withWasm((wasm, data, salt, rounds) => { | ||
wasm.ext_pbkdf2(8, ..._init.bridge.allocU8a(data), ..._init.bridge.allocU8a(salt), rounds); | ||
@@ -229,3 +223,3 @@ return _init.bridge.resultU8a(); | ||
exports.pbkdf2 = pbkdf2; | ||
const scrypt = withWasm((wasm, password, salt, log2n, r, p) => { | ||
const scrypt = /*#__PURE__*/withWasm((wasm, password, salt, log2n, r, p) => { | ||
wasm.ext_scrypt(8, ..._init.bridge.allocU8a(password), ..._init.bridge.allocU8a(salt), log2n, r, p); | ||
@@ -235,3 +229,3 @@ return _init.bridge.resultU8a(); | ||
exports.scrypt = scrypt; | ||
const sha256 = withWasm((wasm, data) => { | ||
const sha256 = /*#__PURE__*/withWasm((wasm, data) => { | ||
wasm.ext_sha256(8, ..._init.bridge.allocU8a(data)); | ||
@@ -241,3 +235,3 @@ return _init.bridge.resultU8a(); | ||
exports.sha256 = sha256; | ||
const sha512 = withWasm((wasm, data) => { | ||
const sha512 = /*#__PURE__*/withWasm((wasm, data) => { | ||
wasm.ext_sha512(8, ..._init.bridge.allocU8a(data)); | ||
@@ -247,3 +241,3 @@ return _init.bridge.resultU8a(); | ||
exports.sha512 = sha512; | ||
const twox = withWasm((wasm, data, rounds) => { | ||
const twox = /*#__PURE__*/withWasm((wasm, data, rounds) => { | ||
wasm.ext_twox(8, ..._init.bridge.allocU8a(data), rounds); | ||
@@ -253,7 +247,5 @@ return _init.bridge.resultU8a(); | ||
exports.twox = twox; | ||
function isReady() { | ||
return !!_init.bridge.wasm; | ||
} | ||
async function waitReady() { | ||
@@ -260,0 +252,0 @@ try { |
@@ -7,13 +7,7 @@ "use strict"; | ||
exports.default = void 0; | ||
var _packageInfo = require("@polkadot/wasm-bridge/cjs/packageInfo"); | ||
var _packageInfo2 = require("@polkadot/wasm-crypto-asmjs/cjs/packageInfo"); | ||
var _packageInfo3 = require("@polkadot/wasm-crypto-init/cjs/packageInfo"); | ||
var _packageInfo4 = require("@polkadot/wasm-crypto-wasm/cjs/packageInfo"); | ||
var _packageInfo5 = require("@polkadot/wasm-util/cjs/packageInfo"); | ||
// Copyright 2017-2022 @polkadot/wasm-crypto authors & contributors | ||
@@ -20,0 +14,0 @@ // SPDX-License-Identifier: Apache-2.0 |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _util = require("@polkadot/util"); | ||
var _detectOther = _interopRequireDefault(require("./detectOther")); | ||
var _packageInfo = require("./packageInfo"); | ||
// Copyright 2017-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
(0, _util.detectPackage)(_packageInfo.packageInfo, null, _detectOther.default); |
@@ -6,7 +6,4 @@ "use strict"; | ||
}); | ||
require("./detectPackage"); | ||
var _bundle = require("./bundle"); | ||
Object.keys(_bundle).forEach(function (key) { | ||
@@ -13,0 +10,0 @@ if (key === "default" || key === "__esModule") return; |
@@ -8,7 +8,4 @@ "use strict"; | ||
exports.initBridge = initBridge; | ||
var _wasmBridge = require("@polkadot/wasm-bridge"); | ||
var _wasmCryptoInit = require("@polkadot/wasm-crypto-init"); | ||
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
@@ -24,2 +21,3 @@ // SPDX-License-Identifier: Apache-2.0 | ||
const bridge = new _wasmBridge.Bridge(_wasmCryptoInit.createWasm); | ||
/** | ||
@@ -30,7 +28,5 @@ * @name initBridge | ||
*/ | ||
exports.bridge = bridge; | ||
async function initBridge(createWasm) { | ||
return bridge.init(createWasm); | ||
} |
@@ -7,7 +7,4 @@ "use strict"; | ||
exports.initWasm = initWasm; | ||
var _none = require("@polkadot/wasm-crypto-init/cjs/none"); | ||
var _init = require("./init"); | ||
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
@@ -28,4 +25,4 @@ // SPDX-License-Identifier: Apache-2.0 | ||
} | ||
initWasm().catch(() => {// cannot happen, initWasm doesn't throw | ||
initWasm().catch(() => { | ||
// cannot happen, initWasm doesn't throw | ||
}); |
@@ -7,7 +7,4 @@ "use strict"; | ||
exports.initWasm = initWasm; | ||
var _asm = require("@polkadot/wasm-crypto-init/cjs/asm"); | ||
var _init = require("./init"); | ||
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
@@ -28,4 +25,4 @@ // SPDX-License-Identifier: Apache-2.0 | ||
} | ||
initWasm().catch(() => {// cannot happen, initWasm doesn't throw | ||
initWasm().catch(() => { | ||
// cannot happen, initWasm doesn't throw | ||
}); |
@@ -7,7 +7,4 @@ "use strict"; | ||
exports.initWasm = initWasm; | ||
var _wasm = require("@polkadot/wasm-crypto-init/cjs/wasm"); | ||
var _init = require("./init"); | ||
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
@@ -28,4 +25,4 @@ // SPDX-License-Identifier: Apache-2.0 | ||
} | ||
initWasm().catch(() => {// cannot happen, initWasm doesn't throw | ||
initWasm().catch(() => { | ||
// cannot happen, initWasm doesn't throw | ||
}); |
@@ -7,7 +7,4 @@ "use strict"; | ||
exports.initWasm = initWasm; | ||
var _both = require("@polkadot/wasm-crypto-init/cjs/both"); | ||
var _init = require("./init"); | ||
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
@@ -28,4 +25,4 @@ // SPDX-License-Identifier: Apache-2.0 | ||
} | ||
initWasm().catch(() => {// cannot happen, initWasm doesn't throw | ||
initWasm().catch(() => { | ||
// cannot happen, initWasm doesn't throw | ||
}); |
@@ -9,3 +9,5 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
const packageInfo = { | ||
@@ -15,4 +17,4 @@ name: '@polkadot/wasm-crypto', | ||
type: 'cjs', | ||
version: '6.3.1' | ||
version: '6.4.1' | ||
}; | ||
exports.packageInfo = packageInfo; |
// Copyright 2017-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { packageInfo as bridgeInfo } from '@polkadot/wasm-bridge/packageInfo'; | ||
@@ -4,0 +5,0 @@ import { packageInfo as asmInfo } from '@polkadot/wasm-crypto-asmjs/packageInfo'; |
// Copyright 2017-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
import { detectPackage } from '@polkadot/util'; | ||
@@ -5,0 +7,0 @@ import others from "./detectOther.js"; |
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import "./detectPackage.js"; | ||
export * from "./bundle.js"; |
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { Bridge } from '@polkadot/wasm-bridge'; | ||
import { createWasm } from '@polkadot/wasm-crypto-init'; | ||
/** | ||
@@ -11,4 +13,4 @@ * @name bridge | ||
*/ | ||
export const bridge = new Bridge(createWasm); | ||
export const bridge = new Bridge(createWasm); | ||
/** | ||
@@ -19,5 +21,4 @@ * @name initBridge | ||
*/ | ||
export async function initBridge(createWasm) { | ||
return bridge.init(createWasm); | ||
} |
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { createWasm } from '@polkadot/wasm-crypto-init/none'; | ||
import { initBridge } from "./init.js"; | ||
/** | ||
@@ -14,7 +16,7 @@ * @name initWasm | ||
*/ | ||
export async function initWasm() { | ||
await initBridge(createWasm); | ||
} | ||
initWasm().catch(() => {// cannot happen, initWasm doesn't throw | ||
initWasm().catch(() => { | ||
// cannot happen, initWasm doesn't throw | ||
}); |
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { createWasm } from '@polkadot/wasm-crypto-init/asm'; | ||
import { initBridge } from "./init.js"; | ||
/** | ||
@@ -14,7 +16,7 @@ * @name initWasm | ||
*/ | ||
export async function initWasm() { | ||
await initBridge(createWasm); | ||
} | ||
initWasm().catch(() => {// cannot happen, initWasm doesn't throw | ||
initWasm().catch(() => { | ||
// cannot happen, initWasm doesn't throw | ||
}); |
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { createWasm } from '@polkadot/wasm-crypto-init/wasm'; | ||
import { initBridge } from "./init.js"; | ||
/** | ||
@@ -14,7 +16,7 @@ * @name initWasm | ||
*/ | ||
export async function initWasm() { | ||
await initBridge(createWasm); | ||
} | ||
initWasm().catch(() => {// cannot happen, initWasm doesn't throw | ||
initWasm().catch(() => { | ||
// cannot happen, initWasm doesn't throw | ||
}); |
// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { createWasm } from '@polkadot/wasm-crypto-init/both'; | ||
import { initBridge } from "./init.js"; | ||
/** | ||
@@ -14,7 +16,7 @@ * @name initWasm | ||
*/ | ||
export async function initWasm() { | ||
await initBridge(createWasm); | ||
} | ||
initWasm().catch(() => {// cannot happen, initWasm doesn't throw | ||
initWasm().catch(() => { | ||
// cannot happen, initWasm doesn't throw | ||
}); |
@@ -31,3 +31,3 @@ { | ||
"type": "module", | ||
"version": "6.3.1", | ||
"version": "6.4.1", | ||
"main": "./cjs/index.js", | ||
@@ -97,8 +97,8 @@ "module": "./index.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.18.9", | ||
"@polkadot/wasm-bridge": "6.3.1", | ||
"@polkadot/wasm-crypto-asmjs": "6.3.1", | ||
"@polkadot/wasm-crypto-init": "6.3.1", | ||
"@polkadot/wasm-crypto-wasm": "6.3.1", | ||
"@polkadot/wasm-util": "6.3.1" | ||
"@babel/runtime": "^7.20.6", | ||
"@polkadot/wasm-bridge": "6.4.1", | ||
"@polkadot/wasm-crypto-asmjs": "6.4.1", | ||
"@polkadot/wasm-crypto-init": "6.4.1", | ||
"@polkadot/wasm-crypto-wasm": "6.4.1", | ||
"@polkadot/wasm-util": "6.4.1" | ||
}, | ||
@@ -105,0 +105,0 @@ "peerDependencies": { |
// Copyright 2017-2022 @polkadot/wasm-crypto authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
export const packageInfo = { | ||
@@ -8,3 +10,3 @@ name: '@polkadot/wasm-crypto', | ||
type: 'esm', | ||
version: '6.3.1' | ||
version: '6.4.1' | ||
}; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
5
299834
2307
+ Added@polkadot/wasm-bridge@6.4.1(transitive)
+ Added@polkadot/wasm-crypto-asmjs@6.4.1(transitive)
+ Added@polkadot/wasm-crypto-init@6.4.1(transitive)
+ Added@polkadot/wasm-crypto-wasm@6.4.1(transitive)
+ Added@polkadot/wasm-util@6.4.1(transitive)
- Removed@polkadot/wasm-bridge@6.3.1(transitive)
- Removed@polkadot/wasm-crypto-asmjs@6.3.1(transitive)
- Removed@polkadot/wasm-crypto-init@6.3.1(transitive)
- Removed@polkadot/wasm-crypto-wasm@6.3.1(transitive)
- Removed@polkadot/wasm-util@6.3.1(transitive)
Updated@babel/runtime@^7.20.6
Updated@polkadot/wasm-bridge@6.4.1
Updated@polkadot/wasm-util@6.4.1