@cathaysia/crown-wasm 0.24.1 → 0.25.0
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/crown_wasm.d.ts +23 -0
- package/crown_wasm_bg.js +349 -0
- package/crown_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/crown_wasm.d.ts
CHANGED
|
@@ -6,68 +6,91 @@ export class AeadCipher {
|
|
|
6
6
|
[Symbol.dispose](): void;
|
|
7
7
|
nonce_size(): number;
|
|
8
8
|
static new_aes_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
9
|
+
static new_aes_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
9
10
|
static new_aes_gcm(key: Uint8Array): AeadCipher;
|
|
10
11
|
static new_des_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
12
|
+
static new_des_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
11
13
|
static new_des_gcm(key: Uint8Array): AeadCipher;
|
|
12
14
|
static new_rc2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
15
|
+
static new_rc2_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
13
16
|
static new_rc2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
14
17
|
static new_rc5_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
18
|
+
static new_rc5_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
15
19
|
static new_rc5_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
16
20
|
static new_rc6_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
21
|
+
static new_rc6_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
17
22
|
static new_rc6_gcm(key: Uint8Array): AeadCipher;
|
|
18
23
|
static new_sm4_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
24
|
+
static new_sm4_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
19
25
|
static new_sm4_gcm(key: Uint8Array): AeadCipher;
|
|
20
26
|
static new_tea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
27
|
+
static new_tea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
21
28
|
static new_tea_gcm(key: Uint8Array): AeadCipher;
|
|
22
29
|
static new_aes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
23
30
|
static new_aria_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
31
|
+
static new_aria_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
24
32
|
static new_aria_gcm(key: Uint8Array): AeadCipher;
|
|
25
33
|
static new_des_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
26
34
|
static new_idea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
35
|
+
static new_idea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
27
36
|
static new_idea_gcm(key: Uint8Array): AeadCipher;
|
|
28
37
|
static new_rc6_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
29
38
|
static new_sm4_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
30
39
|
static new_tea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
31
40
|
static new_xtea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
41
|
+
static new_xtea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
32
42
|
static new_xtea_gcm(key: Uint8Array): AeadCipher;
|
|
33
43
|
static new_aria_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
34
44
|
static new_cast5_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
45
|
+
static new_cast5_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
35
46
|
static new_cast5_gcm(key: Uint8Array): AeadCipher;
|
|
36
47
|
static new_idea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
37
48
|
static new_kseed_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
49
|
+
static new_kseed_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
38
50
|
static new_kseed_gcm(key: Uint8Array): AeadCipher;
|
|
39
51
|
static new_xtea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
40
52
|
static new_anubis_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
53
|
+
static new_anubis_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
41
54
|
static new_anubis_gcm(key: Uint8Array): AeadCipher;
|
|
42
55
|
static new_cast5_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
43
56
|
static new_kasumi_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
57
|
+
static new_kasumi_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
44
58
|
static new_kasumi_gcm(key: Uint8Array): AeadCipher;
|
|
45
59
|
static new_khazad_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
60
|
+
static new_khazad_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
46
61
|
static new_khazad_gcm(key: Uint8Array): AeadCipher;
|
|
47
62
|
static new_kseed_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
48
63
|
static new_multi2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
64
|
+
static new_multi2_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
49
65
|
static new_multi2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
50
66
|
static new_anubis_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
51
67
|
static new_kasumi_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
52
68
|
static new_khazad_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
53
69
|
static new_noekeon_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
70
|
+
static new_noekeon_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
54
71
|
static new_noekeon_gcm(key: Uint8Array): AeadCipher;
|
|
55
72
|
static new_serpent_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
73
|
+
static new_serpent_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
56
74
|
static new_serpent_gcm(key: Uint8Array): AeadCipher;
|
|
57
75
|
static new_twofish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
76
|
+
static new_twofish_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
58
77
|
static new_twofish_gcm(key: Uint8Array): AeadCipher;
|
|
59
78
|
static new_blowfish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
79
|
+
static new_blowfish_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
60
80
|
static new_blowfish_gcm(key: Uint8Array): AeadCipher;
|
|
61
81
|
static new_camellia_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
82
|
+
static new_camellia_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
62
83
|
static new_camellia_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
63
84
|
static new_noekeon_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
64
85
|
static new_serpent_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
65
86
|
static new_skipjack_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
87
|
+
static new_skipjack_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
66
88
|
static new_skipjack_gcm(key: Uint8Array): AeadCipher;
|
|
67
89
|
static new_twofish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
68
90
|
static new_blowfish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
69
91
|
static new_skipjack_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
70
92
|
static new_tripledes_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
93
|
+
static new_tripledes_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
71
94
|
static new_tripledes_gcm(key: Uint8Array): AeadCipher;
|
|
72
95
|
static new_tripledes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
73
96
|
static new_chacha20_poly1305(key: Uint8Array): AeadCipher;
|
package/crown_wasm_bg.js
CHANGED
|
@@ -105,6 +105,21 @@ export class AeadCipher {
|
|
|
105
105
|
}
|
|
106
106
|
return AeadCipher.__wrap(ret[0]);
|
|
107
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* @param {Uint8Array} key
|
|
110
|
+
* @param {number} tag_size
|
|
111
|
+
* @param {number} nonce_size
|
|
112
|
+
* @returns {AeadCipher}
|
|
113
|
+
*/
|
|
114
|
+
static new_aes_eax(key, tag_size, nonce_size) {
|
|
115
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
116
|
+
const len0 = WASM_VECTOR_LEN;
|
|
117
|
+
const ret = wasm.aeadcipher_new_aes_eax(ptr0, len0, tag_size, nonce_size);
|
|
118
|
+
if (ret[2]) {
|
|
119
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
120
|
+
}
|
|
121
|
+
return AeadCipher.__wrap(ret[0]);
|
|
122
|
+
}
|
|
108
123
|
/**
|
|
109
124
|
* @param {Uint8Array} key
|
|
110
125
|
* @returns {AeadCipher}
|
|
@@ -133,6 +148,21 @@ export class AeadCipher {
|
|
|
133
148
|
}
|
|
134
149
|
return AeadCipher.__wrap(ret[0]);
|
|
135
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* @param {Uint8Array} key
|
|
153
|
+
* @param {number} tag_size
|
|
154
|
+
* @param {number} nonce_size
|
|
155
|
+
* @returns {AeadCipher}
|
|
156
|
+
*/
|
|
157
|
+
static new_des_eax(key, tag_size, nonce_size) {
|
|
158
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
159
|
+
const len0 = WASM_VECTOR_LEN;
|
|
160
|
+
const ret = wasm.aeadcipher_new_des_eax(ptr0, len0, tag_size, nonce_size);
|
|
161
|
+
if (ret[2]) {
|
|
162
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
163
|
+
}
|
|
164
|
+
return AeadCipher.__wrap(ret[0]);
|
|
165
|
+
}
|
|
136
166
|
/**
|
|
137
167
|
* @param {Uint8Array} key
|
|
138
168
|
* @returns {AeadCipher}
|
|
@@ -162,6 +192,22 @@ export class AeadCipher {
|
|
|
162
192
|
}
|
|
163
193
|
return AeadCipher.__wrap(ret[0]);
|
|
164
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* @param {Uint8Array} key
|
|
197
|
+
* @param {number} tag_size
|
|
198
|
+
* @param {number} nonce_size
|
|
199
|
+
* @param {number | null} [rounds]
|
|
200
|
+
* @returns {AeadCipher}
|
|
201
|
+
*/
|
|
202
|
+
static new_rc2_eax(key, tag_size, nonce_size, rounds) {
|
|
203
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
204
|
+
const len0 = WASM_VECTOR_LEN;
|
|
205
|
+
const ret = wasm.aeadcipher_new_rc2_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
206
|
+
if (ret[2]) {
|
|
207
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
208
|
+
}
|
|
209
|
+
return AeadCipher.__wrap(ret[0]);
|
|
210
|
+
}
|
|
165
211
|
/**
|
|
166
212
|
* @param {Uint8Array} key
|
|
167
213
|
* @param {number | null} [rounds]
|
|
@@ -192,6 +238,22 @@ export class AeadCipher {
|
|
|
192
238
|
}
|
|
193
239
|
return AeadCipher.__wrap(ret[0]);
|
|
194
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* @param {Uint8Array} key
|
|
243
|
+
* @param {number} tag_size
|
|
244
|
+
* @param {number} nonce_size
|
|
245
|
+
* @param {number | null} [rounds]
|
|
246
|
+
* @returns {AeadCipher}
|
|
247
|
+
*/
|
|
248
|
+
static new_rc5_eax(key, tag_size, nonce_size, rounds) {
|
|
249
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
250
|
+
const len0 = WASM_VECTOR_LEN;
|
|
251
|
+
const ret = wasm.aeadcipher_new_rc5_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
252
|
+
if (ret[2]) {
|
|
253
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
254
|
+
}
|
|
255
|
+
return AeadCipher.__wrap(ret[0]);
|
|
256
|
+
}
|
|
195
257
|
/**
|
|
196
258
|
* @param {Uint8Array} key
|
|
197
259
|
* @param {number | null} [rounds]
|
|
@@ -221,6 +283,21 @@ export class AeadCipher {
|
|
|
221
283
|
}
|
|
222
284
|
return AeadCipher.__wrap(ret[0]);
|
|
223
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* @param {Uint8Array} key
|
|
288
|
+
* @param {number} tag_size
|
|
289
|
+
* @param {number} nonce_size
|
|
290
|
+
* @returns {AeadCipher}
|
|
291
|
+
*/
|
|
292
|
+
static new_rc6_eax(key, tag_size, nonce_size) {
|
|
293
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
294
|
+
const len0 = WASM_VECTOR_LEN;
|
|
295
|
+
const ret = wasm.aeadcipher_new_rc6_eax(ptr0, len0, tag_size, nonce_size);
|
|
296
|
+
if (ret[2]) {
|
|
297
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
298
|
+
}
|
|
299
|
+
return AeadCipher.__wrap(ret[0]);
|
|
300
|
+
}
|
|
224
301
|
/**
|
|
225
302
|
* @param {Uint8Array} key
|
|
226
303
|
* @returns {AeadCipher}
|
|
@@ -249,6 +326,21 @@ export class AeadCipher {
|
|
|
249
326
|
}
|
|
250
327
|
return AeadCipher.__wrap(ret[0]);
|
|
251
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* @param {Uint8Array} key
|
|
331
|
+
* @param {number} tag_size
|
|
332
|
+
* @param {number} nonce_size
|
|
333
|
+
* @returns {AeadCipher}
|
|
334
|
+
*/
|
|
335
|
+
static new_sm4_eax(key, tag_size, nonce_size) {
|
|
336
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
337
|
+
const len0 = WASM_VECTOR_LEN;
|
|
338
|
+
const ret = wasm.aeadcipher_new_sm4_eax(ptr0, len0, tag_size, nonce_size);
|
|
339
|
+
if (ret[2]) {
|
|
340
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
341
|
+
}
|
|
342
|
+
return AeadCipher.__wrap(ret[0]);
|
|
343
|
+
}
|
|
252
344
|
/**
|
|
253
345
|
* @param {Uint8Array} key
|
|
254
346
|
* @returns {AeadCipher}
|
|
@@ -277,6 +369,21 @@ export class AeadCipher {
|
|
|
277
369
|
}
|
|
278
370
|
return AeadCipher.__wrap(ret[0]);
|
|
279
371
|
}
|
|
372
|
+
/**
|
|
373
|
+
* @param {Uint8Array} key
|
|
374
|
+
* @param {number} tag_size
|
|
375
|
+
* @param {number} nonce_size
|
|
376
|
+
* @returns {AeadCipher}
|
|
377
|
+
*/
|
|
378
|
+
static new_tea_eax(key, tag_size, nonce_size) {
|
|
379
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
380
|
+
const len0 = WASM_VECTOR_LEN;
|
|
381
|
+
const ret = wasm.aeadcipher_new_tea_eax(ptr0, len0, tag_size, nonce_size);
|
|
382
|
+
if (ret[2]) {
|
|
383
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
384
|
+
}
|
|
385
|
+
return AeadCipher.__wrap(ret[0]);
|
|
386
|
+
}
|
|
280
387
|
/**
|
|
281
388
|
* @param {Uint8Array} key
|
|
282
389
|
* @returns {AeadCipher}
|
|
@@ -320,6 +427,21 @@ export class AeadCipher {
|
|
|
320
427
|
}
|
|
321
428
|
return AeadCipher.__wrap(ret[0]);
|
|
322
429
|
}
|
|
430
|
+
/**
|
|
431
|
+
* @param {Uint8Array} key
|
|
432
|
+
* @param {number} tag_size
|
|
433
|
+
* @param {number} nonce_size
|
|
434
|
+
* @returns {AeadCipher}
|
|
435
|
+
*/
|
|
436
|
+
static new_aria_eax(key, tag_size, nonce_size) {
|
|
437
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
438
|
+
const len0 = WASM_VECTOR_LEN;
|
|
439
|
+
const ret = wasm.aeadcipher_new_aria_eax(ptr0, len0, tag_size, nonce_size);
|
|
440
|
+
if (ret[2]) {
|
|
441
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
442
|
+
}
|
|
443
|
+
return AeadCipher.__wrap(ret[0]);
|
|
444
|
+
}
|
|
323
445
|
/**
|
|
324
446
|
* @param {Uint8Array} key
|
|
325
447
|
* @returns {AeadCipher}
|
|
@@ -363,6 +485,21 @@ export class AeadCipher {
|
|
|
363
485
|
}
|
|
364
486
|
return AeadCipher.__wrap(ret[0]);
|
|
365
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* @param {Uint8Array} key
|
|
490
|
+
* @param {number} tag_size
|
|
491
|
+
* @param {number} nonce_size
|
|
492
|
+
* @returns {AeadCipher}
|
|
493
|
+
*/
|
|
494
|
+
static new_idea_eax(key, tag_size, nonce_size) {
|
|
495
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
496
|
+
const len0 = WASM_VECTOR_LEN;
|
|
497
|
+
const ret = wasm.aeadcipher_new_idea_eax(ptr0, len0, tag_size, nonce_size);
|
|
498
|
+
if (ret[2]) {
|
|
499
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
500
|
+
}
|
|
501
|
+
return AeadCipher.__wrap(ret[0]);
|
|
502
|
+
}
|
|
366
503
|
/**
|
|
367
504
|
* @param {Uint8Array} key
|
|
368
505
|
* @returns {AeadCipher}
|
|
@@ -436,6 +573,21 @@ export class AeadCipher {
|
|
|
436
573
|
}
|
|
437
574
|
return AeadCipher.__wrap(ret[0]);
|
|
438
575
|
}
|
|
576
|
+
/**
|
|
577
|
+
* @param {Uint8Array} key
|
|
578
|
+
* @param {number} tag_size
|
|
579
|
+
* @param {number} nonce_size
|
|
580
|
+
* @returns {AeadCipher}
|
|
581
|
+
*/
|
|
582
|
+
static new_xtea_eax(key, tag_size, nonce_size) {
|
|
583
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
584
|
+
const len0 = WASM_VECTOR_LEN;
|
|
585
|
+
const ret = wasm.aeadcipher_new_xtea_eax(ptr0, len0, tag_size, nonce_size);
|
|
586
|
+
if (ret[2]) {
|
|
587
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
588
|
+
}
|
|
589
|
+
return AeadCipher.__wrap(ret[0]);
|
|
590
|
+
}
|
|
439
591
|
/**
|
|
440
592
|
* @param {Uint8Array} key
|
|
441
593
|
* @returns {AeadCipher}
|
|
@@ -479,6 +631,21 @@ export class AeadCipher {
|
|
|
479
631
|
}
|
|
480
632
|
return AeadCipher.__wrap(ret[0]);
|
|
481
633
|
}
|
|
634
|
+
/**
|
|
635
|
+
* @param {Uint8Array} key
|
|
636
|
+
* @param {number} tag_size
|
|
637
|
+
* @param {number} nonce_size
|
|
638
|
+
* @returns {AeadCipher}
|
|
639
|
+
*/
|
|
640
|
+
static new_cast5_eax(key, tag_size, nonce_size) {
|
|
641
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
642
|
+
const len0 = WASM_VECTOR_LEN;
|
|
643
|
+
const ret = wasm.aeadcipher_new_cast5_eax(ptr0, len0, tag_size, nonce_size);
|
|
644
|
+
if (ret[2]) {
|
|
645
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
646
|
+
}
|
|
647
|
+
return AeadCipher.__wrap(ret[0]);
|
|
648
|
+
}
|
|
482
649
|
/**
|
|
483
650
|
* @param {Uint8Array} key
|
|
484
651
|
* @returns {AeadCipher}
|
|
@@ -522,6 +689,21 @@ export class AeadCipher {
|
|
|
522
689
|
}
|
|
523
690
|
return AeadCipher.__wrap(ret[0]);
|
|
524
691
|
}
|
|
692
|
+
/**
|
|
693
|
+
* @param {Uint8Array} key
|
|
694
|
+
* @param {number} tag_size
|
|
695
|
+
* @param {number} nonce_size
|
|
696
|
+
* @returns {AeadCipher}
|
|
697
|
+
*/
|
|
698
|
+
static new_kseed_eax(key, tag_size, nonce_size) {
|
|
699
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
700
|
+
const len0 = WASM_VECTOR_LEN;
|
|
701
|
+
const ret = wasm.aeadcipher_new_kseed_eax(ptr0, len0, tag_size, nonce_size);
|
|
702
|
+
if (ret[2]) {
|
|
703
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
704
|
+
}
|
|
705
|
+
return AeadCipher.__wrap(ret[0]);
|
|
706
|
+
}
|
|
525
707
|
/**
|
|
526
708
|
* @param {Uint8Array} key
|
|
527
709
|
* @returns {AeadCipher}
|
|
@@ -565,6 +747,21 @@ export class AeadCipher {
|
|
|
565
747
|
}
|
|
566
748
|
return AeadCipher.__wrap(ret[0]);
|
|
567
749
|
}
|
|
750
|
+
/**
|
|
751
|
+
* @param {Uint8Array} key
|
|
752
|
+
* @param {number} tag_size
|
|
753
|
+
* @param {number} nonce_size
|
|
754
|
+
* @returns {AeadCipher}
|
|
755
|
+
*/
|
|
756
|
+
static new_anubis_eax(key, tag_size, nonce_size) {
|
|
757
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
758
|
+
const len0 = WASM_VECTOR_LEN;
|
|
759
|
+
const ret = wasm.aeadcipher_new_anubis_eax(ptr0, len0, tag_size, nonce_size);
|
|
760
|
+
if (ret[2]) {
|
|
761
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
762
|
+
}
|
|
763
|
+
return AeadCipher.__wrap(ret[0]);
|
|
764
|
+
}
|
|
568
765
|
/**
|
|
569
766
|
* @param {Uint8Array} key
|
|
570
767
|
* @returns {AeadCipher}
|
|
@@ -608,6 +805,21 @@ export class AeadCipher {
|
|
|
608
805
|
}
|
|
609
806
|
return AeadCipher.__wrap(ret[0]);
|
|
610
807
|
}
|
|
808
|
+
/**
|
|
809
|
+
* @param {Uint8Array} key
|
|
810
|
+
* @param {number} tag_size
|
|
811
|
+
* @param {number} nonce_size
|
|
812
|
+
* @returns {AeadCipher}
|
|
813
|
+
*/
|
|
814
|
+
static new_kasumi_eax(key, tag_size, nonce_size) {
|
|
815
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
816
|
+
const len0 = WASM_VECTOR_LEN;
|
|
817
|
+
const ret = wasm.aeadcipher_new_kasumi_eax(ptr0, len0, tag_size, nonce_size);
|
|
818
|
+
if (ret[2]) {
|
|
819
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
820
|
+
}
|
|
821
|
+
return AeadCipher.__wrap(ret[0]);
|
|
822
|
+
}
|
|
611
823
|
/**
|
|
612
824
|
* @param {Uint8Array} key
|
|
613
825
|
* @returns {AeadCipher}
|
|
@@ -636,6 +848,21 @@ export class AeadCipher {
|
|
|
636
848
|
}
|
|
637
849
|
return AeadCipher.__wrap(ret[0]);
|
|
638
850
|
}
|
|
851
|
+
/**
|
|
852
|
+
* @param {Uint8Array} key
|
|
853
|
+
* @param {number} tag_size
|
|
854
|
+
* @param {number} nonce_size
|
|
855
|
+
* @returns {AeadCipher}
|
|
856
|
+
*/
|
|
857
|
+
static new_khazad_eax(key, tag_size, nonce_size) {
|
|
858
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
859
|
+
const len0 = WASM_VECTOR_LEN;
|
|
860
|
+
const ret = wasm.aeadcipher_new_khazad_eax(ptr0, len0, tag_size, nonce_size);
|
|
861
|
+
if (ret[2]) {
|
|
862
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
863
|
+
}
|
|
864
|
+
return AeadCipher.__wrap(ret[0]);
|
|
865
|
+
}
|
|
639
866
|
/**
|
|
640
867
|
* @param {Uint8Array} key
|
|
641
868
|
* @returns {AeadCipher}
|
|
@@ -680,6 +907,22 @@ export class AeadCipher {
|
|
|
680
907
|
}
|
|
681
908
|
return AeadCipher.__wrap(ret[0]);
|
|
682
909
|
}
|
|
910
|
+
/**
|
|
911
|
+
* @param {Uint8Array} key
|
|
912
|
+
* @param {number} tag_size
|
|
913
|
+
* @param {number} nonce_size
|
|
914
|
+
* @param {number | null} [rounds]
|
|
915
|
+
* @returns {AeadCipher}
|
|
916
|
+
*/
|
|
917
|
+
static new_multi2_eax(key, tag_size, nonce_size, rounds) {
|
|
918
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
919
|
+
const len0 = WASM_VECTOR_LEN;
|
|
920
|
+
const ret = wasm.aeadcipher_new_multi2_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
921
|
+
if (ret[2]) {
|
|
922
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
923
|
+
}
|
|
924
|
+
return AeadCipher.__wrap(ret[0]);
|
|
925
|
+
}
|
|
683
926
|
/**
|
|
684
927
|
* @param {Uint8Array} key
|
|
685
928
|
* @param {number | null} [rounds]
|
|
@@ -754,6 +997,21 @@ export class AeadCipher {
|
|
|
754
997
|
}
|
|
755
998
|
return AeadCipher.__wrap(ret[0]);
|
|
756
999
|
}
|
|
1000
|
+
/**
|
|
1001
|
+
* @param {Uint8Array} key
|
|
1002
|
+
* @param {number} tag_size
|
|
1003
|
+
* @param {number} nonce_size
|
|
1004
|
+
* @returns {AeadCipher}
|
|
1005
|
+
*/
|
|
1006
|
+
static new_noekeon_eax(key, tag_size, nonce_size) {
|
|
1007
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1008
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1009
|
+
const ret = wasm.aeadcipher_new_noekeon_eax(ptr0, len0, tag_size, nonce_size);
|
|
1010
|
+
if (ret[2]) {
|
|
1011
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1012
|
+
}
|
|
1013
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1014
|
+
}
|
|
757
1015
|
/**
|
|
758
1016
|
* @param {Uint8Array} key
|
|
759
1017
|
* @returns {AeadCipher}
|
|
@@ -782,6 +1040,21 @@ export class AeadCipher {
|
|
|
782
1040
|
}
|
|
783
1041
|
return AeadCipher.__wrap(ret[0]);
|
|
784
1042
|
}
|
|
1043
|
+
/**
|
|
1044
|
+
* @param {Uint8Array} key
|
|
1045
|
+
* @param {number} tag_size
|
|
1046
|
+
* @param {number} nonce_size
|
|
1047
|
+
* @returns {AeadCipher}
|
|
1048
|
+
*/
|
|
1049
|
+
static new_serpent_eax(key, tag_size, nonce_size) {
|
|
1050
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1051
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1052
|
+
const ret = wasm.aeadcipher_new_serpent_eax(ptr0, len0, tag_size, nonce_size);
|
|
1053
|
+
if (ret[2]) {
|
|
1054
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1055
|
+
}
|
|
1056
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1057
|
+
}
|
|
785
1058
|
/**
|
|
786
1059
|
* @param {Uint8Array} key
|
|
787
1060
|
* @returns {AeadCipher}
|
|
@@ -810,6 +1083,21 @@ export class AeadCipher {
|
|
|
810
1083
|
}
|
|
811
1084
|
return AeadCipher.__wrap(ret[0]);
|
|
812
1085
|
}
|
|
1086
|
+
/**
|
|
1087
|
+
* @param {Uint8Array} key
|
|
1088
|
+
* @param {number} tag_size
|
|
1089
|
+
* @param {number} nonce_size
|
|
1090
|
+
* @returns {AeadCipher}
|
|
1091
|
+
*/
|
|
1092
|
+
static new_twofish_eax(key, tag_size, nonce_size) {
|
|
1093
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1094
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1095
|
+
const ret = wasm.aeadcipher_new_twofish_eax(ptr0, len0, tag_size, nonce_size);
|
|
1096
|
+
if (ret[2]) {
|
|
1097
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1098
|
+
}
|
|
1099
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1100
|
+
}
|
|
813
1101
|
/**
|
|
814
1102
|
* @param {Uint8Array} key
|
|
815
1103
|
* @returns {AeadCipher}
|
|
@@ -838,6 +1126,21 @@ export class AeadCipher {
|
|
|
838
1126
|
}
|
|
839
1127
|
return AeadCipher.__wrap(ret[0]);
|
|
840
1128
|
}
|
|
1129
|
+
/**
|
|
1130
|
+
* @param {Uint8Array} key
|
|
1131
|
+
* @param {number} tag_size
|
|
1132
|
+
* @param {number} nonce_size
|
|
1133
|
+
* @returns {AeadCipher}
|
|
1134
|
+
*/
|
|
1135
|
+
static new_blowfish_eax(key, tag_size, nonce_size) {
|
|
1136
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1137
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1138
|
+
const ret = wasm.aeadcipher_new_blowfish_eax(ptr0, len0, tag_size, nonce_size);
|
|
1139
|
+
if (ret[2]) {
|
|
1140
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1141
|
+
}
|
|
1142
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1143
|
+
}
|
|
841
1144
|
/**
|
|
842
1145
|
* @param {Uint8Array} key
|
|
843
1146
|
* @returns {AeadCipher}
|
|
@@ -867,6 +1170,22 @@ export class AeadCipher {
|
|
|
867
1170
|
}
|
|
868
1171
|
return AeadCipher.__wrap(ret[0]);
|
|
869
1172
|
}
|
|
1173
|
+
/**
|
|
1174
|
+
* @param {Uint8Array} key
|
|
1175
|
+
* @param {number} tag_size
|
|
1176
|
+
* @param {number} nonce_size
|
|
1177
|
+
* @param {number | null} [rounds]
|
|
1178
|
+
* @returns {AeadCipher}
|
|
1179
|
+
*/
|
|
1180
|
+
static new_camellia_eax(key, tag_size, nonce_size, rounds) {
|
|
1181
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1182
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1183
|
+
const ret = wasm.aeadcipher_new_camellia_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1184
|
+
if (ret[2]) {
|
|
1185
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1186
|
+
}
|
|
1187
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1188
|
+
}
|
|
870
1189
|
/**
|
|
871
1190
|
* @param {Uint8Array} key
|
|
872
1191
|
* @param {number | null} [rounds]
|
|
@@ -926,6 +1245,21 @@ export class AeadCipher {
|
|
|
926
1245
|
}
|
|
927
1246
|
return AeadCipher.__wrap(ret[0]);
|
|
928
1247
|
}
|
|
1248
|
+
/**
|
|
1249
|
+
* @param {Uint8Array} key
|
|
1250
|
+
* @param {number} tag_size
|
|
1251
|
+
* @param {number} nonce_size
|
|
1252
|
+
* @returns {AeadCipher}
|
|
1253
|
+
*/
|
|
1254
|
+
static new_skipjack_eax(key, tag_size, nonce_size) {
|
|
1255
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1257
|
+
const ret = wasm.aeadcipher_new_skipjack_eax(ptr0, len0, tag_size, nonce_size);
|
|
1258
|
+
if (ret[2]) {
|
|
1259
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1260
|
+
}
|
|
1261
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1262
|
+
}
|
|
929
1263
|
/**
|
|
930
1264
|
* @param {Uint8Array} key
|
|
931
1265
|
* @returns {AeadCipher}
|
|
@@ -999,6 +1333,21 @@ export class AeadCipher {
|
|
|
999
1333
|
}
|
|
1000
1334
|
return AeadCipher.__wrap(ret[0]);
|
|
1001
1335
|
}
|
|
1336
|
+
/**
|
|
1337
|
+
* @param {Uint8Array} key
|
|
1338
|
+
* @param {number} tag_size
|
|
1339
|
+
* @param {number} nonce_size
|
|
1340
|
+
* @returns {AeadCipher}
|
|
1341
|
+
*/
|
|
1342
|
+
static new_tripledes_eax(key, tag_size, nonce_size) {
|
|
1343
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1344
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1345
|
+
const ret = wasm.aeadcipher_new_tripledes_eax(ptr0, len0, tag_size, nonce_size);
|
|
1346
|
+
if (ret[2]) {
|
|
1347
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1348
|
+
}
|
|
1349
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1350
|
+
}
|
|
1002
1351
|
/**
|
|
1003
1352
|
* @param {Uint8Array} key
|
|
1004
1353
|
* @returns {AeadCipher}
|
package/crown_wasm_bg.wasm
CHANGED
|
Binary file
|