@pezkuwi/wasm-crypto 7.5.6 → 7.5.8

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 (69) hide show
  1. package/Cargo.toml +50 -0
  2. package/README.md +5 -5
  3. package/Xargo.toml +2 -0
  4. package/package.json +19 -165
  5. package/src/bundle.ts +247 -0
  6. package/src/index.ts +6 -0
  7. package/{init.d.ts → src/init.ts} +11 -2
  8. package/{initNone.js → src/initNone.ts} +10 -4
  9. package/{initOnlyAsm.js → src/initOnlyAsm.ts} +10 -4
  10. package/{initOnlyWasm.js → src/initOnlyWasm.ts} +10 -4
  11. package/{initWasmAsm.js → src/initWasmAsm.ts} +10 -4
  12. package/src/lib.rs +24 -0
  13. package/src/mod.ts +4 -0
  14. package/{packageDetect.js → src/packageDetect.ts} +8 -0
  15. package/src/packageInfo.ts +6 -0
  16. package/src/rs/.editorconfig +10 -0
  17. package/src/rs/bip39.rs +139 -0
  18. package/src/rs/ed25519.rs +142 -0
  19. package/src/rs/hashing.rs +322 -0
  20. package/src/rs/secp256k1.rs +150 -0
  21. package/src/rs/sr25519.rs +331 -0
  22. package/src/rs/vrf.rs +144 -0
  23. package/test/all/bip39.js +86 -0
  24. package/test/all/ed25519.js +84 -0
  25. package/test/all/hashing.js +138 -0
  26. package/test/all/index.js +126 -0
  27. package/test/all/secp256k1.js +105 -0
  28. package/test/all/sr25519.js +211 -0
  29. package/test/all/vrf.js +74 -0
  30. package/test/asm.js +10 -0
  31. package/test/deno.ts +37 -0
  32. package/test/jest.spec.ts +24 -0
  33. package/test/loader-build.js +39 -0
  34. package/test/wasm.js +8 -0
  35. package/tsconfig.build.json +19 -0
  36. package/tsconfig.spec.json +16 -0
  37. package/LICENSE +0 -201
  38. package/bundle-polkadot-wasm-crypto.js +0 -661
  39. package/bundle.js +0 -165
  40. package/cjs/bundle.d.ts +0 -37
  41. package/cjs/bundle.js +0 -171
  42. package/cjs/index.js +0 -5
  43. package/cjs/init.js +0 -21
  44. package/cjs/initNone.js +0 -20
  45. package/cjs/initOnlyAsm.js +0 -20
  46. package/cjs/initOnlyWasm.js +0 -20
  47. package/cjs/initWasmAsm.js +0 -20
  48. package/cjs/package.json +0 -3
  49. package/cjs/packageDetect.js +0 -10
  50. package/cjs/packageInfo.js +0 -4
  51. package/index.d.ts +0 -2
  52. package/index.js +0 -2
  53. package/init.js +0 -17
  54. package/initNone.d.ts +0 -10
  55. package/initOnlyAsm.d.ts +0 -10
  56. package/initOnlyWasm.d.ts +0 -10
  57. package/initWasmAsm.d.ts +0 -10
  58. package/packageDetect.d.ts +0 -1
  59. package/packageInfo.d.ts +0 -6
  60. package/packageInfo.js +0 -1
  61. /package/{bundle.d.ts → build/bundle.d.ts} +0 -0
  62. /package/{cjs → build}/index.d.ts +0 -0
  63. /package/{cjs → build}/init.d.ts +0 -0
  64. /package/{cjs → build}/initNone.d.ts +0 -0
  65. /package/{cjs → build}/initOnlyAsm.d.ts +0 -0
  66. /package/{cjs → build}/initOnlyWasm.d.ts +0 -0
  67. /package/{cjs → build}/initWasmAsm.d.ts +0 -0
  68. /package/{cjs → build}/packageDetect.d.ts +0 -0
  69. /package/{cjs → build}/packageInfo.d.ts +0 -0
