@cathaysia/crown-wasm 0.22.0 → 0.24.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 CHANGED
@@ -5,44 +5,69 @@ export class AeadCipher {
5
5
  free(): void;
6
6
  [Symbol.dispose](): void;
7
7
  nonce_size(): number;
8
+ static new_aes_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
8
9
  static new_aes_gcm(key: Uint8Array): AeadCipher;
10
+ static new_des_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
9
11
  static new_des_gcm(key: Uint8Array): AeadCipher;
12
+ static new_rc2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
10
13
  static new_rc2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
14
+ static new_rc5_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
11
15
  static new_rc5_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
16
+ static new_rc6_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
12
17
  static new_rc6_gcm(key: Uint8Array): AeadCipher;
18
+ static new_sm4_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
13
19
  static new_sm4_gcm(key: Uint8Array): AeadCipher;
20
+ static new_tea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
14
21
  static new_tea_gcm(key: Uint8Array): AeadCipher;
15
22
  static new_aes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
23
+ static new_aria_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
24
+ static new_aria_gcm(key: Uint8Array): AeadCipher;
16
25
  static new_des_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
26
+ static new_idea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
17
27
  static new_idea_gcm(key: Uint8Array): AeadCipher;
18
28
  static new_rc6_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
19
29
  static new_sm4_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
20
30
  static new_tea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
31
+ static new_xtea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
21
32
  static new_xtea_gcm(key: Uint8Array): AeadCipher;
33
+ static new_aria_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
34
+ static new_cast5_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
22
35
  static new_cast5_gcm(key: Uint8Array): AeadCipher;
23
36
  static new_idea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
37
+ static new_kseed_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
24
38
  static new_kseed_gcm(key: Uint8Array): AeadCipher;
25
39
  static new_xtea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
40
+ static new_anubis_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
26
41
  static new_anubis_gcm(key: Uint8Array): AeadCipher;
27
42
  static new_cast5_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
43
+ static new_kasumi_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
28
44
  static new_kasumi_gcm(key: Uint8Array): AeadCipher;
45
+ static new_khazad_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
29
46
  static new_khazad_gcm(key: Uint8Array): AeadCipher;
30
47
  static new_kseed_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
48
+ static new_multi2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
31
49
  static new_multi2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
32
50
  static new_anubis_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
33
51
  static new_kasumi_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
34
52
  static new_khazad_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
53
+ static new_noekeon_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
35
54
  static new_noekeon_gcm(key: Uint8Array): AeadCipher;
55
+ static new_serpent_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
36
56
  static new_serpent_gcm(key: Uint8Array): AeadCipher;
57
+ static new_twofish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
37
58
  static new_twofish_gcm(key: Uint8Array): AeadCipher;
59
+ static new_blowfish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
38
60
  static new_blowfish_gcm(key: Uint8Array): AeadCipher;
61
+ static new_camellia_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
39
62
  static new_camellia_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
40
63
  static new_noekeon_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
41
64
  static new_serpent_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
65
+ static new_skipjack_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
42
66
  static new_skipjack_gcm(key: Uint8Array): AeadCipher;
43
67
  static new_twofish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
44
68
  static new_blowfish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
45
69
  static new_skipjack_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
70
+ static new_tripledes_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
46
71
  static new_tripledes_gcm(key: Uint8Array): AeadCipher;
47
72
  static new_tripledes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
48
73
  static new_chacha20_poly1305(key: Uint8Array): AeadCipher;
@@ -62,6 +87,7 @@ export class BlockCipher {
62
87
  static new_rc6_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
63
88
  static new_sm4_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
64
89
  static new_tea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
90
+ static new_aria_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
65
91
  static new_idea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
66
92
  static new_xtea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
67
93
  static new_cast5_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
@@ -155,6 +181,9 @@ export class StreamCipher {
155
181
  static new_tea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
156
182
  static new_tea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
157
183
  static new_tea_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
184
+ static new_aria_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
185
+ static new_aria_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
186
+ static new_aria_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
158
187
  static new_chacha20(key: Uint8Array, iv: Uint8Array): StreamCipher;
159
188
  static new_idea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
160
189
  static new_idea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
package/crown_wasm_bg.js CHANGED
@@ -90,6 +90,21 @@ export class AeadCipher {
90
90
  const ret = wasm.aeadcipher_nonce_size(this.__wbg_ptr);
91
91
  return ret >>> 0;
92
92
  }
93
+ /**
94
+ * @param {Uint8Array} key
95
+ * @param {number} tag_size
96
+ * @param {number} nonce_size
97
+ * @returns {AeadCipher}
98
+ */
99
+ static new_aes_ccm(key, tag_size, nonce_size) {
100
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
101
+ const len0 = WASM_VECTOR_LEN;
102
+ const ret = wasm.aeadcipher_new_aes_ccm(ptr0, len0, tag_size, nonce_size);
103
+ if (ret[2]) {
104
+ throw takeFromExternrefTable0(ret[1]);
105
+ }
106
+ return AeadCipher.__wrap(ret[0]);
107
+ }
93
108
  /**
94
109
  * @param {Uint8Array} key
95
110
  * @returns {AeadCipher}
@@ -103,6 +118,21 @@ export class AeadCipher {
103
118
  }
104
119
  return AeadCipher.__wrap(ret[0]);
105
120
  }
121
+ /**
122
+ * @param {Uint8Array} key
123
+ * @param {number} tag_size
124
+ * @param {number} nonce_size
125
+ * @returns {AeadCipher}
126
+ */
127
+ static new_des_ccm(key, tag_size, nonce_size) {
128
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
129
+ const len0 = WASM_VECTOR_LEN;
130
+ const ret = wasm.aeadcipher_new_des_ccm(ptr0, len0, tag_size, nonce_size);
131
+ if (ret[2]) {
132
+ throw takeFromExternrefTable0(ret[1]);
133
+ }
134
+ return AeadCipher.__wrap(ret[0]);
135
+ }
106
136
  /**
107
137
  * @param {Uint8Array} key
108
138
  * @returns {AeadCipher}
@@ -116,6 +146,22 @@ export class AeadCipher {
116
146
  }
117
147
  return AeadCipher.__wrap(ret[0]);
118
148
  }
149
+ /**
150
+ * @param {Uint8Array} key
151
+ * @param {number} tag_size
152
+ * @param {number} nonce_size
153
+ * @param {number | null} [rounds]
154
+ * @returns {AeadCipher}
155
+ */
156
+ static new_rc2_ccm(key, tag_size, nonce_size, rounds) {
157
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
158
+ const len0 = WASM_VECTOR_LEN;
159
+ const ret = wasm.aeadcipher_new_rc2_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
160
+ if (ret[2]) {
161
+ throw takeFromExternrefTable0(ret[1]);
162
+ }
163
+ return AeadCipher.__wrap(ret[0]);
164
+ }
119
165
  /**
120
166
  * @param {Uint8Array} key
121
167
  * @param {number | null} [rounds]
@@ -130,6 +176,22 @@ export class AeadCipher {
130
176
  }
131
177
  return AeadCipher.__wrap(ret[0]);
132
178
  }
179
+ /**
180
+ * @param {Uint8Array} key
181
+ * @param {number} tag_size
182
+ * @param {number} nonce_size
183
+ * @param {number | null} [rounds]
184
+ * @returns {AeadCipher}
185
+ */
186
+ static new_rc5_ccm(key, tag_size, nonce_size, rounds) {
187
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
188
+ const len0 = WASM_VECTOR_LEN;
189
+ const ret = wasm.aeadcipher_new_rc5_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
190
+ if (ret[2]) {
191
+ throw takeFromExternrefTable0(ret[1]);
192
+ }
193
+ return AeadCipher.__wrap(ret[0]);
194
+ }
133
195
  /**
134
196
  * @param {Uint8Array} key
135
197
  * @param {number | null} [rounds]
@@ -144,6 +206,21 @@ export class AeadCipher {
144
206
  }
145
207
  return AeadCipher.__wrap(ret[0]);
146
208
  }
209
+ /**
210
+ * @param {Uint8Array} key
211
+ * @param {number} tag_size
212
+ * @param {number} nonce_size
213
+ * @returns {AeadCipher}
214
+ */
215
+ static new_rc6_ccm(key, tag_size, nonce_size) {
216
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
217
+ const len0 = WASM_VECTOR_LEN;
218
+ const ret = wasm.aeadcipher_new_rc6_ccm(ptr0, len0, tag_size, nonce_size);
219
+ if (ret[2]) {
220
+ throw takeFromExternrefTable0(ret[1]);
221
+ }
222
+ return AeadCipher.__wrap(ret[0]);
223
+ }
147
224
  /**
148
225
  * @param {Uint8Array} key
149
226
  * @returns {AeadCipher}
@@ -157,6 +234,21 @@ export class AeadCipher {
157
234
  }
158
235
  return AeadCipher.__wrap(ret[0]);
159
236
  }
237
+ /**
238
+ * @param {Uint8Array} key
239
+ * @param {number} tag_size
240
+ * @param {number} nonce_size
241
+ * @returns {AeadCipher}
242
+ */
243
+ static new_sm4_ccm(key, tag_size, nonce_size) {
244
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
245
+ const len0 = WASM_VECTOR_LEN;
246
+ const ret = wasm.aeadcipher_new_sm4_ccm(ptr0, len0, tag_size, nonce_size);
247
+ if (ret[2]) {
248
+ throw takeFromExternrefTable0(ret[1]);
249
+ }
250
+ return AeadCipher.__wrap(ret[0]);
251
+ }
160
252
  /**
161
253
  * @param {Uint8Array} key
162
254
  * @returns {AeadCipher}
@@ -170,6 +262,21 @@ export class AeadCipher {
170
262
  }
171
263
  return AeadCipher.__wrap(ret[0]);
172
264
  }
265
+ /**
266
+ * @param {Uint8Array} key
267
+ * @param {number} tag_size
268
+ * @param {number} nonce_size
269
+ * @returns {AeadCipher}
270
+ */
271
+ static new_tea_ccm(key, tag_size, nonce_size) {
272
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
273
+ const len0 = WASM_VECTOR_LEN;
274
+ const ret = wasm.aeadcipher_new_tea_ccm(ptr0, len0, tag_size, nonce_size);
275
+ if (ret[2]) {
276
+ throw takeFromExternrefTable0(ret[1]);
277
+ }
278
+ return AeadCipher.__wrap(ret[0]);
279
+ }
173
280
  /**
174
281
  * @param {Uint8Array} key
175
282
  * @returns {AeadCipher}
@@ -198,6 +305,34 @@ export class AeadCipher {
198
305
  }
199
306
  return AeadCipher.__wrap(ret[0]);
200
307
  }
308
+ /**
309
+ * @param {Uint8Array} key
310
+ * @param {number} tag_size
311
+ * @param {number} nonce_size
312
+ * @returns {AeadCipher}
313
+ */
314
+ static new_aria_ccm(key, tag_size, nonce_size) {
315
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
316
+ const len0 = WASM_VECTOR_LEN;
317
+ const ret = wasm.aeadcipher_new_aria_ccm(ptr0, len0, tag_size, nonce_size);
318
+ if (ret[2]) {
319
+ throw takeFromExternrefTable0(ret[1]);
320
+ }
321
+ return AeadCipher.__wrap(ret[0]);
322
+ }
323
+ /**
324
+ * @param {Uint8Array} key
325
+ * @returns {AeadCipher}
326
+ */
327
+ static new_aria_gcm(key) {
328
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
329
+ const len0 = WASM_VECTOR_LEN;
330
+ const ret = wasm.aeadcipher_new_aria_gcm(ptr0, len0);
331
+ if (ret[2]) {
332
+ throw takeFromExternrefTable0(ret[1]);
333
+ }
334
+ return AeadCipher.__wrap(ret[0]);
335
+ }
201
336
  /**
202
337
  * @param {Uint8Array} key
203
338
  * @param {number} tag_size
@@ -213,6 +348,21 @@ export class AeadCipher {
213
348
  }
214
349
  return AeadCipher.__wrap(ret[0]);
215
350
  }
351
+ /**
352
+ * @param {Uint8Array} key
353
+ * @param {number} tag_size
354
+ * @param {number} nonce_size
355
+ * @returns {AeadCipher}
356
+ */
357
+ static new_idea_ccm(key, tag_size, nonce_size) {
358
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
359
+ const len0 = WASM_VECTOR_LEN;
360
+ const ret = wasm.aeadcipher_new_idea_ccm(ptr0, len0, tag_size, nonce_size);
361
+ if (ret[2]) {
362
+ throw takeFromExternrefTable0(ret[1]);
363
+ }
364
+ return AeadCipher.__wrap(ret[0]);
365
+ }
216
366
  /**
217
367
  * @param {Uint8Array} key
218
368
  * @returns {AeadCipher}
@@ -271,6 +421,21 @@ export class AeadCipher {
271
421
  }
272
422
  return AeadCipher.__wrap(ret[0]);
273
423
  }
424
+ /**
425
+ * @param {Uint8Array} key
426
+ * @param {number} tag_size
427
+ * @param {number} nonce_size
428
+ * @returns {AeadCipher}
429
+ */
430
+ static new_xtea_ccm(key, tag_size, nonce_size) {
431
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
432
+ const len0 = WASM_VECTOR_LEN;
433
+ const ret = wasm.aeadcipher_new_xtea_ccm(ptr0, len0, tag_size, nonce_size);
434
+ if (ret[2]) {
435
+ throw takeFromExternrefTable0(ret[1]);
436
+ }
437
+ return AeadCipher.__wrap(ret[0]);
438
+ }
274
439
  /**
275
440
  * @param {Uint8Array} key
276
441
  * @returns {AeadCipher}
@@ -284,6 +449,36 @@ export class AeadCipher {
284
449
  }
285
450
  return AeadCipher.__wrap(ret[0]);
286
451
  }
452
+ /**
453
+ * @param {Uint8Array} key
454
+ * @param {number} tag_size
455
+ * @param {number} nonce_size
456
+ * @returns {AeadCipher}
457
+ */
458
+ static new_aria_ocb3(key, tag_size, nonce_size) {
459
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
460
+ const len0 = WASM_VECTOR_LEN;
461
+ const ret = wasm.aeadcipher_new_aria_ocb3(ptr0, len0, tag_size, nonce_size);
462
+ if (ret[2]) {
463
+ throw takeFromExternrefTable0(ret[1]);
464
+ }
465
+ return AeadCipher.__wrap(ret[0]);
466
+ }
467
+ /**
468
+ * @param {Uint8Array} key
469
+ * @param {number} tag_size
470
+ * @param {number} nonce_size
471
+ * @returns {AeadCipher}
472
+ */
473
+ static new_cast5_ccm(key, tag_size, nonce_size) {
474
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
475
+ const len0 = WASM_VECTOR_LEN;
476
+ const ret = wasm.aeadcipher_new_cast5_ccm(ptr0, len0, tag_size, nonce_size);
477
+ if (ret[2]) {
478
+ throw takeFromExternrefTable0(ret[1]);
479
+ }
480
+ return AeadCipher.__wrap(ret[0]);
481
+ }
287
482
  /**
288
483
  * @param {Uint8Array} key
289
484
  * @returns {AeadCipher}
@@ -312,6 +507,21 @@ export class AeadCipher {
312
507
  }
313
508
  return AeadCipher.__wrap(ret[0]);
314
509
  }
510
+ /**
511
+ * @param {Uint8Array} key
512
+ * @param {number} tag_size
513
+ * @param {number} nonce_size
514
+ * @returns {AeadCipher}
515
+ */
516
+ static new_kseed_ccm(key, tag_size, nonce_size) {
517
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
518
+ const len0 = WASM_VECTOR_LEN;
519
+ const ret = wasm.aeadcipher_new_kseed_ccm(ptr0, len0, tag_size, nonce_size);
520
+ if (ret[2]) {
521
+ throw takeFromExternrefTable0(ret[1]);
522
+ }
523
+ return AeadCipher.__wrap(ret[0]);
524
+ }
315
525
  /**
316
526
  * @param {Uint8Array} key
317
527
  * @returns {AeadCipher}
@@ -340,6 +550,21 @@ export class AeadCipher {
340
550
  }
341
551
  return AeadCipher.__wrap(ret[0]);
342
552
  }
553
+ /**
554
+ * @param {Uint8Array} key
555
+ * @param {number} tag_size
556
+ * @param {number} nonce_size
557
+ * @returns {AeadCipher}
558
+ */
559
+ static new_anubis_ccm(key, tag_size, nonce_size) {
560
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
561
+ const len0 = WASM_VECTOR_LEN;
562
+ const ret = wasm.aeadcipher_new_anubis_ccm(ptr0, len0, tag_size, nonce_size);
563
+ if (ret[2]) {
564
+ throw takeFromExternrefTable0(ret[1]);
565
+ }
566
+ return AeadCipher.__wrap(ret[0]);
567
+ }
343
568
  /**
344
569
  * @param {Uint8Array} key
345
570
  * @returns {AeadCipher}
@@ -368,6 +593,21 @@ export class AeadCipher {
368
593
  }
369
594
  return AeadCipher.__wrap(ret[0]);
370
595
  }
596
+ /**
597
+ * @param {Uint8Array} key
598
+ * @param {number} tag_size
599
+ * @param {number} nonce_size
600
+ * @returns {AeadCipher}
601
+ */
602
+ static new_kasumi_ccm(key, tag_size, nonce_size) {
603
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
604
+ const len0 = WASM_VECTOR_LEN;
605
+ const ret = wasm.aeadcipher_new_kasumi_ccm(ptr0, len0, tag_size, nonce_size);
606
+ if (ret[2]) {
607
+ throw takeFromExternrefTable0(ret[1]);
608
+ }
609
+ return AeadCipher.__wrap(ret[0]);
610
+ }
371
611
  /**
372
612
  * @param {Uint8Array} key
373
613
  * @returns {AeadCipher}
@@ -381,6 +621,21 @@ export class AeadCipher {
381
621
  }
382
622
  return AeadCipher.__wrap(ret[0]);
383
623
  }
624
+ /**
625
+ * @param {Uint8Array} key
626
+ * @param {number} tag_size
627
+ * @param {number} nonce_size
628
+ * @returns {AeadCipher}
629
+ */
630
+ static new_khazad_ccm(key, tag_size, nonce_size) {
631
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
632
+ const len0 = WASM_VECTOR_LEN;
633
+ const ret = wasm.aeadcipher_new_khazad_ccm(ptr0, len0, tag_size, nonce_size);
634
+ if (ret[2]) {
635
+ throw takeFromExternrefTable0(ret[1]);
636
+ }
637
+ return AeadCipher.__wrap(ret[0]);
638
+ }
384
639
  /**
385
640
  * @param {Uint8Array} key
386
641
  * @returns {AeadCipher}
@@ -409,6 +664,22 @@ export class AeadCipher {
409
664
  }
410
665
  return AeadCipher.__wrap(ret[0]);
411
666
  }
667
+ /**
668
+ * @param {Uint8Array} key
669
+ * @param {number} tag_size
670
+ * @param {number} nonce_size
671
+ * @param {number | null} [rounds]
672
+ * @returns {AeadCipher}
673
+ */
674
+ static new_multi2_ccm(key, tag_size, nonce_size, rounds) {
675
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
676
+ const len0 = WASM_VECTOR_LEN;
677
+ const ret = wasm.aeadcipher_new_multi2_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
678
+ if (ret[2]) {
679
+ throw takeFromExternrefTable0(ret[1]);
680
+ }
681
+ return AeadCipher.__wrap(ret[0]);
682
+ }
412
683
  /**
413
684
  * @param {Uint8Array} key
414
685
  * @param {number | null} [rounds]
@@ -468,6 +739,21 @@ export class AeadCipher {
468
739
  }
469
740
  return AeadCipher.__wrap(ret[0]);
470
741
  }
742
+ /**
743
+ * @param {Uint8Array} key
744
+ * @param {number} tag_size
745
+ * @param {number} nonce_size
746
+ * @returns {AeadCipher}
747
+ */
748
+ static new_noekeon_ccm(key, tag_size, nonce_size) {
749
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
750
+ const len0 = WASM_VECTOR_LEN;
751
+ const ret = wasm.aeadcipher_new_noekeon_ccm(ptr0, len0, tag_size, nonce_size);
752
+ if (ret[2]) {
753
+ throw takeFromExternrefTable0(ret[1]);
754
+ }
755
+ return AeadCipher.__wrap(ret[0]);
756
+ }
471
757
  /**
472
758
  * @param {Uint8Array} key
473
759
  * @returns {AeadCipher}
@@ -481,6 +767,21 @@ export class AeadCipher {
481
767
  }
482
768
  return AeadCipher.__wrap(ret[0]);
483
769
  }
770
+ /**
771
+ * @param {Uint8Array} key
772
+ * @param {number} tag_size
773
+ * @param {number} nonce_size
774
+ * @returns {AeadCipher}
775
+ */
776
+ static new_serpent_ccm(key, tag_size, nonce_size) {
777
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
778
+ const len0 = WASM_VECTOR_LEN;
779
+ const ret = wasm.aeadcipher_new_serpent_ccm(ptr0, len0, tag_size, nonce_size);
780
+ if (ret[2]) {
781
+ throw takeFromExternrefTable0(ret[1]);
782
+ }
783
+ return AeadCipher.__wrap(ret[0]);
784
+ }
484
785
  /**
485
786
  * @param {Uint8Array} key
486
787
  * @returns {AeadCipher}
@@ -494,6 +795,21 @@ export class AeadCipher {
494
795
  }
495
796
  return AeadCipher.__wrap(ret[0]);
496
797
  }
798
+ /**
799
+ * @param {Uint8Array} key
800
+ * @param {number} tag_size
801
+ * @param {number} nonce_size
802
+ * @returns {AeadCipher}
803
+ */
804
+ static new_twofish_ccm(key, tag_size, nonce_size) {
805
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
806
+ const len0 = WASM_VECTOR_LEN;
807
+ const ret = wasm.aeadcipher_new_twofish_ccm(ptr0, len0, tag_size, nonce_size);
808
+ if (ret[2]) {
809
+ throw takeFromExternrefTable0(ret[1]);
810
+ }
811
+ return AeadCipher.__wrap(ret[0]);
812
+ }
497
813
  /**
498
814
  * @param {Uint8Array} key
499
815
  * @returns {AeadCipher}
@@ -507,6 +823,21 @@ export class AeadCipher {
507
823
  }
508
824
  return AeadCipher.__wrap(ret[0]);
509
825
  }
826
+ /**
827
+ * @param {Uint8Array} key
828
+ * @param {number} tag_size
829
+ * @param {number} nonce_size
830
+ * @returns {AeadCipher}
831
+ */
832
+ static new_blowfish_ccm(key, tag_size, nonce_size) {
833
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
834
+ const len0 = WASM_VECTOR_LEN;
835
+ const ret = wasm.aeadcipher_new_blowfish_ccm(ptr0, len0, tag_size, nonce_size);
836
+ if (ret[2]) {
837
+ throw takeFromExternrefTable0(ret[1]);
838
+ }
839
+ return AeadCipher.__wrap(ret[0]);
840
+ }
510
841
  /**
511
842
  * @param {Uint8Array} key
512
843
  * @returns {AeadCipher}
@@ -520,6 +851,22 @@ export class AeadCipher {
520
851
  }
521
852
  return AeadCipher.__wrap(ret[0]);
522
853
  }
854
+ /**
855
+ * @param {Uint8Array} key
856
+ * @param {number} tag_size
857
+ * @param {number} nonce_size
858
+ * @param {number | null} [rounds]
859
+ * @returns {AeadCipher}
860
+ */
861
+ static new_camellia_ccm(key, tag_size, nonce_size, rounds) {
862
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
863
+ const len0 = WASM_VECTOR_LEN;
864
+ const ret = wasm.aeadcipher_new_camellia_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
865
+ if (ret[2]) {
866
+ throw takeFromExternrefTable0(ret[1]);
867
+ }
868
+ return AeadCipher.__wrap(ret[0]);
869
+ }
523
870
  /**
524
871
  * @param {Uint8Array} key
525
872
  * @param {number | null} [rounds]
@@ -564,6 +911,21 @@ export class AeadCipher {
564
911
  }
565
912
  return AeadCipher.__wrap(ret[0]);
566
913
  }
914
+ /**
915
+ * @param {Uint8Array} key
916
+ * @param {number} tag_size
917
+ * @param {number} nonce_size
918
+ * @returns {AeadCipher}
919
+ */
920
+ static new_skipjack_ccm(key, tag_size, nonce_size) {
921
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
922
+ const len0 = WASM_VECTOR_LEN;
923
+ const ret = wasm.aeadcipher_new_skipjack_ccm(ptr0, len0, tag_size, nonce_size);
924
+ if (ret[2]) {
925
+ throw takeFromExternrefTable0(ret[1]);
926
+ }
927
+ return AeadCipher.__wrap(ret[0]);
928
+ }
567
929
  /**
568
930
  * @param {Uint8Array} key
569
931
  * @returns {AeadCipher}
@@ -622,6 +984,21 @@ export class AeadCipher {
622
984
  }
623
985
  return AeadCipher.__wrap(ret[0]);
624
986
  }
987
+ /**
988
+ * @param {Uint8Array} key
989
+ * @param {number} tag_size
990
+ * @param {number} nonce_size
991
+ * @returns {AeadCipher}
992
+ */
993
+ static new_tripledes_ccm(key, tag_size, nonce_size) {
994
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
995
+ const len0 = WASM_VECTOR_LEN;
996
+ const ret = wasm.aeadcipher_new_tripledes_ccm(ptr0, len0, tag_size, nonce_size);
997
+ if (ret[2]) {
998
+ throw takeFromExternrefTable0(ret[1]);
999
+ }
1000
+ return AeadCipher.__wrap(ret[0]);
1001
+ }
625
1002
  /**
626
1003
  * @param {Uint8Array} key
627
1004
  * @returns {AeadCipher}
@@ -866,6 +1243,22 @@ export class BlockCipher {
866
1243
  }
867
1244
  return BlockCipher.__wrap(ret[0]);
868
1245
  }
1246
+ /**
1247
+ * @param {Uint8Array} key
1248
+ * @param {Uint8Array} iv
1249
+ * @returns {BlockCipher}
1250
+ */
1251
+ static new_aria_cbc(key, iv) {
1252
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
1253
+ const len0 = WASM_VECTOR_LEN;
1254
+ const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
1255
+ const len1 = WASM_VECTOR_LEN;
1256
+ const ret = wasm.blockcipher_new_aria_cbc(ptr0, len0, ptr1, len1);
1257
+ if (ret[2]) {
1258
+ throw takeFromExternrefTable0(ret[1]);
1259
+ }
1260
+ return BlockCipher.__wrap(ret[0]);
1261
+ }
869
1262
  /**
870
1263
  * @param {Uint8Array} key
871
1264
  * @param {Uint8Array} iv
@@ -2042,6 +2435,54 @@ export class StreamCipher {
2042
2435
  }
2043
2436
  return StreamCipher.__wrap(ret[0]);
2044
2437
  }
2438
+ /**
2439
+ * @param {Uint8Array} key
2440
+ * @param {Uint8Array} iv
2441
+ * @returns {StreamCipher}
2442
+ */
2443
+ static new_aria_cfb(key, iv) {
2444
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2445
+ const len0 = WASM_VECTOR_LEN;
2446
+ const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
2447
+ const len1 = WASM_VECTOR_LEN;
2448
+ const ret = wasm.streamcipher_new_aria_cfb(ptr0, len0, ptr1, len1);
2449
+ if (ret[2]) {
2450
+ throw takeFromExternrefTable0(ret[1]);
2451
+ }
2452
+ return StreamCipher.__wrap(ret[0]);
2453
+ }
2454
+ /**
2455
+ * @param {Uint8Array} key
2456
+ * @param {Uint8Array} iv
2457
+ * @returns {StreamCipher}
2458
+ */
2459
+ static new_aria_ctr(key, iv) {
2460
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2461
+ const len0 = WASM_VECTOR_LEN;
2462
+ const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
2463
+ const len1 = WASM_VECTOR_LEN;
2464
+ const ret = wasm.streamcipher_new_aria_ctr(ptr0, len0, ptr1, len1);
2465
+ if (ret[2]) {
2466
+ throw takeFromExternrefTable0(ret[1]);
2467
+ }
2468
+ return StreamCipher.__wrap(ret[0]);
2469
+ }
2470
+ /**
2471
+ * @param {Uint8Array} key
2472
+ * @param {Uint8Array} iv
2473
+ * @returns {StreamCipher}
2474
+ */
2475
+ static new_aria_ofb(key, iv) {
2476
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2477
+ const len0 = WASM_VECTOR_LEN;
2478
+ const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
2479
+ const len1 = WASM_VECTOR_LEN;
2480
+ const ret = wasm.streamcipher_new_aria_ofb(ptr0, len0, ptr1, len1);
2481
+ if (ret[2]) {
2482
+ throw takeFromExternrefTable0(ret[1]);
2483
+ }
2484
+ return StreamCipher.__wrap(ret[0]);
2485
+ }
2045
2486
  /**
2046
2487
  * @param {Uint8Array} key
2047
2488
  * @param {Uint8Array} iv
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@cathaysia/crown-wasm",
3
3
  "type": "module",
4
4
  "description": "A cryptographic library.",
5
- "version": "0.22.0",
5
+ "version": "0.24.0",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",