@pezkuwi/wasm-crypto 7.5.13 → 7.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +50 -0
- package/Xargo.toml +2 -0
- package/build/README.md +29 -0
- package/build/bundle-pezkuwi-wasm-crypto.js +2092 -0
- package/build/bundle.d.ts +40 -0
- package/build/bundle.js +505 -0
- package/build/cjs/bundle.d.ts +40 -0
- package/build/cjs/bundle.js +544 -0
- package/{index.d.ts → build/cjs/index.d.ts} +0 -1
- package/build/cjs/index.js +4 -0
- package/build/cjs/init.js +21 -0
- package/build/cjs/initNone.js +20 -0
- package/build/cjs/initOnlyAsm.js +20 -0
- package/build/cjs/initOnlyWasm.js +20 -0
- package/build/cjs/initWasmAsm.js +20 -0
- package/build/cjs/packageInfo.js +4 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/init.d.ts +16 -0
- package/build/init.js +17 -0
- package/build/initNone.d.ts +10 -0
- package/build/initNone.js +17 -0
- package/build/initOnlyAsm.d.ts +10 -0
- package/build/initOnlyAsm.js +17 -0
- package/build/initOnlyWasm.d.ts +10 -0
- package/build/initOnlyWasm.js +17 -0
- package/build/initWasmAsm.d.ts +10 -0
- package/build/initWasmAsm.js +17 -0
- package/build/package.json +208 -0
- package/build/packageDetect.d.ts +1 -0
- package/build/packageDetect.js +8 -0
- package/build/packageInfo.d.ts +6 -0
- package/build/packageInfo.js +1 -0
- package/build-deno/README.md +25 -0
- package/build-deno/bundle.ts +597 -0
- package/build-deno/index.ts +2 -0
- package/build-deno/init.ts +23 -0
- package/build-deno/initNone.ts +21 -0
- package/build-deno/initOnlyAsm.ts +21 -0
- package/build-deno/initOnlyWasm.ts +21 -0
- package/build-deno/initWasmAsm.ts +21 -0
- package/build-deno/mod.ts +2 -0
- package/build-deno/packageDetect.ts +12 -0
- package/build-deno/packageInfo.ts +3 -0
- package/build-deno/rs/.editorconfig +10 -0
- package/build-tsc/bundle.d.ts +40 -0
- package/{cjs → build-tsc}/index.d.ts +0 -1
- package/build-tsc-cjs/bundle.js +544 -0
- package/{cjs → build-tsc-cjs}/index.js +0 -1
- package/build-tsc-cjs/packageDetect.js +10 -0
- package/{cjs → build-tsc-cjs}/packageInfo.js +1 -1
- package/build-tsc-esm/bundle.js +505 -0
- package/{index.js → build-tsc-esm/index.js} +0 -1
- package/{packageInfo.js → build-tsc-esm/packageInfo.js} +1 -1
- package/package.json +89 -87
- package/src/bundle.ts +613 -0
- package/src/index.ts +5 -0
- package/src/init.ts +25 -0
- package/src/initNone.ts +23 -0
- package/src/initOnlyAsm.ts +23 -0
- package/src/initOnlyWasm.ts +23 -0
- package/src/initWasmAsm.ts +23 -0
- package/src/lib.rs +24 -0
- package/src/mod.ts +4 -0
- package/src/packageDetect.ts +16 -0
- package/src/packageInfo.ts +6 -0
- package/src/rs/.editorconfig +10 -0
- package/src/rs/bip39.rs +139 -0
- package/src/rs/ed25519.rs +142 -0
- package/src/rs/hashing.rs +322 -0
- package/src/rs/secp256k1.rs +150 -0
- package/src/rs/sr25519.rs +331 -0
- package/src/rs/vrf.rs +144 -0
- package/test/all/bip39.js +86 -0
- package/test/all/ed25519.js +84 -0
- package/test/all/hashing.js +138 -0
- package/test/all/index.js +126 -0
- package/test/all/secp256k1.js +105 -0
- package/test/all/sr25519.js +211 -0
- package/test/all/vrf.js +74 -0
- package/test/asm.js +10 -0
- package/test/deno.ts +38 -0
- package/test/jest.spec.ts +25 -0
- package/test/loader-build.js +39 -0
- package/test/wasm.js +8 -0
- package/tsconfig.build.json +19 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.spec.json +16 -0
- package/tsconfig.spec.tsbuildinfo +1 -0
- package/bundle-pezkuwi-wasm-crypto.js +0 -825
- package/bundle.d.ts +0 -37
- package/bundle.js +0 -165
- package/cjs/bundle.d.ts +0 -37
- package/cjs/bundle.js +0 -171
- /package/{LICENSE → build/LICENSE} +0 -0
- /package/{init.d.ts → build/cjs/init.d.ts} +0 -0
- /package/{initNone.d.ts → build/cjs/initNone.d.ts} +0 -0
- /package/{initOnlyAsm.d.ts → build/cjs/initOnlyAsm.d.ts} +0 -0
- /package/{initOnlyWasm.d.ts → build/cjs/initOnlyWasm.d.ts} +0 -0
- /package/{initWasmAsm.d.ts → build/cjs/initWasmAsm.d.ts} +0 -0
- /package/{cjs → build/cjs}/package.json +0 -0
- /package/{packageDetect.d.ts → build/cjs/packageDetect.d.ts} +0 -0
- /package/{cjs → build/cjs}/packageDetect.js +0 -0
- /package/{packageInfo.d.ts → build/cjs/packageInfo.d.ts} +0 -0
- /package/{cjs → build-tsc}/init.d.ts +0 -0
- /package/{cjs → build-tsc}/initNone.d.ts +0 -0
- /package/{cjs → build-tsc}/initOnlyAsm.d.ts +0 -0
- /package/{cjs → build-tsc}/initOnlyWasm.d.ts +0 -0
- /package/{cjs → build-tsc}/initWasmAsm.d.ts +0 -0
- /package/{cjs → build-tsc}/packageDetect.d.ts +0 -0
- /package/{cjs → build-tsc}/packageInfo.d.ts +0 -0
- /package/{cjs → build-tsc-cjs}/init.js +0 -0
- /package/{cjs → build-tsc-cjs}/initNone.js +0 -0
- /package/{cjs → build-tsc-cjs}/initOnlyAsm.js +0 -0
- /package/{cjs → build-tsc-cjs}/initOnlyWasm.js +0 -0
- /package/{cjs → build-tsc-cjs}/initWasmAsm.js +0 -0
- /package/{init.js → build-tsc-esm/init.js} +0 -0
- /package/{initNone.js → build-tsc-esm/initNone.js} +0 -0
- /package/{initOnlyAsm.js → build-tsc-esm/initOnlyAsm.js} +0 -0
- /package/{initOnlyWasm.js → build-tsc-esm/initOnlyWasm.js} +0 -0
- /package/{initWasmAsm.js → build-tsc-esm/initWasmAsm.js} +0 -0
- /package/{packageDetect.js → build-tsc-esm/packageDetect.js} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { createWasm } from 'https://deno.land/x/pezkuwi/wasm-crypto-init/wasm.ts';
|
|
3
|
+
|
|
4
|
+
import { initBridge } from './init.ts';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @name initWasm
|
|
8
|
+
* @description
|
|
9
|
+
* For historic purposes and for tighter control on init, specifically performing
|
|
10
|
+
* a WASM initialization with only WASM (generally the default for most platforms)
|
|
11
|
+
*
|
|
12
|
+
* Generally should not be used unless you want explicit control over which
|
|
13
|
+
* interfaces are initialized.
|
|
14
|
+
*/
|
|
15
|
+
export async function initWasm (): Promise<void> {
|
|
16
|
+
await initBridge(createWasm);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
initWasm().catch((): void => {
|
|
20
|
+
// cannot happen, initWasm doesn't throw
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { createWasm } from 'https://deno.land/x/pezkuwi/wasm-crypto-init/both.ts';
|
|
3
|
+
|
|
4
|
+
import { initBridge } from './init.ts';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @name initWasm
|
|
8
|
+
* @description
|
|
9
|
+
* For historic purposes and for tighter control on init, specifically performing
|
|
10
|
+
* a WASM initialization with ASM and an ASM.js fallback
|
|
11
|
+
*
|
|
12
|
+
* Generally should not be used unless you want explicit control over which
|
|
13
|
+
* interfaces are initialized.
|
|
14
|
+
*/
|
|
15
|
+
export async function initWasm (): Promise<void> {
|
|
16
|
+
await initBridge(createWasm);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
initWasm().catch((): void => {
|
|
20
|
+
// cannot happen, initWasm doesn't throw
|
|
21
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import { detectPackage } from 'https://deno.land/x/pezkuwi/util/mod.ts';
|
|
4
|
+
import { packageInfo as bridgeInfo } from 'https://deno.land/x/pezkuwi/wasm-bridge/packageInfo.ts';
|
|
5
|
+
import { packageInfo as asmInfo } from 'https://deno.land/x/pezkuwi/wasm-crypto-asmjs/packageInfo.ts';
|
|
6
|
+
import { packageInfo as initInfo } from 'https://deno.land/x/pezkuwi/wasm-crypto-init/packageInfo.ts';
|
|
7
|
+
import { packageInfo as wasmInfo } from 'https://deno.land/x/pezkuwi/wasm-crypto-wasm/packageInfo.ts';
|
|
8
|
+
import { packageInfo as utilInfo } from 'https://deno.land/x/pezkuwi/wasm-util/packageInfo.ts';
|
|
9
|
+
|
|
10
|
+
import { packageInfo } from './packageInfo.ts';
|
|
11
|
+
|
|
12
|
+
detectPackage(packageInfo, null, [asmInfo, bridgeInfo, initInfo, utilInfo, wasmInfo]);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { packageInfo } from './packageInfo.js';
|
|
2
|
+
export declare const bridge: {
|
|
3
|
+
wasm: unknown;
|
|
4
|
+
type: "wasm";
|
|
5
|
+
};
|
|
6
|
+
export declare function isReady(): boolean;
|
|
7
|
+
export declare function waitReady(): Promise<boolean>;
|
|
8
|
+
export declare function getSigningContext(): string;
|
|
9
|
+
export declare function sr25519KeypairFromSeed(seed: Uint8Array): Uint8Array;
|
|
10
|
+
export declare function sr25519Sign(publicKey: Uint8Array, secretKey: Uint8Array, message: Uint8Array): Uint8Array;
|
|
11
|
+
export declare function sr25519Verify(signature: Uint8Array, message: Uint8Array, publicKey: Uint8Array): boolean;
|
|
12
|
+
export declare function bip39Validate(phrase: string): boolean;
|
|
13
|
+
export declare function bip39Generate(_words: 12 | 15 | 18 | 21 | 24): string;
|
|
14
|
+
export declare function bip39ToEntropy(phrase: string): Uint8Array;
|
|
15
|
+
export declare function bip39ToMiniSecret(phrase: string, password: string): Uint8Array;
|
|
16
|
+
export declare function bip39ToSeed(phrase: string, password: string): Uint8Array;
|
|
17
|
+
export declare function ed25519KeypairFromSeed(_seed: Uint8Array): Uint8Array;
|
|
18
|
+
export declare function ed25519Sign(_publicKey: Uint8Array, _secretKey: Uint8Array, _message: Uint8Array): Uint8Array;
|
|
19
|
+
export declare function ed25519Verify(_signature: Uint8Array, _message: Uint8Array, _publicKey: Uint8Array): boolean;
|
|
20
|
+
export declare function sr25519Agree(_publicKey: Uint8Array, _secretKey: Uint8Array): Uint8Array;
|
|
21
|
+
export declare function sr25519DeriveKeypairHard(_pair: Uint8Array, _cc: Uint8Array): Uint8Array;
|
|
22
|
+
export declare function sr25519DeriveKeypairSoft(_pair: Uint8Array, _cc: Uint8Array): Uint8Array;
|
|
23
|
+
export declare function sr25519DerivePublicSoft(_publicKey: Uint8Array, _cc: Uint8Array): Uint8Array;
|
|
24
|
+
export declare function vrfSign(_secretKey: Uint8Array, _context: Uint8Array, _message: Uint8Array, _extra: Uint8Array): Uint8Array;
|
|
25
|
+
export declare function vrfVerify(_publicKey: Uint8Array, _context: Uint8Array, _message: Uint8Array, _extra: Uint8Array, _outAndProof: Uint8Array): boolean;
|
|
26
|
+
export declare function secp256k1FromSeed(_seed: Uint8Array): Uint8Array;
|
|
27
|
+
export declare function secp256k1Compress(_publicKey: Uint8Array): Uint8Array;
|
|
28
|
+
export declare function secp256k1Expand(_publicKey: Uint8Array): Uint8Array;
|
|
29
|
+
export declare function secp256k1Recover(_msgHash: Uint8Array, _signature: Uint8Array, _recoveryId: number): Uint8Array;
|
|
30
|
+
export declare function secp256k1Sign(_msgHash: Uint8Array, _secretKey: Uint8Array): Uint8Array;
|
|
31
|
+
export declare function blake2b(data: Uint8Array, key: Uint8Array, size: number): Uint8Array;
|
|
32
|
+
export declare function hmacSha256(key: Uint8Array, data: Uint8Array): Uint8Array;
|
|
33
|
+
export declare function hmacSha512(key: Uint8Array, data: Uint8Array): Uint8Array;
|
|
34
|
+
export declare function keccak256(data: Uint8Array): Uint8Array;
|
|
35
|
+
export declare function keccak512(data: Uint8Array): Uint8Array;
|
|
36
|
+
export declare function pbkdf2(data: Uint8Array, salt: Uint8Array, rounds: number): Uint8Array;
|
|
37
|
+
export declare function scrypt(_password: Uint8Array, _salt: Uint8Array, _log2n: number, _r: number, _p: number): Uint8Array;
|
|
38
|
+
export declare function sha256(data: Uint8Array): Uint8Array;
|
|
39
|
+
export declare function sha512(data: Uint8Array): Uint8Array;
|
|
40
|
+
export declare function twox(data: Uint8Array, rounds: number): Uint8Array;
|