@cathaysia/crown-wasm 0.23.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,46 +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;
16
24
  static new_aria_gcm(key: Uint8Array): AeadCipher;
17
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;
18
27
  static new_idea_gcm(key: Uint8Array): AeadCipher;
19
28
  static new_rc6_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
20
29
  static new_sm4_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
21
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;
22
32
  static new_xtea_gcm(key: Uint8Array): AeadCipher;
23
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;
24
35
  static new_cast5_gcm(key: Uint8Array): AeadCipher;
25
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;
26
38
  static new_kseed_gcm(key: Uint8Array): AeadCipher;
27
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;
28
41
  static new_anubis_gcm(key: Uint8Array): AeadCipher;
29
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;
30
44
  static new_kasumi_gcm(key: Uint8Array): AeadCipher;
45
+ static new_khazad_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
31
46
  static new_khazad_gcm(key: Uint8Array): AeadCipher;
32
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;
33
49
  static new_multi2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
34
50
  static new_anubis_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
35
51
  static new_kasumi_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
36
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;
37
54
  static new_noekeon_gcm(key: Uint8Array): AeadCipher;
55
+ static new_serpent_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
38
56
  static new_serpent_gcm(key: Uint8Array): AeadCipher;
57
+ static new_twofish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
39
58
  static new_twofish_gcm(key: Uint8Array): AeadCipher;
59
+ static new_blowfish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
40
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;
41
62
  static new_camellia_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
42
63
  static new_noekeon_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
43
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;
44
66
  static new_skipjack_gcm(key: Uint8Array): AeadCipher;
45
67
  static new_twofish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
46
68
  static new_blowfish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
47
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;
48
71
  static new_tripledes_gcm(key: Uint8Array): AeadCipher;
49
72
  static new_tripledes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
50
73
  static new_chacha20_poly1305(key: Uint8Array): AeadCipher;
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,21 @@ 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
+ }
201
323
  /**
202
324
  * @param {Uint8Array} key
203
325
  * @returns {AeadCipher}
@@ -226,6 +348,21 @@ export class AeadCipher {
226
348
  }
227
349
  return AeadCipher.__wrap(ret[0]);
228
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
+ }
229
366
  /**
230
367
  * @param {Uint8Array} key
231
368
  * @returns {AeadCipher}
@@ -284,6 +421,21 @@ export class AeadCipher {
284
421
  }
285
422
  return AeadCipher.__wrap(ret[0]);
286
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
+ }
287
439
  /**
288
440
  * @param {Uint8Array} key
289
441
  * @returns {AeadCipher}
@@ -312,6 +464,21 @@ export class AeadCipher {
312
464
  }
313
465
  return AeadCipher.__wrap(ret[0]);
314
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
+ }
315
482
  /**
316
483
  * @param {Uint8Array} key
317
484
  * @returns {AeadCipher}
@@ -340,6 +507,21 @@ export class AeadCipher {
340
507
  }
341
508
  return AeadCipher.__wrap(ret[0]);
342
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
+ }
343
525
  /**
344
526
  * @param {Uint8Array} key
345
527
  * @returns {AeadCipher}
@@ -368,6 +550,21 @@ export class AeadCipher {
368
550
  }
369
551
  return AeadCipher.__wrap(ret[0]);
370
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
+ }
371
568
  /**
372
569
  * @param {Uint8Array} key
373
570
  * @returns {AeadCipher}
@@ -396,6 +593,21 @@ export class AeadCipher {
396
593
  }
397
594
  return AeadCipher.__wrap(ret[0]);
398
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
+ }
399
611
  /**
400
612
  * @param {Uint8Array} key
401
613
  * @returns {AeadCipher}
@@ -409,6 +621,21 @@ export class AeadCipher {
409
621
  }
410
622
  return AeadCipher.__wrap(ret[0]);
411
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
+ }
412
639
  /**
413
640
  * @param {Uint8Array} key
414
641
  * @returns {AeadCipher}
@@ -437,6 +664,22 @@ export class AeadCipher {
437
664
  }
438
665
  return AeadCipher.__wrap(ret[0]);
439
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
+ }
440
683
  /**
441
684
  * @param {Uint8Array} key
442
685
  * @param {number | null} [rounds]
@@ -496,6 +739,21 @@ export class AeadCipher {
496
739
  }
497
740
  return AeadCipher.__wrap(ret[0]);
498
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
+ }
499
757
  /**
500
758
  * @param {Uint8Array} key
501
759
  * @returns {AeadCipher}
@@ -509,6 +767,21 @@ export class AeadCipher {
509
767
  }
510
768
  return AeadCipher.__wrap(ret[0]);
511
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
+ }
512
785
  /**
513
786
  * @param {Uint8Array} key
514
787
  * @returns {AeadCipher}
@@ -522,6 +795,21 @@ export class AeadCipher {
522
795
  }
523
796
  return AeadCipher.__wrap(ret[0]);
524
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
+ }
525
813
  /**
526
814
  * @param {Uint8Array} key
527
815
  * @returns {AeadCipher}
@@ -535,6 +823,21 @@ export class AeadCipher {
535
823
  }
536
824
  return AeadCipher.__wrap(ret[0]);
537
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
+ }
538
841
  /**
539
842
  * @param {Uint8Array} key
540
843
  * @returns {AeadCipher}
@@ -548,6 +851,22 @@ export class AeadCipher {
548
851
  }
549
852
  return AeadCipher.__wrap(ret[0]);
550
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
+ }
551
870
  /**
552
871
  * @param {Uint8Array} key
553
872
  * @param {number | null} [rounds]
@@ -592,6 +911,21 @@ export class AeadCipher {
592
911
  }
593
912
  return AeadCipher.__wrap(ret[0]);
594
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
+ }
595
929
  /**
596
930
  * @param {Uint8Array} key
597
931
  * @returns {AeadCipher}
@@ -650,6 +984,21 @@ export class AeadCipher {
650
984
  }
651
985
  return AeadCipher.__wrap(ret[0]);
652
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
+ }
653
1002
  /**
654
1003
  * @param {Uint8Array} key
655
1004
  * @returns {AeadCipher}
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.23.0",
5
+ "version": "0.24.0",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",