@@ -0,0 +1,211 @@
1
+ // Copyright 2019-2026 @pezkuwi/wasm-crypto authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* global it */
5
+
6
+ import crypto from 'crypto';
7
+
8
+ import { assert, hexToU8a, stringToU8a, u8aToHex } from '@pezkuwi/util';
9
+
10
+ /**
11
+ * @internal
12
+ * @param {*} pair
13
+ */
14
+ function extractKeys (pair) {
15
+ return [pair, pair.slice(64), pair.slice(0, 64)];
16
+ }
17
+
18
+ /**
19
+ * @internal
20
+ * @param {*} wasm
21
+ */
22
+ function randomPair (wasm) {
23
+ return extractKeys(wasm.sr25519KeypairFromSeed(crypto.randomBytes(32)));
24
+ }
25
+
26
+ /**
27
+ * @param {*} wasm
28
+ */
29
+ export function sr25519PairFromSeed (wasm) {
30
+ it('creates a known pair from a known seed', () => {
31
+ const pair = wasm.sr25519KeypairFromSeed(stringToU8a('12345678901234567890123456789012'));
32
+
33
+ // console.log('\tSEC', u8aToHex(pair.slice(0, 64)));
34
+ // console.log('\tPUB', u8aToHex(pair.slice(64)));
35
+
36
+ assert(u8aToHex(pair) === '0xf0106660c3dda23f16daa9ac5b811b963077f5bc0af89f85804f0de8e424f050f98d66f39442506ff947fd911f18c7a7a5da639a63e8d3b4e233f74143d951c1741c08a06f41c596608f6774259bd9043304adfa5d3eea62760bd9be97634d63', 'ERROR: pairFromSeed() does not match');
37
+ });
38
+ }
39
+
40
+ /**
41
+ * @param {*} wasm
42
+ */
43
+ export function sr25519DevFromSeed (wasm) {
44
+ it('creates a known development pair', () => {
45
+ const pair = wasm.sr25519KeypairFromSeed(hexToU8a('0xfac7959dbfe72f052e5a0c3c8d6530f202b02fd8f9f5ca3580ec8deb7797479e'));
46
+
47
+ // console.log('\tSEC', u8aToHex(pair.slice(0, 64)));
48
+ // console.log('\tPUB', u8aToHex(pair.slice(64)));
49
+
50
+ assert(u8aToHex(pair) === '0x28b0ae221c6bb06856b287f60d7ea0d98552ea5a16db16956849aa371db3eb51fd190cce74df356432b410bd64682309d6dedb27c76845daf388557cbac3ca3446ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a', 'ERROR: devFromSeed() does not match');
51
+ });
52
+ }
53
+
54
+ /**
55
+ * @param {*} wasm
56
+ */
57
+ export function sr25519VerifyExisting (wasm) {
58
+ it('verifies a known signature', () => {
59
+ const PK = hexToU8a('0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d');
60
+ const MESSAGE = stringToU8a('I hereby verify that I control 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
61
+ const SIGNATURE = hexToU8a('0xb83881d3bd7302981ee1c504fe5b7b394682927131fc0846fd616bb40fa14d02640fd2aca785b4cb57904765c2e4e75f59a7dd30154c209964369912091f6981');
62
+
63
+ const isValid = wasm.sr25519Verify(SIGNATURE, MESSAGE, PK);
64
+
65
+ // console.log('\tRES', isValid);
66
+
67
+ assert(isValid, 'ERROR: Unable to verify signature');
68
+ });
69
+ }
70
+
71
+ /**
72
+ * @param {*} wasm
73
+ */
74
+ export function sr25519SignDeterministic (wasm) {
75
+ it('creates non-deterministic signatures', () => {
76
+ const [, pk, sk] = randomPair(wasm);
77
+ const sig1 = u8aToHex(wasm.sr25519Sign(pk, sk, stringToU8a('this is a message')));
78
+ const sig2 = u8aToHex(wasm.sr25519Sign(pk, sk, stringToU8a('this is a message')));
79
+
80
+ // console.log('\tSG1', sig1);
81
+ // console.log('\tSG2', sig2);
82
+
83
+ assert(sig1 !== sig2, 'ERROR: Signatures are deterministic');
84
+ });
85
+ }
86
+
87
+ /**
88
+ * @param {*} wasm
89
+ */
90
+ export function sr25519SignAndVerify (wasm) {
91
+ it('verifies a created signature', () => {
92
+ const [, pk, sk] = randomPair(wasm);
93
+ const signature = wasm.sr25519Sign(pk, sk, stringToU8a('this is a message'));
94
+ const isValid = wasm.sr25519Verify(signature, stringToU8a('this is a message'), pk);
95
+
96
+ // console.log('\tSIG', u8aToHex(signature));
97
+ // console.log('\tRES', isValid);
98
+
99
+ assert(isValid, 'ERROR: Unable to verify signature');
100
+ });
101
+ }
102
+
103
+ /**
104
+ * @param {*} wasm
105
+ */
106
+ export function sr25519DeriveHard (wasm) {
107
+ it('derives using a hard path', () => {
108
+ const [pair] = randomPair(wasm);
109
+ const derived = wasm.sr25519DeriveKeypairHard(pair, hexToU8a('0x0c666f6f00000000000000000000000000000000000000000000000000000000'));
110
+
111
+ // console.log('\tSEC', u8aToHex(derived.slice(0, 64)));
112
+ // console.log('\tPUB', u8aToHex(derived.slice(64)));
113
+
114
+ assert(derived.length === 96, 'Derived key length mismatch');
115
+ });
116
+ }
117
+
118
+ /**
119
+ * @param {*} wasm
120
+ */
121
+ export function sr25519DeriveHardKnown (wasm) {
122
+ it('derives a known hard key', () => {
123
+ const derived = wasm.sr25519DeriveKeypairHard(hexToU8a('0x28b0ae221c6bb06856b287f60d7ea0d98552ea5a16db16956849aa371db3eb51fd190cce74df356432b410bd64682309d6dedb27c76845daf388557cbac3ca3446ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a'), hexToU8a('0x14416c6963650000000000000000000000000000000000000000000000000000'));
124
+ const publicKey = u8aToHex(derived.slice(64));
125
+
126
+ // console.log('\tSEC', u8aToHex(derived.slice(0, 64)));
127
+ // console.log('\tPUB', publicKey);
128
+
129
+ assert(publicKey === '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d', 'Unmatched resulting public keys');
130
+ });
131
+ }
132
+
133
+ /**
134
+ * @param {*} wasm
135
+ */
136
+ export function sr25519DeriveSoft (wasm) {
137
+ it('derives using a soft path', () => {
138
+ const [pair] = randomPair(wasm);
139
+ const derived = wasm.sr25519DeriveKeypairSoft(pair, hexToU8a('0x0c666f6f00000000000000000000000000000000000000000000000000000000'));
140
+
141
+ // console.log('\tSEC', u8aToHex(derived.slice(0, 64)));
142
+ // console.log('\tPUB', u8aToHex(derived.slice(64)));
143
+
144
+ assert(derived.length === 96, 'Derived key length mismatch');
145
+ });
146
+ }
147
+
148
+ /**
149
+ * @param {*} wasm
150
+ */
151
+ export function sr25519DeriveSoftKnown (wasm) {
152
+ it('derives a known soft key', () => {
153
+ const derived = wasm.sr25519DeriveKeypairSoft(hexToU8a('0x28b0ae221c6bb06856b287f60d7ea0d98552ea5a16db16956849aa371db3eb51fd190cce74df356432b410bd64682309d6dedb27c76845daf388557cbac3ca3446ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a'), hexToU8a('0x0c666f6f00000000000000000000000000000000000000000000000000000000'));
154
+ const publicKey = u8aToHex(derived.slice(64));
155
+
156
+ // console.log('\tSEC', u8aToHex(derived.slice(0, 64)));
157
+ // console.log('\tPUB', publicKey);
158
+
159
+ assert(publicKey === '0x40b9675df90efa6069ff623b0fdfcf706cd47ca7452a5056c7ad58194d23440a', 'Unmatched resulting public keys');
160
+ });
161
+ }
162
+
163
+ /**
164
+ * @param {*} wasm
165
+ */
166
+ export function sr25519DeriveSoftPubkey (wasm) {
167
+ it('derives a known soft publicKey', () => {
168
+ const derived = u8aToHex(wasm.sr25519DerivePublicSoft(hexToU8a('0x46ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a'), hexToU8a('0x0c666f6f00000000000000000000000000000000000000000000000000000000')));
169
+
170
+ // console.log('\tPUB', derived);
171
+
172
+ assert(derived === '0x40b9675df90efa6069ff623b0fdfcf706cd47ca7452a5056c7ad58194d23440a', 'Unmatched resulting public keys');
173
+ });
174
+ }
175
+
176
+ /**
177
+ * @param {*} wasm
178
+ */
179
+ export function sr25519KeyAgreement (wasm) {
180
+ it('allows for agreements', () => {
181
+ const pair1 = wasm.sr25519KeypairFromSeed(hexToU8a('0x3b44c558f9a8f3dc9690d53088558c1ba2529b677e316c6054d1852595b004af'));
182
+ const pair2 = wasm.sr25519KeypairFromSeed(hexToU8a('0x923b80f79c6981fe756272128ec236eb510ae016dd20bdccbd77a9416b7ab94e'));
183
+ const [, pk1, sk1] = extractKeys(pair1);
184
+ const [, pk2, sk2] = extractKeys(pair2);
185
+
186
+ assert(u8aToHex(wasm.sr25519Agree(pk1, sk2)) === '0xfa7b90001b790fe42ff78b8cd86f6cf7a7c0a70b72f6b4c771b5d67536450222', 'Unmatched agreement keys');
187
+ assert(u8aToHex(wasm.sr25519Agree(pk2, sk1)) === '0xfa7b90001b790fe42ff78b8cd86f6cf7a7c0a70b72f6b4c771b5d67536450222', 'Unmatched agreement keys');
188
+
189
+ for (let i = 0; i < 256; i++) {
190
+ const [, pk1, sk1] = randomPair(wasm);
191
+ const [, pk2, sk2] = randomPair(wasm);
192
+
193
+ assert(u8aToHex(wasm.sr25519Agree(pk1, sk2)) === u8aToHex(wasm.sr25519Agree(pk2, sk1)), 'Unmatched agreement keys');
194
+ }
195
+ });
196
+ }
197
+
198
+ /**
199
+ * @param {*} wasm
200
+ */
201
+ export function sr25519Benchmark (wasm) {
202
+ it('runs a verification benchmark', () => {
203
+ const MESSAGE = stringToU8a('this is a message');
204
+
205
+ for (let i = 0; i < 256; i++) {
206
+ const [, pk, sk] = randomPair(wasm);
207
+
208
+ assert(wasm.sr25519Verify(wasm.sr25519Sign(pk, sk, MESSAGE), MESSAGE, pk), 'ERROR: Unable to verify signature');
209
+ }
210
+ });
211
+ }
@@ -0,0 +1,74 @@
1
+ // Copyright 2019-2026 @pezkuwi/wasm-crypto authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* global it */
5
+
6
+ import crypto from 'crypto';
7
+
8
+ import { assert, stringToU8a, u8aToHex } from '@pezkuwi/util';
9
+
10
+ /**
11
+ * @internal
12
+ * @param {*} pair
13
+ */
14
+ function extractKeys (pair) {
15
+ return [pair, pair.slice(64), pair.slice(0, 64)];
16
+ }
17
+
18
+ /**
19
+ * @internal
20
+ * @param {*} wasm
21
+ */
22
+ function randomPair (wasm) {
23
+ return extractKeys(wasm.sr25519KeypairFromSeed(crypto.randomBytes(32)));
24
+ }
25
+
26
+ /**
27
+ * @param {*} wasm
28
+ */
29
+ export function vrfSignAndVerifyCompat (wasm) {
30
+ it('can sign and verify (1)', () => {
31
+ const [, pk, sk] = randomPair(wasm);
32
+ const outAndProof = wasm.vrfSign(sk, stringToU8a('my VRF context'), stringToU8a('this is a message'), new Uint8Array());
33
+ const isValid = wasm.vrfVerify(pk, stringToU8a('my VRF context'), stringToU8a('this is a message'), new Uint8Array(), outAndProof);
34
+
35
+ // console.log('\tVRF', u8aToHex(outAndProof));
36
+ // console.log('\tRES', isValid);
37
+
38
+ assert(isValid, 'ERROR: Unable to verify VRF output & proof');
39
+ });
40
+ }
41
+
42
+ /**
43
+ * @param {*} wasm
44
+ */
45
+ export function vrfSignAndVerify (wasm) {
46
+ it('can sign and verify (2)', () => {
47
+ const [, pk, sk] = randomPair(wasm);
48
+ const outAndProof = wasm.vrfSign(sk, stringToU8a('my VRF context'), stringToU8a('this is a message'), stringToU8a('extra param'));
49
+ const isValid = wasm.vrfVerify(pk, stringToU8a('my VRF context'), stringToU8a('this is a message'), stringToU8a('extra param'), outAndProof);
50
+
51
+ // console.log('\tVRF', u8aToHex(outAndProof));
52
+ // console.log('\tRES', isValid);
53
+
54
+ assert(isValid, 'ERROR: Unable to verify VRF extra output & proof');
55
+ });
56
+ }
57
+
58
+ /**
59
+ * @param {*} wasm
60
+ */
61
+ export function vrfSignAndVerifyDeterministic (wasm) {
62
+ it('has non-deterministic outputs', () => {
63
+ const [,, sk] = randomPair(wasm);
64
+ const outAndProof1 = wasm.vrfSign(sk, stringToU8a('my VRF context'), stringToU8a('this is a message'), stringToU8a('extra param'));
65
+ const outAndProof2 = wasm.vrfSign(sk, stringToU8a('my VRF context'), stringToU8a('this is a message'), stringToU8a('extra param'));
66
+ const sig1 = u8aToHex(outAndProof1.slice(0, 32));
67
+ const sig2 = u8aToHex(outAndProof2.slice(0, 32));
68
+
69
+ // console.log('\tSG1', sig1);
70
+ // console.log('\tSG2', sig2);
71
+
72
+ assert(sig1 === sig2, 'ERROR: VRF extra outputs are non-deterministic');
73
+ });
74
+ }
package/test/asm.js ADDED
@@ -0,0 +1,10 @@
1
+ // Copyright 2019-2026 @pezkuwi/wasm-crypto authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import '@pezkuwi/wasm-crypto/initOnlyAsm';
5
+
6
+ import * as wasm from '@pezkuwi/wasm-crypto';
7
+
8
+ import { runUnassisted } from './all/index.js';
9
+
10
+ runUnassisted('ASM', wasm);
package/test/deno.ts ADDED
@@ -0,0 +1,37 @@
1
+ // Copyright 2019-2026 @pezkuwi/wasm-crypto authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ // This is a Deno file, so we can allow .ts imports
5
+ /* eslint-disable import/extensions */
6
+
7
+ // NOTE We don't use ts-expect-error here since the build folder may or may
8
+ // not exist (so the error may or may not be there)
9
+ //
10
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
11
+ // @ts-ignore This should only run against the compiled ouput, where this should exist
12
+ import * as wasm from '../build-deno/mod.ts';
13
+ import { initRun, tests } from './all/index.js';
14
+
15
+ type Tests = Record<string, (wasm: unknown) => void>;
16
+
17
+ declare const globalThis: {
18
+ it: (name: string, fn: () => void) => unknown;
19
+ };
20
+ declare const Deno: {
21
+ test: (name: string, test: () => unknown) => unknown;
22
+ };
23
+
24
+ await initRun('wasm', wasm);
25
+
26
+ // We use it to denote the tests
27
+ globalThis.it = (name: string, fn: () => void) => Deno.test(name, () => fn());
28
+
29
+ Object
30
+ .entries<Tests>(tests)
31
+ .forEach(([describeName, tests]) => {
32
+ console.log('***', describeName);
33
+
34
+ Object
35
+ .values(tests)
36
+ .forEach((test) => test(wasm));
37
+ });
@@ -0,0 +1,24 @@
1
+ // Copyright 2019-2026 @pezkuwi/wasm-crypto authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /// <reference types="@pezkuwi/dev-test/globals.d.ts" />
5
+
6
+ // NOTE We don't use ts-expect-error here since the build folder may or may
7
+ // not exist (so the error may or may not be there)
8
+ //
9
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
+ // @ts-ignore This should only run against the compiled ouput, where this should exist
11
+ import * as wasm from '../build/index.js';
12
+ import { initRun, tests } from './all/index.js';
13
+
14
+ describe('wasm-crypto', (): void => {
15
+ beforeAll(() => initRun('wasm', wasm));
16
+
17
+ for (const name of Object.keys(tests)) {
18
+ describe(`${name}`, (): void => {
19
+ Object
20
+ .values<(wasm: unknown) => void>(tests[name as keyof typeof tests])
21
+ .forEach((fn) => fn(wasm));
22
+ });
23
+ }
24
+ });
@@ -0,0 +1,39 @@
1
+ // Copyright 2019-2026 @pezkuwi/wasm-crypto authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import path from 'node:path';
5
+ import process from 'node:process';
6
+ import { pathToFileURL } from 'node:url';
7
+
8
+ /**
9
+ * Adjusts the resolver to point to the build output
10
+ *
11
+ * @param {*} specifier
12
+ * @param {*} context
13
+ * @param {*} nextResolve
14
+ * @returns {*}
15
+ */
16
+ export function resolve (specifier, context, nextResolve) {
17
+ if (specifier.startsWith('@pezkuwi/wasm-')) {
18
+ const parts = specifier.split(/[\\/]/);
19
+
20
+ return {
21
+ format: 'module',
22
+ shortCircuit: true,
23
+ url: pathToFileURL(
24
+ path.join(
25
+ process.cwd(),
26
+ ['packages', parts[1], 'build', ...parts.slice(2)]
27
+ .join('/')
28
+ .replace(/\/wasm-crypto-init\/build$/, '/wasm-crypto-init/build/wasm.js')
29
+ .replace(/\/wasm-crypto-init\/build\/asm$/, '/wasm-crypto-init/build/asm.js')
30
+ .replace(/\/wasm-crypto\/build\/initOnlyAsm$/, '/wasm-crypto/build/initOnlyAsm.js')
31
+ .replace(/\/build\/packageInfo$/, '/build/packageInfo.js')
32
+ .replace(/\/build$/, '/build/index.js')
33
+ )
34
+ ).href
35
+ };
36
+ }
37
+
38
+ return nextResolve(specifier, context);
39
+ }
package/test/wasm.js ADDED
@@ -0,0 +1,8 @@
1
+ // Copyright 2019-2026 @pezkuwi/wasm-crypto authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import * as wasm from '@pezkuwi/wasm-crypto';
5
+
6
+ import { runUnassisted } from './all/index.js';
7
+
8
+ runUnassisted('WASM', wasm);
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "baseUrl": "..",
5
+ "outDir": "./build",
6
+ "rootDir": "./src"
7
+ },
8
+ "exclude": [
9
+ "**/mod.ts",
10
+ "**/test/**/*"
11
+ ],
12
+ "references": [
13
+ { "path": "../wasm-bridge/tsconfig.build.json" },
14
+ { "path": "../wasm-crypto-init/tsconfig.build.json" },
15
+ { "path": "../wasm-crypto-asmjs/tsconfig.build.json" },
16
+ { "path": "../wasm-crypto-wasm/tsconfig.build.json" },
17
+ { "path": "../wasm-util/tsconfig.build.json" }
18
+ ]
19
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "baseUrl": "..",
5
+ "outDir": "./build",
6
+ "rootDir": "./test",
7
+ "emitDeclarationOnly": false,
8
+ "noEmit": true
9
+ },
10
+ "include": [
11
+ "**/test/**/*"
12
+ ],
13
+ "references": [
14
+ { "path": "../wasm-crypto/tsconfig.build.json" }
15
+ ]
16
+ }
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.