@pezkuwi/wasm-crypto 7.5.12 → 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.
Files changed (122) hide show
  1. package/Cargo.toml +50 -0
  2. package/Xargo.toml +2 -0
  3. package/build/README.md +29 -0
  4. package/build/bundle-pezkuwi-wasm-crypto.js +2092 -0
  5. package/build/bundle.d.ts +40 -0
  6. package/build/bundle.js +505 -0
  7. package/build/cjs/bundle.d.ts +40 -0
  8. package/build/cjs/bundle.js +544 -0
  9. package/{index.d.ts → build/cjs/index.d.ts} +0 -1
  10. package/build/cjs/index.js +4 -0
  11. package/build/cjs/init.js +21 -0
  12. package/build/cjs/initNone.js +20 -0
  13. package/build/cjs/initOnlyAsm.js +20 -0
  14. package/build/cjs/initOnlyWasm.js +20 -0
  15. package/build/cjs/initWasmAsm.js +20 -0
  16. package/build/cjs/packageInfo.js +4 -0
  17. package/build/index.d.ts +1 -0
  18. package/build/index.js +1 -0
  19. package/build/init.d.ts +16 -0
  20. package/build/init.js +17 -0
  21. package/build/initNone.d.ts +10 -0
  22. package/build/initNone.js +17 -0
  23. package/build/initOnlyAsm.d.ts +10 -0
  24. package/build/initOnlyAsm.js +17 -0
  25. package/build/initOnlyWasm.d.ts +10 -0
  26. package/build/initOnlyWasm.js +17 -0
  27. package/build/initWasmAsm.d.ts +10 -0
  28. package/build/initWasmAsm.js +17 -0
  29. package/build/package.json +208 -0
  30. package/build/packageDetect.d.ts +1 -0
  31. package/build/packageDetect.js +8 -0
  32. package/build/packageInfo.d.ts +6 -0
  33. package/build/packageInfo.js +1 -0
  34. package/build-deno/README.md +25 -0
  35. package/build-deno/bundle.ts +597 -0
  36. package/build-deno/index.ts +2 -0
  37. package/build-deno/init.ts +23 -0
  38. package/build-deno/initNone.ts +21 -0
  39. package/build-deno/initOnlyAsm.ts +21 -0
  40. package/build-deno/initOnlyWasm.ts +21 -0
  41. package/build-deno/initWasmAsm.ts +21 -0
  42. package/build-deno/mod.ts +2 -0
  43. package/build-deno/packageDetect.ts +12 -0
  44. package/build-deno/packageInfo.ts +3 -0
  45. package/build-deno/rs/.editorconfig +10 -0
  46. package/build-tsc/bundle.d.ts +40 -0
  47. package/{cjs → build-tsc}/index.d.ts +0 -1
  48. package/build-tsc-cjs/bundle.js +544 -0
  49. package/{cjs → build-tsc-cjs}/index.js +0 -1
  50. package/build-tsc-cjs/packageDetect.js +10 -0
  51. package/{cjs → build-tsc-cjs}/packageInfo.js +1 -1
  52. package/build-tsc-esm/bundle.js +505 -0
  53. package/{index.js → build-tsc-esm/index.js} +0 -1
  54. package/{packageInfo.js → build-tsc-esm/packageInfo.js} +1 -1
  55. package/package.json +89 -87
  56. package/src/bundle.ts +613 -0
  57. package/src/index.ts +5 -0
  58. package/src/init.ts +25 -0
  59. package/src/initNone.ts +23 -0
  60. package/src/initOnlyAsm.ts +23 -0
  61. package/src/initOnlyWasm.ts +23 -0
  62. package/src/initWasmAsm.ts +23 -0
  63. package/src/lib.rs +24 -0
  64. package/src/mod.ts +4 -0
  65. package/src/packageDetect.ts +16 -0
  66. package/src/packageInfo.ts +6 -0
  67. package/src/rs/.editorconfig +10 -0
  68. package/src/rs/bip39.rs +139 -0
  69. package/src/rs/ed25519.rs +142 -0
  70. package/src/rs/hashing.rs +322 -0
  71. package/src/rs/secp256k1.rs +150 -0
  72. package/src/rs/sr25519.rs +331 -0
  73. package/src/rs/vrf.rs +144 -0
  74. package/test/all/bip39.js +86 -0
  75. package/test/all/ed25519.js +84 -0
  76. package/test/all/hashing.js +138 -0
  77. package/test/all/index.js +126 -0
  78. package/test/all/secp256k1.js +105 -0
  79. package/test/all/sr25519.js +211 -0
  80. package/test/all/vrf.js +74 -0
  81. package/test/asm.js +10 -0
  82. package/test/deno.ts +38 -0
  83. package/test/jest.spec.ts +25 -0
  84. package/test/loader-build.js +39 -0
  85. package/test/wasm.js +8 -0
  86. package/tsconfig.build.json +19 -0
  87. package/tsconfig.build.tsbuildinfo +1 -0
  88. package/tsconfig.spec.json +16 -0
  89. package/tsconfig.spec.tsbuildinfo +1 -0
  90. package/bundle-pezkuwi-wasm-crypto.js +0 -777
  91. package/bundle.d.ts +0 -37
  92. package/bundle.js +0 -165
  93. package/cjs/bundle.d.ts +0 -37
  94. package/cjs/bundle.js +0 -171
  95. /package/{LICENSE → build/LICENSE} +0 -0
  96. /package/{init.d.ts → build/cjs/init.d.ts} +0 -0
  97. /package/{initNone.d.ts → build/cjs/initNone.d.ts} +0 -0
  98. /package/{initOnlyAsm.d.ts → build/cjs/initOnlyAsm.d.ts} +0 -0
  99. /package/{initOnlyWasm.d.ts → build/cjs/initOnlyWasm.d.ts} +0 -0
  100. /package/{initWasmAsm.d.ts → build/cjs/initWasmAsm.d.ts} +0 -0
  101. /package/{cjs → build/cjs}/package.json +0 -0
  102. /package/{packageDetect.d.ts → build/cjs/packageDetect.d.ts} +0 -0
  103. /package/{cjs → build/cjs}/packageDetect.js +0 -0
  104. /package/{packageInfo.d.ts → build/cjs/packageInfo.d.ts} +0 -0
  105. /package/{cjs → build-tsc}/init.d.ts +0 -0
  106. /package/{cjs → build-tsc}/initNone.d.ts +0 -0
  107. /package/{cjs → build-tsc}/initOnlyAsm.d.ts +0 -0
  108. /package/{cjs → build-tsc}/initOnlyWasm.d.ts +0 -0
  109. /package/{cjs → build-tsc}/initWasmAsm.d.ts +0 -0
  110. /package/{cjs → build-tsc}/packageDetect.d.ts +0 -0
  111. /package/{cjs → build-tsc}/packageInfo.d.ts +0 -0
  112. /package/{cjs → build-tsc-cjs}/init.js +0 -0
  113. /package/{cjs → build-tsc-cjs}/initNone.js +0 -0
  114. /package/{cjs → build-tsc-cjs}/initOnlyAsm.js +0 -0
  115. /package/{cjs → build-tsc-cjs}/initOnlyWasm.js +0 -0
  116. /package/{cjs → build-tsc-cjs}/initWasmAsm.js +0 -0
  117. /package/{init.js → build-tsc-esm/init.js} +0 -0
  118. /package/{initNone.js → build-tsc-esm/initNone.js} +0 -0
  119. /package/{initOnlyAsm.js → build-tsc-esm/initOnlyAsm.js} +0 -0
  120. /package/{initOnlyWasm.js → build-tsc-esm/initOnlyWasm.js} +0 -0
  121. /package/{initWasmAsm.js → build-tsc-esm/initWasmAsm.js} +0 -0
  122. /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,2 @@
1
+
2
+ export * from './index.ts';
@@ -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,3 @@
1
+
2
+
3
+ export const packageInfo = { name: '@pezkuwi/wasm-crypto', path: new URL(import.meta.url).pathname, type: 'deno', version: '7.5.15' };
@@ -0,0 +1,10 @@
1
+ root = true
2
+ [*]
3
+ indent_style=tab
4
+ indent_size=tab
5
+ tab_width=4
6
+ end_of_line=lf
7
+ charset=utf-8
8
+ trim_trailing_whitespace=true
9
+ max_line_length=100
10
+ insert_final_newline=true
@@ -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;
@@ -1,2 +1 @@
1
- import './packageDetect.js';
2
1
  export * from './bundle.js';