@cathaysia/crown-wasm 0.19.0 → 0.22.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 +118 -118
- package/crown_wasm_bg.js +484 -484
- package/crown_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/crown_wasm_bg.js
CHANGED
|
@@ -83,6 +83,13 @@ export class AeadCipher {
|
|
|
83
83
|
const ptr = this.__destroy_into_raw();
|
|
84
84
|
wasm.__wbg_aeadcipher_free(ptr, 0);
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* @returns {number}
|
|
88
|
+
*/
|
|
89
|
+
nonce_size() {
|
|
90
|
+
const ret = wasm.aeadcipher_nonce_size(this.__wbg_ptr);
|
|
91
|
+
return ret >>> 0;
|
|
92
|
+
}
|
|
86
93
|
/**
|
|
87
94
|
* @param {Uint8Array} key
|
|
88
95
|
* @returns {AeadCipher}
|
|
@@ -98,14 +105,12 @@ export class AeadCipher {
|
|
|
98
105
|
}
|
|
99
106
|
/**
|
|
100
107
|
* @param {Uint8Array} key
|
|
101
|
-
* @param {number} tag_size
|
|
102
|
-
* @param {number} nonce_size
|
|
103
108
|
* @returns {AeadCipher}
|
|
104
109
|
*/
|
|
105
|
-
static
|
|
110
|
+
static new_des_gcm(key) {
|
|
106
111
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
107
112
|
const len0 = WASM_VECTOR_LEN;
|
|
108
|
-
const ret = wasm.
|
|
113
|
+
const ret = wasm.aeadcipher_new_des_gcm(ptr0, len0);
|
|
109
114
|
if (ret[2]) {
|
|
110
115
|
throw takeFromExternrefTable0(ret[1]);
|
|
111
116
|
}
|
|
@@ -113,12 +118,13 @@ export class AeadCipher {
|
|
|
113
118
|
}
|
|
114
119
|
/**
|
|
115
120
|
* @param {Uint8Array} key
|
|
121
|
+
* @param {number | null} [rounds]
|
|
116
122
|
* @returns {AeadCipher}
|
|
117
123
|
*/
|
|
118
|
-
static
|
|
124
|
+
static new_rc2_gcm(key, rounds) {
|
|
119
125
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
120
126
|
const len0 = WASM_VECTOR_LEN;
|
|
121
|
-
const ret = wasm.
|
|
127
|
+
const ret = wasm.aeadcipher_new_rc2_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
122
128
|
if (ret[2]) {
|
|
123
129
|
throw takeFromExternrefTable0(ret[1]);
|
|
124
130
|
}
|
|
@@ -126,14 +132,13 @@ export class AeadCipher {
|
|
|
126
132
|
}
|
|
127
133
|
/**
|
|
128
134
|
* @param {Uint8Array} key
|
|
129
|
-
* @param {number}
|
|
130
|
-
* @param {number} nonce_size
|
|
135
|
+
* @param {number | null} [rounds]
|
|
131
136
|
* @returns {AeadCipher}
|
|
132
137
|
*/
|
|
133
|
-
static
|
|
138
|
+
static new_rc5_gcm(key, rounds) {
|
|
134
139
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
135
140
|
const len0 = WASM_VECTOR_LEN;
|
|
136
|
-
const ret = wasm.
|
|
141
|
+
const ret = wasm.aeadcipher_new_rc5_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
137
142
|
if (ret[2]) {
|
|
138
143
|
throw takeFromExternrefTable0(ret[1]);
|
|
139
144
|
}
|
|
@@ -143,10 +148,10 @@ export class AeadCipher {
|
|
|
143
148
|
* @param {Uint8Array} key
|
|
144
149
|
* @returns {AeadCipher}
|
|
145
150
|
*/
|
|
146
|
-
static
|
|
151
|
+
static new_rc6_gcm(key) {
|
|
147
152
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
148
153
|
const len0 = WASM_VECTOR_LEN;
|
|
149
|
-
const ret = wasm.
|
|
154
|
+
const ret = wasm.aeadcipher_new_rc6_gcm(ptr0, len0);
|
|
150
155
|
if (ret[2]) {
|
|
151
156
|
throw takeFromExternrefTable0(ret[1]);
|
|
152
157
|
}
|
|
@@ -154,14 +159,12 @@ export class AeadCipher {
|
|
|
154
159
|
}
|
|
155
160
|
/**
|
|
156
161
|
* @param {Uint8Array} key
|
|
157
|
-
* @param {number} tag_size
|
|
158
|
-
* @param {number} nonce_size
|
|
159
162
|
* @returns {AeadCipher}
|
|
160
163
|
*/
|
|
161
|
-
static
|
|
164
|
+
static new_sm4_gcm(key) {
|
|
162
165
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
163
166
|
const len0 = WASM_VECTOR_LEN;
|
|
164
|
-
const ret = wasm.
|
|
167
|
+
const ret = wasm.aeadcipher_new_sm4_gcm(ptr0, len0);
|
|
165
168
|
if (ret[2]) {
|
|
166
169
|
throw takeFromExternrefTable0(ret[1]);
|
|
167
170
|
}
|
|
@@ -171,10 +174,10 @@ export class AeadCipher {
|
|
|
171
174
|
* @param {Uint8Array} key
|
|
172
175
|
* @returns {AeadCipher}
|
|
173
176
|
*/
|
|
174
|
-
static
|
|
177
|
+
static new_tea_gcm(key) {
|
|
175
178
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
176
179
|
const len0 = WASM_VECTOR_LEN;
|
|
177
|
-
const ret = wasm.
|
|
180
|
+
const ret = wasm.aeadcipher_new_tea_gcm(ptr0, len0);
|
|
178
181
|
if (ret[2]) {
|
|
179
182
|
throw takeFromExternrefTable0(ret[1]);
|
|
180
183
|
}
|
|
@@ -186,10 +189,10 @@ export class AeadCipher {
|
|
|
186
189
|
* @param {number} nonce_size
|
|
187
190
|
* @returns {AeadCipher}
|
|
188
191
|
*/
|
|
189
|
-
static
|
|
192
|
+
static new_aes_ocb3(key, tag_size, nonce_size) {
|
|
190
193
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
191
194
|
const len0 = WASM_VECTOR_LEN;
|
|
192
|
-
const ret = wasm.
|
|
195
|
+
const ret = wasm.aeadcipher_new_aes_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
193
196
|
if (ret[2]) {
|
|
194
197
|
throw takeFromExternrefTable0(ret[1]);
|
|
195
198
|
}
|
|
@@ -197,12 +200,14 @@ export class AeadCipher {
|
|
|
197
200
|
}
|
|
198
201
|
/**
|
|
199
202
|
* @param {Uint8Array} key
|
|
203
|
+
* @param {number} tag_size
|
|
204
|
+
* @param {number} nonce_size
|
|
200
205
|
* @returns {AeadCipher}
|
|
201
206
|
*/
|
|
202
|
-
static
|
|
207
|
+
static new_des_ocb3(key, tag_size, nonce_size) {
|
|
203
208
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
204
209
|
const len0 = WASM_VECTOR_LEN;
|
|
205
|
-
const ret = wasm.
|
|
210
|
+
const ret = wasm.aeadcipher_new_des_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
206
211
|
if (ret[2]) {
|
|
207
212
|
throw takeFromExternrefTable0(ret[1]);
|
|
208
213
|
}
|
|
@@ -210,14 +215,12 @@ export class AeadCipher {
|
|
|
210
215
|
}
|
|
211
216
|
/**
|
|
212
217
|
* @param {Uint8Array} key
|
|
213
|
-
* @param {number} tag_size
|
|
214
|
-
* @param {number} nonce_size
|
|
215
218
|
* @returns {AeadCipher}
|
|
216
219
|
*/
|
|
217
|
-
static
|
|
220
|
+
static new_idea_gcm(key) {
|
|
218
221
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
219
222
|
const len0 = WASM_VECTOR_LEN;
|
|
220
|
-
const ret = wasm.
|
|
223
|
+
const ret = wasm.aeadcipher_new_idea_gcm(ptr0, len0);
|
|
221
224
|
if (ret[2]) {
|
|
222
225
|
throw takeFromExternrefTable0(ret[1]);
|
|
223
226
|
}
|
|
@@ -225,12 +228,14 @@ export class AeadCipher {
|
|
|
225
228
|
}
|
|
226
229
|
/**
|
|
227
230
|
* @param {Uint8Array} key
|
|
231
|
+
* @param {number} tag_size
|
|
232
|
+
* @param {number} nonce_size
|
|
228
233
|
* @returns {AeadCipher}
|
|
229
234
|
*/
|
|
230
|
-
static
|
|
235
|
+
static new_rc6_ocb3(key, tag_size, nonce_size) {
|
|
231
236
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
232
237
|
const len0 = WASM_VECTOR_LEN;
|
|
233
|
-
const ret = wasm.
|
|
238
|
+
const ret = wasm.aeadcipher_new_rc6_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
234
239
|
if (ret[2]) {
|
|
235
240
|
throw takeFromExternrefTable0(ret[1]);
|
|
236
241
|
}
|
|
@@ -242,10 +247,10 @@ export class AeadCipher {
|
|
|
242
247
|
* @param {number} nonce_size
|
|
243
248
|
* @returns {AeadCipher}
|
|
244
249
|
*/
|
|
245
|
-
static
|
|
250
|
+
static new_sm4_ocb3(key, tag_size, nonce_size) {
|
|
246
251
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
247
252
|
const len0 = WASM_VECTOR_LEN;
|
|
248
|
-
const ret = wasm.
|
|
253
|
+
const ret = wasm.aeadcipher_new_sm4_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
249
254
|
if (ret[2]) {
|
|
250
255
|
throw takeFromExternrefTable0(ret[1]);
|
|
251
256
|
}
|
|
@@ -253,12 +258,14 @@ export class AeadCipher {
|
|
|
253
258
|
}
|
|
254
259
|
/**
|
|
255
260
|
* @param {Uint8Array} key
|
|
261
|
+
* @param {number} tag_size
|
|
262
|
+
* @param {number} nonce_size
|
|
256
263
|
* @returns {AeadCipher}
|
|
257
264
|
*/
|
|
258
|
-
static
|
|
265
|
+
static new_tea_ocb3(key, tag_size, nonce_size) {
|
|
259
266
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
260
267
|
const len0 = WASM_VECTOR_LEN;
|
|
261
|
-
const ret = wasm.
|
|
268
|
+
const ret = wasm.aeadcipher_new_tea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
262
269
|
if (ret[2]) {
|
|
263
270
|
throw takeFromExternrefTable0(ret[1]);
|
|
264
271
|
}
|
|
@@ -266,14 +273,12 @@ export class AeadCipher {
|
|
|
266
273
|
}
|
|
267
274
|
/**
|
|
268
275
|
* @param {Uint8Array} key
|
|
269
|
-
* @param {number} tag_size
|
|
270
|
-
* @param {number} nonce_size
|
|
271
276
|
* @returns {AeadCipher}
|
|
272
277
|
*/
|
|
273
|
-
static
|
|
278
|
+
static new_xtea_gcm(key) {
|
|
274
279
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
275
280
|
const len0 = WASM_VECTOR_LEN;
|
|
276
|
-
const ret = wasm.
|
|
281
|
+
const ret = wasm.aeadcipher_new_xtea_gcm(ptr0, len0);
|
|
277
282
|
if (ret[2]) {
|
|
278
283
|
throw takeFromExternrefTable0(ret[1]);
|
|
279
284
|
}
|
|
@@ -283,10 +288,10 @@ export class AeadCipher {
|
|
|
283
288
|
* @param {Uint8Array} key
|
|
284
289
|
* @returns {AeadCipher}
|
|
285
290
|
*/
|
|
286
|
-
static
|
|
291
|
+
static new_cast5_gcm(key) {
|
|
287
292
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
288
293
|
const len0 = WASM_VECTOR_LEN;
|
|
289
|
-
const ret = wasm.
|
|
294
|
+
const ret = wasm.aeadcipher_new_cast5_gcm(ptr0, len0);
|
|
290
295
|
if (ret[2]) {
|
|
291
296
|
throw takeFromExternrefTable0(ret[1]);
|
|
292
297
|
}
|
|
@@ -298,10 +303,10 @@ export class AeadCipher {
|
|
|
298
303
|
* @param {number} nonce_size
|
|
299
304
|
* @returns {AeadCipher}
|
|
300
305
|
*/
|
|
301
|
-
static
|
|
306
|
+
static new_idea_ocb3(key, tag_size, nonce_size) {
|
|
302
307
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
303
308
|
const len0 = WASM_VECTOR_LEN;
|
|
304
|
-
const ret = wasm.
|
|
309
|
+
const ret = wasm.aeadcipher_new_idea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
305
310
|
if (ret[2]) {
|
|
306
311
|
throw takeFromExternrefTable0(ret[1]);
|
|
307
312
|
}
|
|
@@ -311,10 +316,10 @@ export class AeadCipher {
|
|
|
311
316
|
* @param {Uint8Array} key
|
|
312
317
|
* @returns {AeadCipher}
|
|
313
318
|
*/
|
|
314
|
-
static
|
|
319
|
+
static new_kseed_gcm(key) {
|
|
315
320
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
316
321
|
const len0 = WASM_VECTOR_LEN;
|
|
317
|
-
const ret = wasm.
|
|
322
|
+
const ret = wasm.aeadcipher_new_kseed_gcm(ptr0, len0);
|
|
318
323
|
if (ret[2]) {
|
|
319
324
|
throw takeFromExternrefTable0(ret[1]);
|
|
320
325
|
}
|
|
@@ -326,10 +331,10 @@ export class AeadCipher {
|
|
|
326
331
|
* @param {number} nonce_size
|
|
327
332
|
* @returns {AeadCipher}
|
|
328
333
|
*/
|
|
329
|
-
static
|
|
334
|
+
static new_xtea_ocb3(key, tag_size, nonce_size) {
|
|
330
335
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
331
336
|
const len0 = WASM_VECTOR_LEN;
|
|
332
|
-
const ret = wasm.
|
|
337
|
+
const ret = wasm.aeadcipher_new_xtea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
333
338
|
if (ret[2]) {
|
|
334
339
|
throw takeFromExternrefTable0(ret[1]);
|
|
335
340
|
}
|
|
@@ -339,10 +344,10 @@ export class AeadCipher {
|
|
|
339
344
|
* @param {Uint8Array} key
|
|
340
345
|
* @returns {AeadCipher}
|
|
341
346
|
*/
|
|
342
|
-
static
|
|
347
|
+
static new_anubis_gcm(key) {
|
|
343
348
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
344
349
|
const len0 = WASM_VECTOR_LEN;
|
|
345
|
-
const ret = wasm.
|
|
350
|
+
const ret = wasm.aeadcipher_new_anubis_gcm(ptr0, len0);
|
|
346
351
|
if (ret[2]) {
|
|
347
352
|
throw takeFromExternrefTable0(ret[1]);
|
|
348
353
|
}
|
|
@@ -354,10 +359,10 @@ export class AeadCipher {
|
|
|
354
359
|
* @param {number} nonce_size
|
|
355
360
|
* @returns {AeadCipher}
|
|
356
361
|
*/
|
|
357
|
-
static
|
|
362
|
+
static new_cast5_ocb3(key, tag_size, nonce_size) {
|
|
358
363
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
359
364
|
const len0 = WASM_VECTOR_LEN;
|
|
360
|
-
const ret = wasm.
|
|
365
|
+
const ret = wasm.aeadcipher_new_cast5_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
361
366
|
if (ret[2]) {
|
|
362
367
|
throw takeFromExternrefTable0(ret[1]);
|
|
363
368
|
}
|
|
@@ -367,10 +372,10 @@ export class AeadCipher {
|
|
|
367
372
|
* @param {Uint8Array} key
|
|
368
373
|
* @returns {AeadCipher}
|
|
369
374
|
*/
|
|
370
|
-
static
|
|
375
|
+
static new_kasumi_gcm(key) {
|
|
371
376
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
372
377
|
const len0 = WASM_VECTOR_LEN;
|
|
373
|
-
const ret = wasm.
|
|
378
|
+
const ret = wasm.aeadcipher_new_kasumi_gcm(ptr0, len0);
|
|
374
379
|
if (ret[2]) {
|
|
375
380
|
throw takeFromExternrefTable0(ret[1]);
|
|
376
381
|
}
|
|
@@ -378,14 +383,12 @@ export class AeadCipher {
|
|
|
378
383
|
}
|
|
379
384
|
/**
|
|
380
385
|
* @param {Uint8Array} key
|
|
381
|
-
* @param {number} tag_size
|
|
382
|
-
* @param {number} nonce_size
|
|
383
386
|
* @returns {AeadCipher}
|
|
384
387
|
*/
|
|
385
|
-
static
|
|
388
|
+
static new_khazad_gcm(key) {
|
|
386
389
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
387
390
|
const len0 = WASM_VECTOR_LEN;
|
|
388
|
-
const ret = wasm.
|
|
391
|
+
const ret = wasm.aeadcipher_new_khazad_gcm(ptr0, len0);
|
|
389
392
|
if (ret[2]) {
|
|
390
393
|
throw takeFromExternrefTable0(ret[1]);
|
|
391
394
|
}
|
|
@@ -393,12 +396,14 @@ export class AeadCipher {
|
|
|
393
396
|
}
|
|
394
397
|
/**
|
|
395
398
|
* @param {Uint8Array} key
|
|
399
|
+
* @param {number} tag_size
|
|
400
|
+
* @param {number} nonce_size
|
|
396
401
|
* @returns {AeadCipher}
|
|
397
402
|
*/
|
|
398
|
-
static
|
|
403
|
+
static new_kseed_ocb3(key, tag_size, nonce_size) {
|
|
399
404
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
400
405
|
const len0 = WASM_VECTOR_LEN;
|
|
401
|
-
const ret = wasm.
|
|
406
|
+
const ret = wasm.aeadcipher_new_kseed_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
402
407
|
if (ret[2]) {
|
|
403
408
|
throw takeFromExternrefTable0(ret[1]);
|
|
404
409
|
}
|
|
@@ -406,14 +411,13 @@ export class AeadCipher {
|
|
|
406
411
|
}
|
|
407
412
|
/**
|
|
408
413
|
* @param {Uint8Array} key
|
|
409
|
-
* @param {number}
|
|
410
|
-
* @param {number} nonce_size
|
|
414
|
+
* @param {number | null} [rounds]
|
|
411
415
|
* @returns {AeadCipher}
|
|
412
416
|
*/
|
|
413
|
-
static
|
|
417
|
+
static new_multi2_gcm(key, rounds) {
|
|
414
418
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
415
419
|
const len0 = WASM_VECTOR_LEN;
|
|
416
|
-
const ret = wasm.
|
|
420
|
+
const ret = wasm.aeadcipher_new_multi2_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
417
421
|
if (ret[2]) {
|
|
418
422
|
throw takeFromExternrefTable0(ret[1]);
|
|
419
423
|
}
|
|
@@ -421,12 +425,14 @@ export class AeadCipher {
|
|
|
421
425
|
}
|
|
422
426
|
/**
|
|
423
427
|
* @param {Uint8Array} key
|
|
428
|
+
* @param {number} tag_size
|
|
429
|
+
* @param {number} nonce_size
|
|
424
430
|
* @returns {AeadCipher}
|
|
425
431
|
*/
|
|
426
|
-
static
|
|
432
|
+
static new_anubis_ocb3(key, tag_size, nonce_size) {
|
|
427
433
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
428
434
|
const len0 = WASM_VECTOR_LEN;
|
|
429
|
-
const ret = wasm.
|
|
435
|
+
const ret = wasm.aeadcipher_new_anubis_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
430
436
|
if (ret[2]) {
|
|
431
437
|
throw takeFromExternrefTable0(ret[1]);
|
|
432
438
|
}
|
|
@@ -438,10 +444,10 @@ export class AeadCipher {
|
|
|
438
444
|
* @param {number} nonce_size
|
|
439
445
|
* @returns {AeadCipher}
|
|
440
446
|
*/
|
|
441
|
-
static
|
|
447
|
+
static new_kasumi_ocb3(key, tag_size, nonce_size) {
|
|
442
448
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
443
449
|
const len0 = WASM_VECTOR_LEN;
|
|
444
|
-
const ret = wasm.
|
|
450
|
+
const ret = wasm.aeadcipher_new_kasumi_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
445
451
|
if (ret[2]) {
|
|
446
452
|
throw takeFromExternrefTable0(ret[1]);
|
|
447
453
|
}
|
|
@@ -449,12 +455,14 @@ export class AeadCipher {
|
|
|
449
455
|
}
|
|
450
456
|
/**
|
|
451
457
|
* @param {Uint8Array} key
|
|
458
|
+
* @param {number} tag_size
|
|
459
|
+
* @param {number} nonce_size
|
|
452
460
|
* @returns {AeadCipher}
|
|
453
461
|
*/
|
|
454
|
-
static
|
|
462
|
+
static new_khazad_ocb3(key, tag_size, nonce_size) {
|
|
455
463
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
456
464
|
const len0 = WASM_VECTOR_LEN;
|
|
457
|
-
const ret = wasm.
|
|
465
|
+
const ret = wasm.aeadcipher_new_khazad_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
458
466
|
if (ret[2]) {
|
|
459
467
|
throw takeFromExternrefTable0(ret[1]);
|
|
460
468
|
}
|
|
@@ -462,14 +470,12 @@ export class AeadCipher {
|
|
|
462
470
|
}
|
|
463
471
|
/**
|
|
464
472
|
* @param {Uint8Array} key
|
|
465
|
-
* @param {number} tag_size
|
|
466
|
-
* @param {number} nonce_size
|
|
467
473
|
* @returns {AeadCipher}
|
|
468
474
|
*/
|
|
469
|
-
static
|
|
475
|
+
static new_noekeon_gcm(key) {
|
|
470
476
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
471
477
|
const len0 = WASM_VECTOR_LEN;
|
|
472
|
-
const ret = wasm.
|
|
478
|
+
const ret = wasm.aeadcipher_new_noekeon_gcm(ptr0, len0);
|
|
473
479
|
if (ret[2]) {
|
|
474
480
|
throw takeFromExternrefTable0(ret[1]);
|
|
475
481
|
}
|
|
@@ -479,10 +485,10 @@ export class AeadCipher {
|
|
|
479
485
|
* @param {Uint8Array} key
|
|
480
486
|
* @returns {AeadCipher}
|
|
481
487
|
*/
|
|
482
|
-
static
|
|
488
|
+
static new_serpent_gcm(key) {
|
|
483
489
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
484
490
|
const len0 = WASM_VECTOR_LEN;
|
|
485
|
-
const ret = wasm.
|
|
491
|
+
const ret = wasm.aeadcipher_new_serpent_gcm(ptr0, len0);
|
|
486
492
|
if (ret[2]) {
|
|
487
493
|
throw takeFromExternrefTable0(ret[1]);
|
|
488
494
|
}
|
|
@@ -490,14 +496,12 @@ export class AeadCipher {
|
|
|
490
496
|
}
|
|
491
497
|
/**
|
|
492
498
|
* @param {Uint8Array} key
|
|
493
|
-
* @param {number} tag_size
|
|
494
|
-
* @param {number} nonce_size
|
|
495
499
|
* @returns {AeadCipher}
|
|
496
500
|
*/
|
|
497
|
-
static
|
|
501
|
+
static new_twofish_gcm(key) {
|
|
498
502
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
499
503
|
const len0 = WASM_VECTOR_LEN;
|
|
500
|
-
const ret = wasm.
|
|
504
|
+
const ret = wasm.aeadcipher_new_twofish_gcm(ptr0, len0);
|
|
501
505
|
if (ret[2]) {
|
|
502
506
|
throw takeFromExternrefTable0(ret[1]);
|
|
503
507
|
}
|
|
@@ -507,10 +511,10 @@ export class AeadCipher {
|
|
|
507
511
|
* @param {Uint8Array} key
|
|
508
512
|
* @returns {AeadCipher}
|
|
509
513
|
*/
|
|
510
|
-
static
|
|
514
|
+
static new_blowfish_gcm(key) {
|
|
511
515
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
512
516
|
const len0 = WASM_VECTOR_LEN;
|
|
513
|
-
const ret = wasm.
|
|
517
|
+
const ret = wasm.aeadcipher_new_blowfish_gcm(ptr0, len0);
|
|
514
518
|
if (ret[2]) {
|
|
515
519
|
throw takeFromExternrefTable0(ret[1]);
|
|
516
520
|
}
|
|
@@ -518,14 +522,13 @@ export class AeadCipher {
|
|
|
518
522
|
}
|
|
519
523
|
/**
|
|
520
524
|
* @param {Uint8Array} key
|
|
521
|
-
* @param {number}
|
|
522
|
-
* @param {number} nonce_size
|
|
525
|
+
* @param {number | null} [rounds]
|
|
523
526
|
* @returns {AeadCipher}
|
|
524
527
|
*/
|
|
525
|
-
static
|
|
528
|
+
static new_camellia_gcm(key, rounds) {
|
|
526
529
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
527
530
|
const len0 = WASM_VECTOR_LEN;
|
|
528
|
-
const ret = wasm.
|
|
531
|
+
const ret = wasm.aeadcipher_new_camellia_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
529
532
|
if (ret[2]) {
|
|
530
533
|
throw takeFromExternrefTable0(ret[1]);
|
|
531
534
|
}
|
|
@@ -533,12 +536,14 @@ export class AeadCipher {
|
|
|
533
536
|
}
|
|
534
537
|
/**
|
|
535
538
|
* @param {Uint8Array} key
|
|
539
|
+
* @param {number} tag_size
|
|
540
|
+
* @param {number} nonce_size
|
|
536
541
|
* @returns {AeadCipher}
|
|
537
542
|
*/
|
|
538
|
-
static
|
|
543
|
+
static new_noekeon_ocb3(key, tag_size, nonce_size) {
|
|
539
544
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
540
545
|
const len0 = WASM_VECTOR_LEN;
|
|
541
|
-
const ret = wasm.
|
|
546
|
+
const ret = wasm.aeadcipher_new_noekeon_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
542
547
|
if (ret[2]) {
|
|
543
548
|
throw takeFromExternrefTable0(ret[1]);
|
|
544
549
|
}
|
|
@@ -563,10 +568,10 @@ export class AeadCipher {
|
|
|
563
568
|
* @param {Uint8Array} key
|
|
564
569
|
* @returns {AeadCipher}
|
|
565
570
|
*/
|
|
566
|
-
static
|
|
571
|
+
static new_skipjack_gcm(key) {
|
|
567
572
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
568
573
|
const len0 = WASM_VECTOR_LEN;
|
|
569
|
-
const ret = wasm.
|
|
574
|
+
const ret = wasm.aeadcipher_new_skipjack_gcm(ptr0, len0);
|
|
570
575
|
if (ret[2]) {
|
|
571
576
|
throw takeFromExternrefTable0(ret[1]);
|
|
572
577
|
}
|
|
@@ -578,10 +583,10 @@ export class AeadCipher {
|
|
|
578
583
|
* @param {number} nonce_size
|
|
579
584
|
* @returns {AeadCipher}
|
|
580
585
|
*/
|
|
581
|
-
static
|
|
586
|
+
static new_twofish_ocb3(key, tag_size, nonce_size) {
|
|
582
587
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
583
588
|
const len0 = WASM_VECTOR_LEN;
|
|
584
|
-
const ret = wasm.
|
|
589
|
+
const ret = wasm.aeadcipher_new_twofish_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
585
590
|
if (ret[2]) {
|
|
586
591
|
throw takeFromExternrefTable0(ret[1]);
|
|
587
592
|
}
|
|
@@ -589,13 +594,14 @@ export class AeadCipher {
|
|
|
589
594
|
}
|
|
590
595
|
/**
|
|
591
596
|
* @param {Uint8Array} key
|
|
592
|
-
* @param {number
|
|
597
|
+
* @param {number} tag_size
|
|
598
|
+
* @param {number} nonce_size
|
|
593
599
|
* @returns {AeadCipher}
|
|
594
600
|
*/
|
|
595
|
-
static
|
|
601
|
+
static new_blowfish_ocb3(key, tag_size, nonce_size) {
|
|
596
602
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
597
603
|
const len0 = WASM_VECTOR_LEN;
|
|
598
|
-
const ret = wasm.
|
|
604
|
+
const ret = wasm.aeadcipher_new_blowfish_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
599
605
|
if (ret[2]) {
|
|
600
606
|
throw takeFromExternrefTable0(ret[1]);
|
|
601
607
|
}
|
|
@@ -603,13 +609,14 @@ export class AeadCipher {
|
|
|
603
609
|
}
|
|
604
610
|
/**
|
|
605
611
|
* @param {Uint8Array} key
|
|
606
|
-
* @param {number
|
|
612
|
+
* @param {number} tag_size
|
|
613
|
+
* @param {number} nonce_size
|
|
607
614
|
* @returns {AeadCipher}
|
|
608
615
|
*/
|
|
609
|
-
static
|
|
616
|
+
static new_skipjack_ocb3(key, tag_size, nonce_size) {
|
|
610
617
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
611
618
|
const len0 = WASM_VECTOR_LEN;
|
|
612
|
-
const ret = wasm.
|
|
619
|
+
const ret = wasm.aeadcipher_new_skipjack_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
613
620
|
if (ret[2]) {
|
|
614
621
|
throw takeFromExternrefTable0(ret[1]);
|
|
615
622
|
}
|
|
@@ -617,13 +624,12 @@ export class AeadCipher {
|
|
|
617
624
|
}
|
|
618
625
|
/**
|
|
619
626
|
* @param {Uint8Array} key
|
|
620
|
-
* @param {number | null} [rounds]
|
|
621
627
|
* @returns {AeadCipher}
|
|
622
628
|
*/
|
|
623
|
-
static
|
|
629
|
+
static new_tripledes_gcm(key) {
|
|
624
630
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
625
631
|
const len0 = WASM_VECTOR_LEN;
|
|
626
|
-
const ret = wasm.
|
|
632
|
+
const ret = wasm.aeadcipher_new_tripledes_gcm(ptr0, len0);
|
|
627
633
|
if (ret[2]) {
|
|
628
634
|
throw takeFromExternrefTable0(ret[1]);
|
|
629
635
|
}
|
|
@@ -631,13 +637,14 @@ export class AeadCipher {
|
|
|
631
637
|
}
|
|
632
638
|
/**
|
|
633
639
|
* @param {Uint8Array} key
|
|
634
|
-
* @param {number
|
|
640
|
+
* @param {number} tag_size
|
|
641
|
+
* @param {number} nonce_size
|
|
635
642
|
* @returns {AeadCipher}
|
|
636
643
|
*/
|
|
637
|
-
static
|
|
644
|
+
static new_tripledes_ocb3(key, tag_size, nonce_size) {
|
|
638
645
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
639
646
|
const len0 = WASM_VECTOR_LEN;
|
|
640
|
-
const ret = wasm.
|
|
647
|
+
const ret = wasm.aeadcipher_new_tripledes_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
641
648
|
if (ret[2]) {
|
|
642
649
|
throw takeFromExternrefTable0(ret[1]);
|
|
643
650
|
}
|
|
@@ -670,18 +677,24 @@ export class AeadCipher {
|
|
|
670
677
|
return AeadCipher.__wrap(ret[0]);
|
|
671
678
|
}
|
|
672
679
|
/**
|
|
673
|
-
* @
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
return ret >>> 0;
|
|
678
|
-
}
|
|
679
|
-
/**
|
|
680
|
-
* @returns {number}
|
|
680
|
+
* @param {Uint8Array} data
|
|
681
|
+
* @param {Uint8Array} tag
|
|
682
|
+
* @param {Uint8Array} nonce
|
|
683
|
+
* @param {Uint8Array} aad
|
|
681
684
|
*/
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
+
open_in_place_separate_tag(data, tag, nonce, aad) {
|
|
686
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
687
|
+
var len0 = WASM_VECTOR_LEN;
|
|
688
|
+
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
|
|
689
|
+
const len1 = WASM_VECTOR_LEN;
|
|
690
|
+
const ptr2 = passArray8ToWasm0(nonce, wasm.__wbindgen_malloc);
|
|
691
|
+
const len2 = WASM_VECTOR_LEN;
|
|
692
|
+
const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
|
|
693
|
+
const len3 = WASM_VECTOR_LEN;
|
|
694
|
+
const ret = wasm.aeadcipher_open_in_place_separate_tag(this.__wbg_ptr, ptr0, len0, data, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
695
|
+
if (ret[1]) {
|
|
696
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
697
|
+
}
|
|
685
698
|
}
|
|
686
699
|
/**
|
|
687
700
|
* @param {Uint8Array} data
|
|
@@ -705,24 +718,11 @@ export class AeadCipher {
|
|
|
705
718
|
return v4;
|
|
706
719
|
}
|
|
707
720
|
/**
|
|
708
|
-
* @
|
|
709
|
-
* @param {Uint8Array} tag
|
|
710
|
-
* @param {Uint8Array} nonce
|
|
711
|
-
* @param {Uint8Array} aad
|
|
721
|
+
* @returns {number}
|
|
712
722
|
*/
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
|
|
717
|
-
const len1 = WASM_VECTOR_LEN;
|
|
718
|
-
const ptr2 = passArray8ToWasm0(nonce, wasm.__wbindgen_malloc);
|
|
719
|
-
const len2 = WASM_VECTOR_LEN;
|
|
720
|
-
const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
|
|
721
|
-
const len3 = WASM_VECTOR_LEN;
|
|
722
|
-
const ret = wasm.aeadcipher_open_in_place_separate_tag(this.__wbg_ptr, ptr0, len0, data, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
723
|
-
if (ret[1]) {
|
|
724
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
725
|
-
}
|
|
723
|
+
tag_size() {
|
|
724
|
+
const ret = wasm.aeadcipher_tag_size(this.__wbg_ptr);
|
|
725
|
+
return ret >>> 0;
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
728
|
if (Symbol.dispose) AeadCipher.prototype[Symbol.dispose] = AeadCipher.prototype.free;
|
|
@@ -773,12 +773,12 @@ export class BlockCipher {
|
|
|
773
773
|
* @param {Uint8Array} iv
|
|
774
774
|
* @returns {BlockCipher}
|
|
775
775
|
*/
|
|
776
|
-
static
|
|
776
|
+
static new_des_cbc(key, iv) {
|
|
777
777
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
778
778
|
const len0 = WASM_VECTOR_LEN;
|
|
779
779
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
780
780
|
const len1 = WASM_VECTOR_LEN;
|
|
781
|
-
const ret = wasm.
|
|
781
|
+
const ret = wasm.blockcipher_new_des_cbc(ptr0, len0, ptr1, len1);
|
|
782
782
|
if (ret[2]) {
|
|
783
783
|
throw takeFromExternrefTable0(ret[1]);
|
|
784
784
|
}
|
|
@@ -787,14 +787,15 @@ export class BlockCipher {
|
|
|
787
787
|
/**
|
|
788
788
|
* @param {Uint8Array} key
|
|
789
789
|
* @param {Uint8Array} iv
|
|
790
|
+
* @param {number | null} [rounds]
|
|
790
791
|
* @returns {BlockCipher}
|
|
791
792
|
*/
|
|
792
|
-
static
|
|
793
|
+
static new_rc2_cbc(key, iv, rounds) {
|
|
793
794
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
794
795
|
const len0 = WASM_VECTOR_LEN;
|
|
795
796
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
796
797
|
const len1 = WASM_VECTOR_LEN;
|
|
797
|
-
const ret = wasm.
|
|
798
|
+
const ret = wasm.blockcipher_new_rc2_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
798
799
|
if (ret[2]) {
|
|
799
800
|
throw takeFromExternrefTable0(ret[1]);
|
|
800
801
|
}
|
|
@@ -803,14 +804,15 @@ export class BlockCipher {
|
|
|
803
804
|
/**
|
|
804
805
|
* @param {Uint8Array} key
|
|
805
806
|
* @param {Uint8Array} iv
|
|
807
|
+
* @param {number | null} [rounds]
|
|
806
808
|
* @returns {BlockCipher}
|
|
807
809
|
*/
|
|
808
|
-
static
|
|
810
|
+
static new_rc5_cbc(key, iv, rounds) {
|
|
809
811
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
810
812
|
const len0 = WASM_VECTOR_LEN;
|
|
811
813
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
812
814
|
const len1 = WASM_VECTOR_LEN;
|
|
813
|
-
const ret = wasm.
|
|
815
|
+
const ret = wasm.blockcipher_new_rc5_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
814
816
|
if (ret[2]) {
|
|
815
817
|
throw takeFromExternrefTable0(ret[1]);
|
|
816
818
|
}
|
|
@@ -821,12 +823,12 @@ export class BlockCipher {
|
|
|
821
823
|
* @param {Uint8Array} iv
|
|
822
824
|
* @returns {BlockCipher}
|
|
823
825
|
*/
|
|
824
|
-
static
|
|
826
|
+
static new_rc6_cbc(key, iv) {
|
|
825
827
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
826
828
|
const len0 = WASM_VECTOR_LEN;
|
|
827
829
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
828
830
|
const len1 = WASM_VECTOR_LEN;
|
|
829
|
-
const ret = wasm.
|
|
831
|
+
const ret = wasm.blockcipher_new_rc6_cbc(ptr0, len0, ptr1, len1);
|
|
830
832
|
if (ret[2]) {
|
|
831
833
|
throw takeFromExternrefTable0(ret[1]);
|
|
832
834
|
}
|
|
@@ -837,12 +839,12 @@ export class BlockCipher {
|
|
|
837
839
|
* @param {Uint8Array} iv
|
|
838
840
|
* @returns {BlockCipher}
|
|
839
841
|
*/
|
|
840
|
-
static
|
|
842
|
+
static new_sm4_cbc(key, iv) {
|
|
841
843
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
842
844
|
const len0 = WASM_VECTOR_LEN;
|
|
843
845
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
844
846
|
const len1 = WASM_VECTOR_LEN;
|
|
845
|
-
const ret = wasm.
|
|
847
|
+
const ret = wasm.blockcipher_new_sm4_cbc(ptr0, len0, ptr1, len1);
|
|
846
848
|
if (ret[2]) {
|
|
847
849
|
throw takeFromExternrefTable0(ret[1]);
|
|
848
850
|
}
|
|
@@ -853,12 +855,12 @@ export class BlockCipher {
|
|
|
853
855
|
* @param {Uint8Array} iv
|
|
854
856
|
* @returns {BlockCipher}
|
|
855
857
|
*/
|
|
856
|
-
static
|
|
858
|
+
static new_tea_cbc(key, iv) {
|
|
857
859
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
858
860
|
const len0 = WASM_VECTOR_LEN;
|
|
859
861
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
860
862
|
const len1 = WASM_VECTOR_LEN;
|
|
861
|
-
const ret = wasm.
|
|
863
|
+
const ret = wasm.blockcipher_new_tea_cbc(ptr0, len0, ptr1, len1);
|
|
862
864
|
if (ret[2]) {
|
|
863
865
|
throw takeFromExternrefTable0(ret[1]);
|
|
864
866
|
}
|
|
@@ -869,12 +871,12 @@ export class BlockCipher {
|
|
|
869
871
|
* @param {Uint8Array} iv
|
|
870
872
|
* @returns {BlockCipher}
|
|
871
873
|
*/
|
|
872
|
-
static
|
|
874
|
+
static new_idea_cbc(key, iv) {
|
|
873
875
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
874
876
|
const len0 = WASM_VECTOR_LEN;
|
|
875
877
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
876
878
|
const len1 = WASM_VECTOR_LEN;
|
|
877
|
-
const ret = wasm.
|
|
879
|
+
const ret = wasm.blockcipher_new_idea_cbc(ptr0, len0, ptr1, len1);
|
|
878
880
|
if (ret[2]) {
|
|
879
881
|
throw takeFromExternrefTable0(ret[1]);
|
|
880
882
|
}
|
|
@@ -885,12 +887,12 @@ export class BlockCipher {
|
|
|
885
887
|
* @param {Uint8Array} iv
|
|
886
888
|
* @returns {BlockCipher}
|
|
887
889
|
*/
|
|
888
|
-
static
|
|
890
|
+
static new_xtea_cbc(key, iv) {
|
|
889
891
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
890
892
|
const len0 = WASM_VECTOR_LEN;
|
|
891
893
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
892
894
|
const len1 = WASM_VECTOR_LEN;
|
|
893
|
-
const ret = wasm.
|
|
895
|
+
const ret = wasm.blockcipher_new_xtea_cbc(ptr0, len0, ptr1, len1);
|
|
894
896
|
if (ret[2]) {
|
|
895
897
|
throw takeFromExternrefTable0(ret[1]);
|
|
896
898
|
}
|
|
@@ -901,12 +903,12 @@ export class BlockCipher {
|
|
|
901
903
|
* @param {Uint8Array} iv
|
|
902
904
|
* @returns {BlockCipher}
|
|
903
905
|
*/
|
|
904
|
-
static
|
|
906
|
+
static new_cast5_cbc(key, iv) {
|
|
905
907
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
906
908
|
const len0 = WASM_VECTOR_LEN;
|
|
907
909
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
908
910
|
const len1 = WASM_VECTOR_LEN;
|
|
909
|
-
const ret = wasm.
|
|
911
|
+
const ret = wasm.blockcipher_new_cast5_cbc(ptr0, len0, ptr1, len1);
|
|
910
912
|
if (ret[2]) {
|
|
911
913
|
throw takeFromExternrefTable0(ret[1]);
|
|
912
914
|
}
|
|
@@ -917,12 +919,12 @@ export class BlockCipher {
|
|
|
917
919
|
* @param {Uint8Array} iv
|
|
918
920
|
* @returns {BlockCipher}
|
|
919
921
|
*/
|
|
920
|
-
static
|
|
922
|
+
static new_kseed_cbc(key, iv) {
|
|
921
923
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
922
924
|
const len0 = WASM_VECTOR_LEN;
|
|
923
925
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
924
926
|
const len1 = WASM_VECTOR_LEN;
|
|
925
|
-
const ret = wasm.
|
|
927
|
+
const ret = wasm.blockcipher_new_kseed_cbc(ptr0, len0, ptr1, len1);
|
|
926
928
|
if (ret[2]) {
|
|
927
929
|
throw takeFromExternrefTable0(ret[1]);
|
|
928
930
|
}
|
|
@@ -933,12 +935,12 @@ export class BlockCipher {
|
|
|
933
935
|
* @param {Uint8Array} iv
|
|
934
936
|
* @returns {BlockCipher}
|
|
935
937
|
*/
|
|
936
|
-
static
|
|
938
|
+
static new_anubis_cbc(key, iv) {
|
|
937
939
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
938
940
|
const len0 = WASM_VECTOR_LEN;
|
|
939
941
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
940
942
|
const len1 = WASM_VECTOR_LEN;
|
|
941
|
-
const ret = wasm.
|
|
943
|
+
const ret = wasm.blockcipher_new_anubis_cbc(ptr0, len0, ptr1, len1);
|
|
942
944
|
if (ret[2]) {
|
|
943
945
|
throw takeFromExternrefTable0(ret[1]);
|
|
944
946
|
}
|
|
@@ -965,12 +967,12 @@ export class BlockCipher {
|
|
|
965
967
|
* @param {Uint8Array} iv
|
|
966
968
|
* @returns {BlockCipher}
|
|
967
969
|
*/
|
|
968
|
-
static
|
|
970
|
+
static new_khazad_cbc(key, iv) {
|
|
969
971
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
970
972
|
const len0 = WASM_VECTOR_LEN;
|
|
971
973
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
972
974
|
const len1 = WASM_VECTOR_LEN;
|
|
973
|
-
const ret = wasm.
|
|
975
|
+
const ret = wasm.blockcipher_new_khazad_cbc(ptr0, len0, ptr1, len1);
|
|
974
976
|
if (ret[2]) {
|
|
975
977
|
throw takeFromExternrefTable0(ret[1]);
|
|
976
978
|
}
|
|
@@ -979,14 +981,15 @@ export class BlockCipher {
|
|
|
979
981
|
/**
|
|
980
982
|
* @param {Uint8Array} key
|
|
981
983
|
* @param {Uint8Array} iv
|
|
984
|
+
* @param {number | null} [rounds]
|
|
982
985
|
* @returns {BlockCipher}
|
|
983
986
|
*/
|
|
984
|
-
static
|
|
987
|
+
static new_multi2_cbc(key, iv, rounds) {
|
|
985
988
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
986
989
|
const len0 = WASM_VECTOR_LEN;
|
|
987
990
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
988
991
|
const len1 = WASM_VECTOR_LEN;
|
|
989
|
-
const ret = wasm.
|
|
992
|
+
const ret = wasm.blockcipher_new_multi2_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
990
993
|
if (ret[2]) {
|
|
991
994
|
throw takeFromExternrefTable0(ret[1]);
|
|
992
995
|
}
|
|
@@ -1013,12 +1016,12 @@ export class BlockCipher {
|
|
|
1013
1016
|
* @param {Uint8Array} iv
|
|
1014
1017
|
* @returns {BlockCipher}
|
|
1015
1018
|
*/
|
|
1016
|
-
static
|
|
1019
|
+
static new_serpent_cbc(key, iv) {
|
|
1017
1020
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1018
1021
|
const len0 = WASM_VECTOR_LEN;
|
|
1019
1022
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1020
1023
|
const len1 = WASM_VECTOR_LEN;
|
|
1021
|
-
const ret = wasm.
|
|
1024
|
+
const ret = wasm.blockcipher_new_serpent_cbc(ptr0, len0, ptr1, len1);
|
|
1022
1025
|
if (ret[2]) {
|
|
1023
1026
|
throw takeFromExternrefTable0(ret[1]);
|
|
1024
1027
|
}
|
|
@@ -1029,12 +1032,12 @@ export class BlockCipher {
|
|
|
1029
1032
|
* @param {Uint8Array} iv
|
|
1030
1033
|
* @returns {BlockCipher}
|
|
1031
1034
|
*/
|
|
1032
|
-
static
|
|
1035
|
+
static new_twofish_cbc(key, iv) {
|
|
1033
1036
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1034
1037
|
const len0 = WASM_VECTOR_LEN;
|
|
1035
1038
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1036
1039
|
const len1 = WASM_VECTOR_LEN;
|
|
1037
|
-
const ret = wasm.
|
|
1040
|
+
const ret = wasm.blockcipher_new_twofish_cbc(ptr0, len0, ptr1, len1);
|
|
1038
1041
|
if (ret[2]) {
|
|
1039
1042
|
throw takeFromExternrefTable0(ret[1]);
|
|
1040
1043
|
}
|
|
@@ -1043,15 +1046,14 @@ export class BlockCipher {
|
|
|
1043
1046
|
/**
|
|
1044
1047
|
* @param {Uint8Array} key
|
|
1045
1048
|
* @param {Uint8Array} iv
|
|
1046
|
-
* @param {number | null} [rounds]
|
|
1047
1049
|
* @returns {BlockCipher}
|
|
1048
1050
|
*/
|
|
1049
|
-
static
|
|
1051
|
+
static new_blowfish_cbc(key, iv) {
|
|
1050
1052
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1051
1053
|
const len0 = WASM_VECTOR_LEN;
|
|
1052
1054
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1053
1055
|
const len1 = WASM_VECTOR_LEN;
|
|
1054
|
-
const ret = wasm.
|
|
1056
|
+
const ret = wasm.blockcipher_new_blowfish_cbc(ptr0, len0, ptr1, len1);
|
|
1055
1057
|
if (ret[2]) {
|
|
1056
1058
|
throw takeFromExternrefTable0(ret[1]);
|
|
1057
1059
|
}
|
|
@@ -1063,12 +1065,12 @@ export class BlockCipher {
|
|
|
1063
1065
|
* @param {number | null} [rounds]
|
|
1064
1066
|
* @returns {BlockCipher}
|
|
1065
1067
|
*/
|
|
1066
|
-
static
|
|
1068
|
+
static new_camellia_cbc(key, iv, rounds) {
|
|
1067
1069
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1068
1070
|
const len0 = WASM_VECTOR_LEN;
|
|
1069
1071
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1070
1072
|
const len1 = WASM_VECTOR_LEN;
|
|
1071
|
-
const ret = wasm.
|
|
1073
|
+
const ret = wasm.blockcipher_new_camellia_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1072
1074
|
if (ret[2]) {
|
|
1073
1075
|
throw takeFromExternrefTable0(ret[1]);
|
|
1074
1076
|
}
|
|
@@ -1077,15 +1079,14 @@ export class BlockCipher {
|
|
|
1077
1079
|
/**
|
|
1078
1080
|
* @param {Uint8Array} key
|
|
1079
1081
|
* @param {Uint8Array} iv
|
|
1080
|
-
* @param {number | null} [rounds]
|
|
1081
1082
|
* @returns {BlockCipher}
|
|
1082
1083
|
*/
|
|
1083
|
-
static
|
|
1084
|
+
static new_skipjack_cbc(key, iv) {
|
|
1084
1085
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1085
1086
|
const len0 = WASM_VECTOR_LEN;
|
|
1086
1087
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1087
1088
|
const len1 = WASM_VECTOR_LEN;
|
|
1088
|
-
const ret = wasm.
|
|
1089
|
+
const ret = wasm.blockcipher_new_skipjack_cbc(ptr0, len0, ptr1, len1);
|
|
1089
1090
|
if (ret[2]) {
|
|
1090
1091
|
throw takeFromExternrefTable0(ret[1]);
|
|
1091
1092
|
}
|
|
@@ -1094,15 +1095,14 @@ export class BlockCipher {
|
|
|
1094
1095
|
/**
|
|
1095
1096
|
* @param {Uint8Array} key
|
|
1096
1097
|
* @param {Uint8Array} iv
|
|
1097
|
-
* @param {number | null} [rounds]
|
|
1098
1098
|
* @returns {BlockCipher}
|
|
1099
1099
|
*/
|
|
1100
|
-
static
|
|
1100
|
+
static new_tripledes_cbc(key, iv) {
|
|
1101
1101
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1102
1102
|
const len0 = WASM_VECTOR_LEN;
|
|
1103
1103
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1104
1104
|
const len1 = WASM_VECTOR_LEN;
|
|
1105
|
-
const ret = wasm.
|
|
1105
|
+
const ret = wasm.blockcipher_new_tripledes_cbc(ptr0, len0, ptr1, len1);
|
|
1106
1106
|
if (ret[2]) {
|
|
1107
1107
|
throw takeFromExternrefTable0(ret[1]);
|
|
1108
1108
|
}
|
|
@@ -1110,13 +1110,12 @@ export class BlockCipher {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
/**
|
|
1112
1112
|
* @param {Uint8Array} data
|
|
1113
|
-
* @param {number} pos
|
|
1114
1113
|
* @returns {number}
|
|
1115
1114
|
*/
|
|
1116
|
-
|
|
1115
|
+
decrypt(data) {
|
|
1117
1116
|
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1118
1117
|
var len0 = WASM_VECTOR_LEN;
|
|
1119
|
-
const ret = wasm.
|
|
1118
|
+
const ret = wasm.blockcipher_decrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
1120
1119
|
if (ret[2]) {
|
|
1121
1120
|
throw takeFromExternrefTable0(ret[1]);
|
|
1122
1121
|
}
|
|
@@ -1124,12 +1123,13 @@ export class BlockCipher {
|
|
|
1124
1123
|
}
|
|
1125
1124
|
/**
|
|
1126
1125
|
* @param {Uint8Array} data
|
|
1126
|
+
* @param {number} pos
|
|
1127
1127
|
* @returns {number}
|
|
1128
1128
|
*/
|
|
1129
|
-
|
|
1129
|
+
encrypt(data, pos) {
|
|
1130
1130
|
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1131
1131
|
var len0 = WASM_VECTOR_LEN;
|
|
1132
|
-
const ret = wasm.
|
|
1132
|
+
const ret = wasm.blockcipher_encrypt(this.__wbg_ptr, ptr0, len0, data, pos);
|
|
1133
1133
|
if (ret[2]) {
|
|
1134
1134
|
throw takeFromExternrefTable0(ret[1]);
|
|
1135
1135
|
}
|
|
@@ -1163,24 +1163,28 @@ export class Hash {
|
|
|
1163
1163
|
const ptr = this.__destroy_into_raw();
|
|
1164
1164
|
wasm.__wbg_hash_free(ptr, 0);
|
|
1165
1165
|
}
|
|
1166
|
+
/**
|
|
1167
|
+
* @returns {number}
|
|
1168
|
+
*/
|
|
1169
|
+
block_size() {
|
|
1170
|
+
const ret = wasm.hash_block_size(this.__wbg_ptr);
|
|
1171
|
+
return ret >>> 0;
|
|
1172
|
+
}
|
|
1166
1173
|
/**
|
|
1167
1174
|
* @returns {Hash}
|
|
1168
1175
|
*/
|
|
1169
|
-
static
|
|
1170
|
-
const ret = wasm.
|
|
1176
|
+
static new_sha224() {
|
|
1177
|
+
const ret = wasm.hash_new_sha224();
|
|
1171
1178
|
if (ret[2]) {
|
|
1172
1179
|
throw takeFromExternrefTable0(ret[1]);
|
|
1173
1180
|
}
|
|
1174
1181
|
return Hash.__wrap(ret[0]);
|
|
1175
1182
|
}
|
|
1176
1183
|
/**
|
|
1177
|
-
* @param {Uint8Array} key
|
|
1178
1184
|
* @returns {Hash}
|
|
1179
1185
|
*/
|
|
1180
|
-
static
|
|
1181
|
-
const
|
|
1182
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1183
|
-
const ret = wasm.hash_new_md2_hmac(ptr0, len0);
|
|
1186
|
+
static new_sha256() {
|
|
1187
|
+
const ret = wasm.hash_new_sha256();
|
|
1184
1188
|
if (ret[2]) {
|
|
1185
1189
|
throw takeFromExternrefTable0(ret[1]);
|
|
1186
1190
|
}
|
|
@@ -1189,54 +1193,59 @@ export class Hash {
|
|
|
1189
1193
|
/**
|
|
1190
1194
|
* @returns {Hash}
|
|
1191
1195
|
*/
|
|
1192
|
-
static
|
|
1193
|
-
const ret = wasm.
|
|
1196
|
+
static new_sha384() {
|
|
1197
|
+
const ret = wasm.hash_new_sha384();
|
|
1194
1198
|
if (ret[2]) {
|
|
1195
1199
|
throw takeFromExternrefTable0(ret[1]);
|
|
1196
1200
|
}
|
|
1197
1201
|
return Hash.__wrap(ret[0]);
|
|
1198
1202
|
}
|
|
1199
1203
|
/**
|
|
1200
|
-
* @param {Uint8Array} key
|
|
1201
1204
|
* @returns {Hash}
|
|
1202
1205
|
*/
|
|
1203
|
-
static
|
|
1204
|
-
const
|
|
1205
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1206
|
-
const ret = wasm.hash_new_md4_hmac(ptr0, len0);
|
|
1206
|
+
static new_sha512() {
|
|
1207
|
+
const ret = wasm.hash_new_sha512();
|
|
1207
1208
|
if (ret[2]) {
|
|
1208
1209
|
throw takeFromExternrefTable0(ret[1]);
|
|
1209
1210
|
}
|
|
1210
1211
|
return Hash.__wrap(ret[0]);
|
|
1211
1212
|
}
|
|
1212
1213
|
/**
|
|
1214
|
+
* @param {Uint8Array | null | undefined} key
|
|
1215
|
+
* @param {number} output_len
|
|
1213
1216
|
* @returns {Hash}
|
|
1214
1217
|
*/
|
|
1215
|
-
static
|
|
1216
|
-
|
|
1218
|
+
static new_blake2b(key, output_len) {
|
|
1219
|
+
var ptr0 = isLikeNone(key) ? 0 : passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1220
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1221
|
+
const ret = wasm.hash_new_blake2b(ptr0, len0, output_len);
|
|
1217
1222
|
if (ret[2]) {
|
|
1218
1223
|
throw takeFromExternrefTable0(ret[1]);
|
|
1219
1224
|
}
|
|
1220
1225
|
return Hash.__wrap(ret[0]);
|
|
1221
1226
|
}
|
|
1222
1227
|
/**
|
|
1223
|
-
* @param {Uint8Array} key
|
|
1228
|
+
* @param {Uint8Array | null | undefined} key
|
|
1229
|
+
* @param {number} output_len
|
|
1224
1230
|
* @returns {Hash}
|
|
1225
1231
|
*/
|
|
1226
|
-
static
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
const ret = wasm.
|
|
1232
|
+
static new_blake2s(key, output_len) {
|
|
1233
|
+
var ptr0 = isLikeNone(key) ? 0 : passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1234
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1235
|
+
const ret = wasm.hash_new_blake2s(ptr0, len0, output_len);
|
|
1230
1236
|
if (ret[2]) {
|
|
1231
1237
|
throw takeFromExternrefTable0(ret[1]);
|
|
1232
1238
|
}
|
|
1233
1239
|
return Hash.__wrap(ret[0]);
|
|
1234
1240
|
}
|
|
1235
1241
|
/**
|
|
1242
|
+
* @param {Uint8Array} key
|
|
1236
1243
|
* @returns {Hash}
|
|
1237
1244
|
*/
|
|
1238
|
-
static
|
|
1239
|
-
const
|
|
1245
|
+
static new_md2_hmac(key) {
|
|
1246
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1247
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1248
|
+
const ret = wasm.hash_new_md2_hmac(ptr0, len0);
|
|
1240
1249
|
if (ret[2]) {
|
|
1241
1250
|
throw takeFromExternrefTable0(ret[1]);
|
|
1242
1251
|
}
|
|
@@ -1246,33 +1255,33 @@ export class Hash {
|
|
|
1246
1255
|
* @param {Uint8Array} key
|
|
1247
1256
|
* @returns {Hash}
|
|
1248
1257
|
*/
|
|
1249
|
-
static
|
|
1258
|
+
static new_md4_hmac(key) {
|
|
1250
1259
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1251
1260
|
const len0 = WASM_VECTOR_LEN;
|
|
1252
|
-
const ret = wasm.
|
|
1261
|
+
const ret = wasm.hash_new_md4_hmac(ptr0, len0);
|
|
1253
1262
|
if (ret[2]) {
|
|
1254
1263
|
throw takeFromExternrefTable0(ret[1]);
|
|
1255
1264
|
}
|
|
1256
1265
|
return Hash.__wrap(ret[0]);
|
|
1257
1266
|
}
|
|
1258
1267
|
/**
|
|
1268
|
+
* @param {Uint8Array} key
|
|
1259
1269
|
* @returns {Hash}
|
|
1260
1270
|
*/
|
|
1261
|
-
static
|
|
1262
|
-
const
|
|
1271
|
+
static new_md5_hmac(key) {
|
|
1272
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1273
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1274
|
+
const ret = wasm.hash_new_md5_hmac(ptr0, len0);
|
|
1263
1275
|
if (ret[2]) {
|
|
1264
1276
|
throw takeFromExternrefTable0(ret[1]);
|
|
1265
1277
|
}
|
|
1266
1278
|
return Hash.__wrap(ret[0]);
|
|
1267
1279
|
}
|
|
1268
1280
|
/**
|
|
1269
|
-
* @param {Uint8Array} key
|
|
1270
1281
|
* @returns {Hash}
|
|
1271
1282
|
*/
|
|
1272
|
-
static
|
|
1273
|
-
const
|
|
1274
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1275
|
-
const ret = wasm.hash_new_sha224_hmac(ptr0, len0);
|
|
1283
|
+
static new_sha3_224() {
|
|
1284
|
+
const ret = wasm.hash_new_sha3_224();
|
|
1276
1285
|
if (ret[2]) {
|
|
1277
1286
|
throw takeFromExternrefTable0(ret[1]);
|
|
1278
1287
|
}
|
|
@@ -1281,21 +1290,18 @@ export class Hash {
|
|
|
1281
1290
|
/**
|
|
1282
1291
|
* @returns {Hash}
|
|
1283
1292
|
*/
|
|
1284
|
-
static
|
|
1285
|
-
const ret = wasm.
|
|
1293
|
+
static new_sha3_256() {
|
|
1294
|
+
const ret = wasm.hash_new_sha3_256();
|
|
1286
1295
|
if (ret[2]) {
|
|
1287
1296
|
throw takeFromExternrefTable0(ret[1]);
|
|
1288
1297
|
}
|
|
1289
1298
|
return Hash.__wrap(ret[0]);
|
|
1290
1299
|
}
|
|
1291
1300
|
/**
|
|
1292
|
-
* @param {Uint8Array} key
|
|
1293
1301
|
* @returns {Hash}
|
|
1294
1302
|
*/
|
|
1295
|
-
static
|
|
1296
|
-
const
|
|
1297
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1298
|
-
const ret = wasm.hash_new_sha256_hmac(ptr0, len0);
|
|
1303
|
+
static new_sha3_384() {
|
|
1304
|
+
const ret = wasm.hash_new_sha3_384();
|
|
1299
1305
|
if (ret[2]) {
|
|
1300
1306
|
throw takeFromExternrefTable0(ret[1]);
|
|
1301
1307
|
}
|
|
@@ -1304,21 +1310,18 @@ export class Hash {
|
|
|
1304
1310
|
/**
|
|
1305
1311
|
* @returns {Hash}
|
|
1306
1312
|
*/
|
|
1307
|
-
static
|
|
1308
|
-
const ret = wasm.
|
|
1313
|
+
static new_sha3_512() {
|
|
1314
|
+
const ret = wasm.hash_new_sha3_512();
|
|
1309
1315
|
if (ret[2]) {
|
|
1310
1316
|
throw takeFromExternrefTable0(ret[1]);
|
|
1311
1317
|
}
|
|
1312
1318
|
return Hash.__wrap(ret[0]);
|
|
1313
1319
|
}
|
|
1314
1320
|
/**
|
|
1315
|
-
* @param {Uint8Array} key
|
|
1316
1321
|
* @returns {Hash}
|
|
1317
1322
|
*/
|
|
1318
|
-
static
|
|
1319
|
-
const
|
|
1320
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1321
|
-
const ret = wasm.hash_new_sha384_hmac(ptr0, len0);
|
|
1323
|
+
static new_shake128() {
|
|
1324
|
+
const ret = wasm.hash_new_shake128();
|
|
1322
1325
|
if (ret[2]) {
|
|
1323
1326
|
throw takeFromExternrefTable0(ret[1]);
|
|
1324
1327
|
}
|
|
@@ -1327,8 +1330,8 @@ export class Hash {
|
|
|
1327
1330
|
/**
|
|
1328
1331
|
* @returns {Hash}
|
|
1329
1332
|
*/
|
|
1330
|
-
static
|
|
1331
|
-
const ret = wasm.
|
|
1333
|
+
static new_shake256() {
|
|
1334
|
+
const ret = wasm.hash_new_shake256();
|
|
1332
1335
|
if (ret[2]) {
|
|
1333
1336
|
throw takeFromExternrefTable0(ret[1]);
|
|
1334
1337
|
}
|
|
@@ -1338,33 +1341,33 @@ export class Hash {
|
|
|
1338
1341
|
* @param {Uint8Array} key
|
|
1339
1342
|
* @returns {Hash}
|
|
1340
1343
|
*/
|
|
1341
|
-
static
|
|
1344
|
+
static new_sm3_hmac(key) {
|
|
1342
1345
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1343
1346
|
const len0 = WASM_VECTOR_LEN;
|
|
1344
|
-
const ret = wasm.
|
|
1347
|
+
const ret = wasm.hash_new_sm3_hmac(ptr0, len0);
|
|
1345
1348
|
if (ret[2]) {
|
|
1346
1349
|
throw takeFromExternrefTable0(ret[1]);
|
|
1347
1350
|
}
|
|
1348
1351
|
return Hash.__wrap(ret[0]);
|
|
1349
1352
|
}
|
|
1350
1353
|
/**
|
|
1354
|
+
* @param {Uint8Array} key
|
|
1351
1355
|
* @returns {Hash}
|
|
1352
1356
|
*/
|
|
1353
|
-
static
|
|
1354
|
-
const
|
|
1357
|
+
static new_sha1_hmac(key) {
|
|
1358
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1359
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1360
|
+
const ret = wasm.hash_new_sha1_hmac(ptr0, len0);
|
|
1355
1361
|
if (ret[2]) {
|
|
1356
1362
|
throw takeFromExternrefTable0(ret[1]);
|
|
1357
1363
|
}
|
|
1358
1364
|
return Hash.__wrap(ret[0]);
|
|
1359
1365
|
}
|
|
1360
1366
|
/**
|
|
1361
|
-
* @param {Uint8Array} key
|
|
1362
1367
|
* @returns {Hash}
|
|
1363
1368
|
*/
|
|
1364
|
-
static
|
|
1365
|
-
const
|
|
1366
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1367
|
-
const ret = wasm.hash_new_sha512_224_hmac(ptr0, len0);
|
|
1369
|
+
static new_sha512_224() {
|
|
1370
|
+
const ret = wasm.hash_new_sha512_224();
|
|
1368
1371
|
if (ret[2]) {
|
|
1369
1372
|
throw takeFromExternrefTable0(ret[1]);
|
|
1370
1373
|
}
|
|
@@ -1384,20 +1387,23 @@ export class Hash {
|
|
|
1384
1387
|
* @param {Uint8Array} key
|
|
1385
1388
|
* @returns {Hash}
|
|
1386
1389
|
*/
|
|
1387
|
-
static
|
|
1390
|
+
static new_sha224_hmac(key) {
|
|
1388
1391
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1389
1392
|
const len0 = WASM_VECTOR_LEN;
|
|
1390
|
-
const ret = wasm.
|
|
1393
|
+
const ret = wasm.hash_new_sha224_hmac(ptr0, len0);
|
|
1391
1394
|
if (ret[2]) {
|
|
1392
1395
|
throw takeFromExternrefTable0(ret[1]);
|
|
1393
1396
|
}
|
|
1394
1397
|
return Hash.__wrap(ret[0]);
|
|
1395
1398
|
}
|
|
1396
1399
|
/**
|
|
1400
|
+
* @param {Uint8Array} key
|
|
1397
1401
|
* @returns {Hash}
|
|
1398
1402
|
*/
|
|
1399
|
-
static
|
|
1400
|
-
const
|
|
1403
|
+
static new_sha256_hmac(key) {
|
|
1404
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1405
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1406
|
+
const ret = wasm.hash_new_sha256_hmac(ptr0, len0);
|
|
1401
1407
|
if (ret[2]) {
|
|
1402
1408
|
throw takeFromExternrefTable0(ret[1]);
|
|
1403
1409
|
}
|
|
@@ -1407,20 +1413,23 @@ export class Hash {
|
|
|
1407
1413
|
* @param {Uint8Array} key
|
|
1408
1414
|
* @returns {Hash}
|
|
1409
1415
|
*/
|
|
1410
|
-
static
|
|
1416
|
+
static new_sha384_hmac(key) {
|
|
1411
1417
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1412
1418
|
const len0 = WASM_VECTOR_LEN;
|
|
1413
|
-
const ret = wasm.
|
|
1419
|
+
const ret = wasm.hash_new_sha384_hmac(ptr0, len0);
|
|
1414
1420
|
if (ret[2]) {
|
|
1415
1421
|
throw takeFromExternrefTable0(ret[1]);
|
|
1416
1422
|
}
|
|
1417
1423
|
return Hash.__wrap(ret[0]);
|
|
1418
1424
|
}
|
|
1419
1425
|
/**
|
|
1426
|
+
* @param {Uint8Array} key
|
|
1420
1427
|
* @returns {Hash}
|
|
1421
1428
|
*/
|
|
1422
|
-
static
|
|
1423
|
-
const
|
|
1429
|
+
static new_sha512_hmac(key) {
|
|
1430
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1431
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1432
|
+
const ret = wasm.hash_new_sha512_hmac(ptr0, len0);
|
|
1424
1433
|
if (ret[2]) {
|
|
1425
1434
|
throw takeFromExternrefTable0(ret[1]);
|
|
1426
1435
|
}
|
|
@@ -1430,20 +1439,23 @@ export class Hash {
|
|
|
1430
1439
|
* @param {Uint8Array} key
|
|
1431
1440
|
* @returns {Hash}
|
|
1432
1441
|
*/
|
|
1433
|
-
static
|
|
1442
|
+
static new_sha3_224_hmac(key) {
|
|
1434
1443
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1435
1444
|
const len0 = WASM_VECTOR_LEN;
|
|
1436
|
-
const ret = wasm.
|
|
1445
|
+
const ret = wasm.hash_new_sha3_224_hmac(ptr0, len0);
|
|
1437
1446
|
if (ret[2]) {
|
|
1438
1447
|
throw takeFromExternrefTable0(ret[1]);
|
|
1439
1448
|
}
|
|
1440
1449
|
return Hash.__wrap(ret[0]);
|
|
1441
1450
|
}
|
|
1442
1451
|
/**
|
|
1452
|
+
* @param {Uint8Array} key
|
|
1443
1453
|
* @returns {Hash}
|
|
1444
1454
|
*/
|
|
1445
|
-
static
|
|
1446
|
-
const
|
|
1455
|
+
static new_sha3_256_hmac(key) {
|
|
1456
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1457
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1458
|
+
const ret = wasm.hash_new_sha3_256_hmac(ptr0, len0);
|
|
1447
1459
|
if (ret[2]) {
|
|
1448
1460
|
throw takeFromExternrefTable0(ret[1]);
|
|
1449
1461
|
}
|
|
@@ -1462,16 +1474,6 @@ export class Hash {
|
|
|
1462
1474
|
}
|
|
1463
1475
|
return Hash.__wrap(ret[0]);
|
|
1464
1476
|
}
|
|
1465
|
-
/**
|
|
1466
|
-
* @returns {Hash}
|
|
1467
|
-
*/
|
|
1468
|
-
static new_sha3_512() {
|
|
1469
|
-
const ret = wasm.hash_new_sha3_512();
|
|
1470
|
-
if (ret[2]) {
|
|
1471
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1472
|
-
}
|
|
1473
|
-
return Hash.__wrap(ret[0]);
|
|
1474
|
-
}
|
|
1475
1477
|
/**
|
|
1476
1478
|
* @param {Uint8Array} key
|
|
1477
1479
|
* @returns {Hash}
|
|
@@ -1485,16 +1487,6 @@ export class Hash {
|
|
|
1485
1487
|
}
|
|
1486
1488
|
return Hash.__wrap(ret[0]);
|
|
1487
1489
|
}
|
|
1488
|
-
/**
|
|
1489
|
-
* @returns {Hash}
|
|
1490
|
-
*/
|
|
1491
|
-
static new_shake128() {
|
|
1492
|
-
const ret = wasm.hash_new_shake128();
|
|
1493
|
-
if (ret[2]) {
|
|
1494
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1495
|
-
}
|
|
1496
|
-
return Hash.__wrap(ret[0]);
|
|
1497
|
-
}
|
|
1498
1490
|
/**
|
|
1499
1491
|
* @param {Uint8Array} key
|
|
1500
1492
|
* @returns {Hash}
|
|
@@ -1508,16 +1500,6 @@ export class Hash {
|
|
|
1508
1500
|
}
|
|
1509
1501
|
return Hash.__wrap(ret[0]);
|
|
1510
1502
|
}
|
|
1511
|
-
/**
|
|
1512
|
-
* @returns {Hash}
|
|
1513
|
-
*/
|
|
1514
|
-
static new_shake256() {
|
|
1515
|
-
const ret = wasm.hash_new_shake256();
|
|
1516
|
-
if (ret[2]) {
|
|
1517
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1518
|
-
}
|
|
1519
|
-
return Hash.__wrap(ret[0]);
|
|
1520
|
-
}
|
|
1521
1503
|
/**
|
|
1522
1504
|
* @param {Uint8Array} key
|
|
1523
1505
|
* @returns {Hash}
|
|
@@ -1532,10 +1514,13 @@ export class Hash {
|
|
|
1532
1514
|
return Hash.__wrap(ret[0]);
|
|
1533
1515
|
}
|
|
1534
1516
|
/**
|
|
1517
|
+
* @param {Uint8Array} key
|
|
1535
1518
|
* @returns {Hash}
|
|
1536
1519
|
*/
|
|
1537
|
-
static
|
|
1538
|
-
const
|
|
1520
|
+
static new_sha512_224_hmac(key) {
|
|
1521
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1522
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1523
|
+
const ret = wasm.hash_new_sha512_224_hmac(ptr0, len0);
|
|
1539
1524
|
if (ret[2]) {
|
|
1540
1525
|
throw takeFromExternrefTable0(ret[1]);
|
|
1541
1526
|
}
|
|
@@ -1545,42 +1530,52 @@ export class Hash {
|
|
|
1545
1530
|
* @param {Uint8Array} key
|
|
1546
1531
|
* @returns {Hash}
|
|
1547
1532
|
*/
|
|
1548
|
-
static
|
|
1533
|
+
static new_sha512_256_hmac(key) {
|
|
1549
1534
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1550
1535
|
const len0 = WASM_VECTOR_LEN;
|
|
1551
|
-
const ret = wasm.
|
|
1536
|
+
const ret = wasm.hash_new_sha512_256_hmac(ptr0, len0);
|
|
1552
1537
|
if (ret[2]) {
|
|
1553
1538
|
throw takeFromExternrefTable0(ret[1]);
|
|
1554
1539
|
}
|
|
1555
1540
|
return Hash.__wrap(ret[0]);
|
|
1556
1541
|
}
|
|
1557
1542
|
/**
|
|
1558
|
-
* @
|
|
1559
|
-
* @param {number} output_len
|
|
1560
|
-
* @returns {Hash}
|
|
1543
|
+
* @returns {Uint8Array}
|
|
1561
1544
|
*/
|
|
1562
|
-
|
|
1563
|
-
|
|
1545
|
+
sum() {
|
|
1546
|
+
const ret = wasm.hash_sum(this.__wbg_ptr);
|
|
1547
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1548
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1549
|
+
return v1;
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* @param {Uint8Array} buf
|
|
1553
|
+
* @returns {number}
|
|
1554
|
+
*/
|
|
1555
|
+
read(buf) {
|
|
1556
|
+
var ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
|
|
1564
1557
|
var len0 = WASM_VECTOR_LEN;
|
|
1565
|
-
const ret = wasm.
|
|
1558
|
+
const ret = wasm.hash_read(this.__wbg_ptr, ptr0, len0, buf);
|
|
1566
1559
|
if (ret[2]) {
|
|
1567
1560
|
throw takeFromExternrefTable0(ret[1]);
|
|
1568
1561
|
}
|
|
1569
|
-
return
|
|
1562
|
+
return ret[0] >>> 0;
|
|
1570
1563
|
}
|
|
1571
1564
|
/**
|
|
1572
|
-
* @
|
|
1573
|
-
* @param {number} output_len
|
|
1574
|
-
* @returns {Hash}
|
|
1565
|
+
* @returns {number}
|
|
1575
1566
|
*/
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1567
|
+
size() {
|
|
1568
|
+
const ret = wasm.hash_size(this.__wbg_ptr);
|
|
1569
|
+
return ret >>> 0;
|
|
1570
|
+
}
|
|
1571
|
+
flush() {
|
|
1572
|
+
const ret = wasm.hash_flush(this.__wbg_ptr);
|
|
1573
|
+
if (ret[1]) {
|
|
1574
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1582
1575
|
}
|
|
1583
|
-
|
|
1576
|
+
}
|
|
1577
|
+
reset() {
|
|
1578
|
+
wasm.hash_reset(this.__wbg_ptr);
|
|
1584
1579
|
}
|
|
1585
1580
|
/**
|
|
1586
1581
|
* @param {Uint8Array} data
|
|
@@ -1595,50 +1590,55 @@ export class Hash {
|
|
|
1595
1590
|
}
|
|
1596
1591
|
return ret[0] >>> 0;
|
|
1597
1592
|
}
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1593
|
+
/**
|
|
1594
|
+
* @returns {Hash}
|
|
1595
|
+
*/
|
|
1596
|
+
static new_md2() {
|
|
1597
|
+
const ret = wasm.hash_new_md2();
|
|
1598
|
+
if (ret[2]) {
|
|
1599
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1602
1600
|
}
|
|
1601
|
+
return Hash.__wrap(ret[0]);
|
|
1603
1602
|
}
|
|
1604
1603
|
/**
|
|
1605
|
-
* @
|
|
1606
|
-
* @returns {number}
|
|
1604
|
+
* @returns {Hash}
|
|
1607
1605
|
*/
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
var len0 = WASM_VECTOR_LEN;
|
|
1611
|
-
const ret = wasm.hash_read(this.__wbg_ptr, ptr0, len0, buf);
|
|
1606
|
+
static new_md4() {
|
|
1607
|
+
const ret = wasm.hash_new_md4();
|
|
1612
1608
|
if (ret[2]) {
|
|
1613
1609
|
throw takeFromExternrefTable0(ret[1]);
|
|
1614
1610
|
}
|
|
1615
|
-
return ret[0]
|
|
1611
|
+
return Hash.__wrap(ret[0]);
|
|
1616
1612
|
}
|
|
1617
1613
|
/**
|
|
1618
|
-
* @returns {
|
|
1614
|
+
* @returns {Hash}
|
|
1619
1615
|
*/
|
|
1620
|
-
|
|
1621
|
-
const ret = wasm.
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
reset() {
|
|
1627
|
-
wasm.hash_reset(this.__wbg_ptr);
|
|
1616
|
+
static new_md5() {
|
|
1617
|
+
const ret = wasm.hash_new_md5();
|
|
1618
|
+
if (ret[2]) {
|
|
1619
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1620
|
+
}
|
|
1621
|
+
return Hash.__wrap(ret[0]);
|
|
1628
1622
|
}
|
|
1629
1623
|
/**
|
|
1630
|
-
* @returns {
|
|
1624
|
+
* @returns {Hash}
|
|
1631
1625
|
*/
|
|
1632
|
-
|
|
1633
|
-
const ret = wasm.
|
|
1634
|
-
|
|
1626
|
+
static new_sm3() {
|
|
1627
|
+
const ret = wasm.hash_new_sm3();
|
|
1628
|
+
if (ret[2]) {
|
|
1629
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1630
|
+
}
|
|
1631
|
+
return Hash.__wrap(ret[0]);
|
|
1635
1632
|
}
|
|
1636
1633
|
/**
|
|
1637
|
-
* @returns {
|
|
1634
|
+
* @returns {Hash}
|
|
1638
1635
|
*/
|
|
1639
|
-
|
|
1640
|
-
const ret = wasm.
|
|
1641
|
-
|
|
1636
|
+
static new_sha1() {
|
|
1637
|
+
const ret = wasm.hash_new_sha1();
|
|
1638
|
+
if (ret[2]) {
|
|
1639
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1640
|
+
}
|
|
1641
|
+
return Hash.__wrap(ret[0]);
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
1644
|
if (Symbol.dispose) Hash.prototype[Symbol.dispose] = Hash.prototype.free;
|
|
@@ -1673,12 +1673,12 @@ export class StreamCipher {
|
|
|
1673
1673
|
* @param {Uint8Array} iv
|
|
1674
1674
|
* @returns {StreamCipher}
|
|
1675
1675
|
*/
|
|
1676
|
-
static
|
|
1676
|
+
static new_rabbit(key, iv) {
|
|
1677
1677
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1678
1678
|
const len0 = WASM_VECTOR_LEN;
|
|
1679
1679
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1680
1680
|
const len1 = WASM_VECTOR_LEN;
|
|
1681
|
-
const ret = wasm.
|
|
1681
|
+
const ret = wasm.streamcipher_new_rabbit(ptr0, len0, ptr1, len1);
|
|
1682
1682
|
if (ret[2]) {
|
|
1683
1683
|
throw takeFromExternrefTable0(ret[1]);
|
|
1684
1684
|
}
|
|
@@ -1689,12 +1689,12 @@ export class StreamCipher {
|
|
|
1689
1689
|
* @param {Uint8Array} iv
|
|
1690
1690
|
* @returns {StreamCipher}
|
|
1691
1691
|
*/
|
|
1692
|
-
static
|
|
1692
|
+
static new_aes_cfb(key, iv) {
|
|
1693
1693
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1694
1694
|
const len0 = WASM_VECTOR_LEN;
|
|
1695
1695
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1696
1696
|
const len1 = WASM_VECTOR_LEN;
|
|
1697
|
-
const ret = wasm.
|
|
1697
|
+
const ret = wasm.streamcipher_new_aes_cfb(ptr0, len0, ptr1, len1);
|
|
1698
1698
|
if (ret[2]) {
|
|
1699
1699
|
throw takeFromExternrefTable0(ret[1]);
|
|
1700
1700
|
}
|
|
@@ -1705,12 +1705,12 @@ export class StreamCipher {
|
|
|
1705
1705
|
* @param {Uint8Array} iv
|
|
1706
1706
|
* @returns {StreamCipher}
|
|
1707
1707
|
*/
|
|
1708
|
-
static
|
|
1708
|
+
static new_aes_ctr(key, iv) {
|
|
1709
1709
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1710
1710
|
const len0 = WASM_VECTOR_LEN;
|
|
1711
1711
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1712
1712
|
const len1 = WASM_VECTOR_LEN;
|
|
1713
|
-
const ret = wasm.
|
|
1713
|
+
const ret = wasm.streamcipher_new_aes_ctr(ptr0, len0, ptr1, len1);
|
|
1714
1714
|
if (ret[2]) {
|
|
1715
1715
|
throw takeFromExternrefTable0(ret[1]);
|
|
1716
1716
|
}
|
|
@@ -1721,12 +1721,12 @@ export class StreamCipher {
|
|
|
1721
1721
|
* @param {Uint8Array} iv
|
|
1722
1722
|
* @returns {StreamCipher}
|
|
1723
1723
|
*/
|
|
1724
|
-
static
|
|
1724
|
+
static new_aes_ofb(key, iv) {
|
|
1725
1725
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1726
1726
|
const len0 = WASM_VECTOR_LEN;
|
|
1727
1727
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1728
1728
|
const len1 = WASM_VECTOR_LEN;
|
|
1729
|
-
const ret = wasm.
|
|
1729
|
+
const ret = wasm.streamcipher_new_aes_ofb(ptr0, len0, ptr1, len1);
|
|
1730
1730
|
if (ret[2]) {
|
|
1731
1731
|
throw takeFromExternrefTable0(ret[1]);
|
|
1732
1732
|
}
|
|
@@ -1737,12 +1737,12 @@ export class StreamCipher {
|
|
|
1737
1737
|
* @param {Uint8Array} iv
|
|
1738
1738
|
* @returns {StreamCipher}
|
|
1739
1739
|
*/
|
|
1740
|
-
static
|
|
1740
|
+
static new_des_cfb(key, iv) {
|
|
1741
1741
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1742
1742
|
const len0 = WASM_VECTOR_LEN;
|
|
1743
1743
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1744
1744
|
const len1 = WASM_VECTOR_LEN;
|
|
1745
|
-
const ret = wasm.
|
|
1745
|
+
const ret = wasm.streamcipher_new_des_cfb(ptr0, len0, ptr1, len1);
|
|
1746
1746
|
if (ret[2]) {
|
|
1747
1747
|
throw takeFromExternrefTable0(ret[1]);
|
|
1748
1748
|
}
|
|
@@ -1753,12 +1753,12 @@ export class StreamCipher {
|
|
|
1753
1753
|
* @param {Uint8Array} iv
|
|
1754
1754
|
* @returns {StreamCipher}
|
|
1755
1755
|
*/
|
|
1756
|
-
static
|
|
1756
|
+
static new_des_ctr(key, iv) {
|
|
1757
1757
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1758
1758
|
const len0 = WASM_VECTOR_LEN;
|
|
1759
1759
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1760
1760
|
const len1 = WASM_VECTOR_LEN;
|
|
1761
|
-
const ret = wasm.
|
|
1761
|
+
const ret = wasm.streamcipher_new_des_ctr(ptr0, len0, ptr1, len1);
|
|
1762
1762
|
if (ret[2]) {
|
|
1763
1763
|
throw takeFromExternrefTable0(ret[1]);
|
|
1764
1764
|
}
|
|
@@ -1769,12 +1769,12 @@ export class StreamCipher {
|
|
|
1769
1769
|
* @param {Uint8Array} iv
|
|
1770
1770
|
* @returns {StreamCipher}
|
|
1771
1771
|
*/
|
|
1772
|
-
static
|
|
1772
|
+
static new_des_ofb(key, iv) {
|
|
1773
1773
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1774
1774
|
const len0 = WASM_VECTOR_LEN;
|
|
1775
1775
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1776
1776
|
const len1 = WASM_VECTOR_LEN;
|
|
1777
|
-
const ret = wasm.
|
|
1777
|
+
const ret = wasm.streamcipher_new_des_ofb(ptr0, len0, ptr1, len1);
|
|
1778
1778
|
if (ret[2]) {
|
|
1779
1779
|
throw takeFromExternrefTable0(ret[1]);
|
|
1780
1780
|
}
|
|
@@ -1783,14 +1783,15 @@ export class StreamCipher {
|
|
|
1783
1783
|
/**
|
|
1784
1784
|
* @param {Uint8Array} key
|
|
1785
1785
|
* @param {Uint8Array} iv
|
|
1786
|
+
* @param {number | null} [rounds]
|
|
1786
1787
|
* @returns {StreamCipher}
|
|
1787
1788
|
*/
|
|
1788
|
-
static
|
|
1789
|
+
static new_rc2_cfb(key, iv, rounds) {
|
|
1789
1790
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1790
1791
|
const len0 = WASM_VECTOR_LEN;
|
|
1791
1792
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1792
1793
|
const len1 = WASM_VECTOR_LEN;
|
|
1793
|
-
const ret = wasm.
|
|
1794
|
+
const ret = wasm.streamcipher_new_rc2_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1794
1795
|
if (ret[2]) {
|
|
1795
1796
|
throw takeFromExternrefTable0(ret[1]);
|
|
1796
1797
|
}
|
|
@@ -1799,14 +1800,15 @@ export class StreamCipher {
|
|
|
1799
1800
|
/**
|
|
1800
1801
|
* @param {Uint8Array} key
|
|
1801
1802
|
* @param {Uint8Array} iv
|
|
1803
|
+
* @param {number | null} [rounds]
|
|
1802
1804
|
* @returns {StreamCipher}
|
|
1803
1805
|
*/
|
|
1804
|
-
static
|
|
1806
|
+
static new_rc2_ctr(key, iv, rounds) {
|
|
1805
1807
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1806
1808
|
const len0 = WASM_VECTOR_LEN;
|
|
1807
1809
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1808
1810
|
const len1 = WASM_VECTOR_LEN;
|
|
1809
|
-
const ret = wasm.
|
|
1811
|
+
const ret = wasm.streamcipher_new_rc2_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1810
1812
|
if (ret[2]) {
|
|
1811
1813
|
throw takeFromExternrefTable0(ret[1]);
|
|
1812
1814
|
}
|
|
@@ -1815,14 +1817,15 @@ export class StreamCipher {
|
|
|
1815
1817
|
/**
|
|
1816
1818
|
* @param {Uint8Array} key
|
|
1817
1819
|
* @param {Uint8Array} iv
|
|
1820
|
+
* @param {number | null} [rounds]
|
|
1818
1821
|
* @returns {StreamCipher}
|
|
1819
1822
|
*/
|
|
1820
|
-
static
|
|
1823
|
+
static new_rc2_ofb(key, iv, rounds) {
|
|
1821
1824
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1822
1825
|
const len0 = WASM_VECTOR_LEN;
|
|
1823
1826
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1824
1827
|
const len1 = WASM_VECTOR_LEN;
|
|
1825
|
-
const ret = wasm.
|
|
1828
|
+
const ret = wasm.streamcipher_new_rc2_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1826
1829
|
if (ret[2]) {
|
|
1827
1830
|
throw takeFromExternrefTable0(ret[1]);
|
|
1828
1831
|
}
|
|
@@ -1831,14 +1834,15 @@ export class StreamCipher {
|
|
|
1831
1834
|
/**
|
|
1832
1835
|
* @param {Uint8Array} key
|
|
1833
1836
|
* @param {Uint8Array} iv
|
|
1837
|
+
* @param {number | null} [rounds]
|
|
1834
1838
|
* @returns {StreamCipher}
|
|
1835
1839
|
*/
|
|
1836
|
-
static
|
|
1840
|
+
static new_rc5_cfb(key, iv, rounds) {
|
|
1837
1841
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1838
1842
|
const len0 = WASM_VECTOR_LEN;
|
|
1839
1843
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1840
1844
|
const len1 = WASM_VECTOR_LEN;
|
|
1841
|
-
const ret = wasm.
|
|
1845
|
+
const ret = wasm.streamcipher_new_rc5_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1842
1846
|
if (ret[2]) {
|
|
1843
1847
|
throw takeFromExternrefTable0(ret[1]);
|
|
1844
1848
|
}
|
|
@@ -1847,14 +1851,15 @@ export class StreamCipher {
|
|
|
1847
1851
|
/**
|
|
1848
1852
|
* @param {Uint8Array} key
|
|
1849
1853
|
* @param {Uint8Array} iv
|
|
1854
|
+
* @param {number | null} [rounds]
|
|
1850
1855
|
* @returns {StreamCipher}
|
|
1851
1856
|
*/
|
|
1852
|
-
static
|
|
1857
|
+
static new_rc5_ctr(key, iv, rounds) {
|
|
1853
1858
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1854
1859
|
const len0 = WASM_VECTOR_LEN;
|
|
1855
1860
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1856
1861
|
const len1 = WASM_VECTOR_LEN;
|
|
1857
|
-
const ret = wasm.
|
|
1862
|
+
const ret = wasm.streamcipher_new_rc5_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1858
1863
|
if (ret[2]) {
|
|
1859
1864
|
throw takeFromExternrefTable0(ret[1]);
|
|
1860
1865
|
}
|
|
@@ -1863,14 +1868,15 @@ export class StreamCipher {
|
|
|
1863
1868
|
/**
|
|
1864
1869
|
* @param {Uint8Array} key
|
|
1865
1870
|
* @param {Uint8Array} iv
|
|
1871
|
+
* @param {number | null} [rounds]
|
|
1866
1872
|
* @returns {StreamCipher}
|
|
1867
1873
|
*/
|
|
1868
|
-
static
|
|
1874
|
+
static new_rc5_ofb(key, iv, rounds) {
|
|
1869
1875
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1870
1876
|
const len0 = WASM_VECTOR_LEN;
|
|
1871
1877
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1872
1878
|
const len1 = WASM_VECTOR_LEN;
|
|
1873
|
-
const ret = wasm.
|
|
1879
|
+
const ret = wasm.streamcipher_new_rc5_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1874
1880
|
if (ret[2]) {
|
|
1875
1881
|
throw takeFromExternrefTable0(ret[1]);
|
|
1876
1882
|
}
|
|
@@ -1881,12 +1887,12 @@ export class StreamCipher {
|
|
|
1881
1887
|
* @param {Uint8Array} iv
|
|
1882
1888
|
* @returns {StreamCipher}
|
|
1883
1889
|
*/
|
|
1884
|
-
static
|
|
1890
|
+
static new_rc6_cfb(key, iv) {
|
|
1885
1891
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1886
1892
|
const len0 = WASM_VECTOR_LEN;
|
|
1887
1893
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1888
1894
|
const len1 = WASM_VECTOR_LEN;
|
|
1889
|
-
const ret = wasm.
|
|
1895
|
+
const ret = wasm.streamcipher_new_rc6_cfb(ptr0, len0, ptr1, len1);
|
|
1890
1896
|
if (ret[2]) {
|
|
1891
1897
|
throw takeFromExternrefTable0(ret[1]);
|
|
1892
1898
|
}
|
|
@@ -1897,12 +1903,12 @@ export class StreamCipher {
|
|
|
1897
1903
|
* @param {Uint8Array} iv
|
|
1898
1904
|
* @returns {StreamCipher}
|
|
1899
1905
|
*/
|
|
1900
|
-
static
|
|
1906
|
+
static new_rc6_ctr(key, iv) {
|
|
1901
1907
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1902
1908
|
const len0 = WASM_VECTOR_LEN;
|
|
1903
1909
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1904
1910
|
const len1 = WASM_VECTOR_LEN;
|
|
1905
|
-
const ret = wasm.
|
|
1911
|
+
const ret = wasm.streamcipher_new_rc6_ctr(ptr0, len0, ptr1, len1);
|
|
1906
1912
|
if (ret[2]) {
|
|
1907
1913
|
throw takeFromExternrefTable0(ret[1]);
|
|
1908
1914
|
}
|
|
@@ -1913,12 +1919,12 @@ export class StreamCipher {
|
|
|
1913
1919
|
* @param {Uint8Array} iv
|
|
1914
1920
|
* @returns {StreamCipher}
|
|
1915
1921
|
*/
|
|
1916
|
-
static
|
|
1922
|
+
static new_rc6_ofb(key, iv) {
|
|
1917
1923
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1918
1924
|
const len0 = WASM_VECTOR_LEN;
|
|
1919
1925
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1920
1926
|
const len1 = WASM_VECTOR_LEN;
|
|
1921
|
-
const ret = wasm.
|
|
1927
|
+
const ret = wasm.streamcipher_new_rc6_ofb(ptr0, len0, ptr1, len1);
|
|
1922
1928
|
if (ret[2]) {
|
|
1923
1929
|
throw takeFromExternrefTable0(ret[1]);
|
|
1924
1930
|
}
|
|
@@ -1929,12 +1935,12 @@ export class StreamCipher {
|
|
|
1929
1935
|
* @param {Uint8Array} iv
|
|
1930
1936
|
* @returns {StreamCipher}
|
|
1931
1937
|
*/
|
|
1932
|
-
static
|
|
1938
|
+
static new_salsa20(key, iv) {
|
|
1933
1939
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1934
1940
|
const len0 = WASM_VECTOR_LEN;
|
|
1935
1941
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1936
1942
|
const len1 = WASM_VECTOR_LEN;
|
|
1937
|
-
const ret = wasm.
|
|
1943
|
+
const ret = wasm.streamcipher_new_salsa20(ptr0, len0, ptr1, len1);
|
|
1938
1944
|
if (ret[2]) {
|
|
1939
1945
|
throw takeFromExternrefTable0(ret[1]);
|
|
1940
1946
|
}
|
|
@@ -1945,12 +1951,12 @@ export class StreamCipher {
|
|
|
1945
1951
|
* @param {Uint8Array} iv
|
|
1946
1952
|
* @returns {StreamCipher}
|
|
1947
1953
|
*/
|
|
1948
|
-
static
|
|
1954
|
+
static new_sm4_cfb(key, iv) {
|
|
1949
1955
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1950
1956
|
const len0 = WASM_VECTOR_LEN;
|
|
1951
1957
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1952
1958
|
const len1 = WASM_VECTOR_LEN;
|
|
1953
|
-
const ret = wasm.
|
|
1959
|
+
const ret = wasm.streamcipher_new_sm4_cfb(ptr0, len0, ptr1, len1);
|
|
1954
1960
|
if (ret[2]) {
|
|
1955
1961
|
throw takeFromExternrefTable0(ret[1]);
|
|
1956
1962
|
}
|
|
@@ -1961,12 +1967,12 @@ export class StreamCipher {
|
|
|
1961
1967
|
* @param {Uint8Array} iv
|
|
1962
1968
|
* @returns {StreamCipher}
|
|
1963
1969
|
*/
|
|
1964
|
-
static
|
|
1970
|
+
static new_sm4_ctr(key, iv) {
|
|
1965
1971
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1966
1972
|
const len0 = WASM_VECTOR_LEN;
|
|
1967
1973
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1968
1974
|
const len1 = WASM_VECTOR_LEN;
|
|
1969
|
-
const ret = wasm.
|
|
1975
|
+
const ret = wasm.streamcipher_new_sm4_ctr(ptr0, len0, ptr1, len1);
|
|
1970
1976
|
if (ret[2]) {
|
|
1971
1977
|
throw takeFromExternrefTable0(ret[1]);
|
|
1972
1978
|
}
|
|
@@ -1977,12 +1983,12 @@ export class StreamCipher {
|
|
|
1977
1983
|
* @param {Uint8Array} iv
|
|
1978
1984
|
* @returns {StreamCipher}
|
|
1979
1985
|
*/
|
|
1980
|
-
static
|
|
1986
|
+
static new_sm4_ofb(key, iv) {
|
|
1981
1987
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1982
1988
|
const len0 = WASM_VECTOR_LEN;
|
|
1983
1989
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1984
1990
|
const len1 = WASM_VECTOR_LEN;
|
|
1985
|
-
const ret = wasm.
|
|
1991
|
+
const ret = wasm.streamcipher_new_sm4_ofb(ptr0, len0, ptr1, len1);
|
|
1986
1992
|
if (ret[2]) {
|
|
1987
1993
|
throw takeFromExternrefTable0(ret[1]);
|
|
1988
1994
|
}
|
|
@@ -1993,12 +1999,12 @@ export class StreamCipher {
|
|
|
1993
1999
|
* @param {Uint8Array} iv
|
|
1994
2000
|
* @returns {StreamCipher}
|
|
1995
2001
|
*/
|
|
1996
|
-
static
|
|
2002
|
+
static new_tea_cfb(key, iv) {
|
|
1997
2003
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1998
2004
|
const len0 = WASM_VECTOR_LEN;
|
|
1999
2005
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2000
2006
|
const len1 = WASM_VECTOR_LEN;
|
|
2001
|
-
const ret = wasm.
|
|
2007
|
+
const ret = wasm.streamcipher_new_tea_cfb(ptr0, len0, ptr1, len1);
|
|
2002
2008
|
if (ret[2]) {
|
|
2003
2009
|
throw takeFromExternrefTable0(ret[1]);
|
|
2004
2010
|
}
|
|
@@ -2009,12 +2015,12 @@ export class StreamCipher {
|
|
|
2009
2015
|
* @param {Uint8Array} iv
|
|
2010
2016
|
* @returns {StreamCipher}
|
|
2011
2017
|
*/
|
|
2012
|
-
static
|
|
2018
|
+
static new_tea_ctr(key, iv) {
|
|
2013
2019
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2014
2020
|
const len0 = WASM_VECTOR_LEN;
|
|
2015
2021
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2016
2022
|
const len1 = WASM_VECTOR_LEN;
|
|
2017
|
-
const ret = wasm.
|
|
2023
|
+
const ret = wasm.streamcipher_new_tea_ctr(ptr0, len0, ptr1, len1);
|
|
2018
2024
|
if (ret[2]) {
|
|
2019
2025
|
throw takeFromExternrefTable0(ret[1]);
|
|
2020
2026
|
}
|
|
@@ -2025,12 +2031,12 @@ export class StreamCipher {
|
|
|
2025
2031
|
* @param {Uint8Array} iv
|
|
2026
2032
|
* @returns {StreamCipher}
|
|
2027
2033
|
*/
|
|
2028
|
-
static
|
|
2034
|
+
static new_tea_ofb(key, iv) {
|
|
2029
2035
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2030
2036
|
const len0 = WASM_VECTOR_LEN;
|
|
2031
2037
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2032
2038
|
const len1 = WASM_VECTOR_LEN;
|
|
2033
|
-
const ret = wasm.
|
|
2039
|
+
const ret = wasm.streamcipher_new_tea_ofb(ptr0, len0, ptr1, len1);
|
|
2034
2040
|
if (ret[2]) {
|
|
2035
2041
|
throw takeFromExternrefTable0(ret[1]);
|
|
2036
2042
|
}
|
|
@@ -2041,12 +2047,12 @@ export class StreamCipher {
|
|
|
2041
2047
|
* @param {Uint8Array} iv
|
|
2042
2048
|
* @returns {StreamCipher}
|
|
2043
2049
|
*/
|
|
2044
|
-
static
|
|
2050
|
+
static new_chacha20(key, iv) {
|
|
2045
2051
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2046
2052
|
const len0 = WASM_VECTOR_LEN;
|
|
2047
2053
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2048
2054
|
const len1 = WASM_VECTOR_LEN;
|
|
2049
|
-
const ret = wasm.
|
|
2055
|
+
const ret = wasm.streamcipher_new_chacha20(ptr0, len0, ptr1, len1);
|
|
2050
2056
|
if (ret[2]) {
|
|
2051
2057
|
throw takeFromExternrefTable0(ret[1]);
|
|
2052
2058
|
}
|
|
@@ -2105,12 +2111,12 @@ export class StreamCipher {
|
|
|
2105
2111
|
* @param {Uint8Array} iv
|
|
2106
2112
|
* @returns {StreamCipher}
|
|
2107
2113
|
*/
|
|
2108
|
-
static
|
|
2114
|
+
static new_sober128(key, iv) {
|
|
2109
2115
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2110
2116
|
const len0 = WASM_VECTOR_LEN;
|
|
2111
2117
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2112
2118
|
const len1 = WASM_VECTOR_LEN;
|
|
2113
|
-
const ret = wasm.
|
|
2119
|
+
const ret = wasm.streamcipher_new_sober128(ptr0, len0, ptr1, len1);
|
|
2114
2120
|
if (ret[2]) {
|
|
2115
2121
|
throw takeFromExternrefTable0(ret[1]);
|
|
2116
2122
|
}
|
|
@@ -2121,12 +2127,12 @@ export class StreamCipher {
|
|
|
2121
2127
|
* @param {Uint8Array} iv
|
|
2122
2128
|
* @returns {StreamCipher}
|
|
2123
2129
|
*/
|
|
2124
|
-
static
|
|
2130
|
+
static new_xtea_cfb(key, iv) {
|
|
2125
2131
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2126
2132
|
const len0 = WASM_VECTOR_LEN;
|
|
2127
2133
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2128
2134
|
const len1 = WASM_VECTOR_LEN;
|
|
2129
|
-
const ret = wasm.
|
|
2135
|
+
const ret = wasm.streamcipher_new_xtea_cfb(ptr0, len0, ptr1, len1);
|
|
2130
2136
|
if (ret[2]) {
|
|
2131
2137
|
throw takeFromExternrefTable0(ret[1]);
|
|
2132
2138
|
}
|
|
@@ -2137,12 +2143,12 @@ export class StreamCipher {
|
|
|
2137
2143
|
* @param {Uint8Array} iv
|
|
2138
2144
|
* @returns {StreamCipher}
|
|
2139
2145
|
*/
|
|
2140
|
-
static
|
|
2146
|
+
static new_xtea_ctr(key, iv) {
|
|
2141
2147
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2142
2148
|
const len0 = WASM_VECTOR_LEN;
|
|
2143
2149
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2144
2150
|
const len1 = WASM_VECTOR_LEN;
|
|
2145
|
-
const ret = wasm.
|
|
2151
|
+
const ret = wasm.streamcipher_new_xtea_ctr(ptr0, len0, ptr1, len1);
|
|
2146
2152
|
if (ret[2]) {
|
|
2147
2153
|
throw takeFromExternrefTable0(ret[1]);
|
|
2148
2154
|
}
|
|
@@ -2153,12 +2159,12 @@ export class StreamCipher {
|
|
|
2153
2159
|
* @param {Uint8Array} iv
|
|
2154
2160
|
* @returns {StreamCipher}
|
|
2155
2161
|
*/
|
|
2156
|
-
static
|
|
2162
|
+
static new_xtea_ofb(key, iv) {
|
|
2157
2163
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2158
2164
|
const len0 = WASM_VECTOR_LEN;
|
|
2159
2165
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2160
2166
|
const len1 = WASM_VECTOR_LEN;
|
|
2161
|
-
const ret = wasm.
|
|
2167
|
+
const ret = wasm.streamcipher_new_xtea_ofb(ptr0, len0, ptr1, len1);
|
|
2162
2168
|
if (ret[2]) {
|
|
2163
2169
|
throw takeFromExternrefTable0(ret[1]);
|
|
2164
2170
|
}
|
|
@@ -2169,12 +2175,12 @@ export class StreamCipher {
|
|
|
2169
2175
|
* @param {Uint8Array} iv
|
|
2170
2176
|
* @returns {StreamCipher}
|
|
2171
2177
|
*/
|
|
2172
|
-
static
|
|
2178
|
+
static new_cast5_cfb(key, iv) {
|
|
2173
2179
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2174
2180
|
const len0 = WASM_VECTOR_LEN;
|
|
2175
2181
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2176
2182
|
const len1 = WASM_VECTOR_LEN;
|
|
2177
|
-
const ret = wasm.
|
|
2183
|
+
const ret = wasm.streamcipher_new_cast5_cfb(ptr0, len0, ptr1, len1);
|
|
2178
2184
|
if (ret[2]) {
|
|
2179
2185
|
throw takeFromExternrefTable0(ret[1]);
|
|
2180
2186
|
}
|
|
@@ -2185,12 +2191,12 @@ export class StreamCipher {
|
|
|
2185
2191
|
* @param {Uint8Array} iv
|
|
2186
2192
|
* @returns {StreamCipher}
|
|
2187
2193
|
*/
|
|
2188
|
-
static
|
|
2194
|
+
static new_cast5_ctr(key, iv) {
|
|
2189
2195
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2190
2196
|
const len0 = WASM_VECTOR_LEN;
|
|
2191
2197
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2192
2198
|
const len1 = WASM_VECTOR_LEN;
|
|
2193
|
-
const ret = wasm.
|
|
2199
|
+
const ret = wasm.streamcipher_new_cast5_ctr(ptr0, len0, ptr1, len1);
|
|
2194
2200
|
if (ret[2]) {
|
|
2195
2201
|
throw takeFromExternrefTable0(ret[1]);
|
|
2196
2202
|
}
|
|
@@ -2201,12 +2207,12 @@ export class StreamCipher {
|
|
|
2201
2207
|
* @param {Uint8Array} iv
|
|
2202
2208
|
* @returns {StreamCipher}
|
|
2203
2209
|
*/
|
|
2204
|
-
static
|
|
2210
|
+
static new_cast5_ofb(key, iv) {
|
|
2205
2211
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2206
2212
|
const len0 = WASM_VECTOR_LEN;
|
|
2207
2213
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2208
2214
|
const len1 = WASM_VECTOR_LEN;
|
|
2209
|
-
const ret = wasm.
|
|
2215
|
+
const ret = wasm.streamcipher_new_cast5_ofb(ptr0, len0, ptr1, len1);
|
|
2210
2216
|
if (ret[2]) {
|
|
2211
2217
|
throw takeFromExternrefTable0(ret[1]);
|
|
2212
2218
|
}
|
|
@@ -2217,12 +2223,12 @@ export class StreamCipher {
|
|
|
2217
2223
|
* @param {Uint8Array} iv
|
|
2218
2224
|
* @returns {StreamCipher}
|
|
2219
2225
|
*/
|
|
2220
|
-
static
|
|
2226
|
+
static new_kseed_cfb(key, iv) {
|
|
2221
2227
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2222
2228
|
const len0 = WASM_VECTOR_LEN;
|
|
2223
2229
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2224
2230
|
const len1 = WASM_VECTOR_LEN;
|
|
2225
|
-
const ret = wasm.
|
|
2231
|
+
const ret = wasm.streamcipher_new_kseed_cfb(ptr0, len0, ptr1, len1);
|
|
2226
2232
|
if (ret[2]) {
|
|
2227
2233
|
throw takeFromExternrefTable0(ret[1]);
|
|
2228
2234
|
}
|
|
@@ -2233,12 +2239,12 @@ export class StreamCipher {
|
|
|
2233
2239
|
* @param {Uint8Array} iv
|
|
2234
2240
|
* @returns {StreamCipher}
|
|
2235
2241
|
*/
|
|
2236
|
-
static
|
|
2242
|
+
static new_kseed_ctr(key, iv) {
|
|
2237
2243
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2238
2244
|
const len0 = WASM_VECTOR_LEN;
|
|
2239
2245
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2240
2246
|
const len1 = WASM_VECTOR_LEN;
|
|
2241
|
-
const ret = wasm.
|
|
2247
|
+
const ret = wasm.streamcipher_new_kseed_ctr(ptr0, len0, ptr1, len1);
|
|
2242
2248
|
if (ret[2]) {
|
|
2243
2249
|
throw takeFromExternrefTable0(ret[1]);
|
|
2244
2250
|
}
|
|
@@ -2249,12 +2255,12 @@ export class StreamCipher {
|
|
|
2249
2255
|
* @param {Uint8Array} iv
|
|
2250
2256
|
* @returns {StreamCipher}
|
|
2251
2257
|
*/
|
|
2252
|
-
static
|
|
2258
|
+
static new_kseed_ofb(key, iv) {
|
|
2253
2259
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2254
2260
|
const len0 = WASM_VECTOR_LEN;
|
|
2255
2261
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2256
2262
|
const len1 = WASM_VECTOR_LEN;
|
|
2257
|
-
const ret = wasm.
|
|
2263
|
+
const ret = wasm.streamcipher_new_kseed_ofb(ptr0, len0, ptr1, len1);
|
|
2258
2264
|
if (ret[2]) {
|
|
2259
2265
|
throw takeFromExternrefTable0(ret[1]);
|
|
2260
2266
|
}
|
|
@@ -2265,12 +2271,12 @@ export class StreamCipher {
|
|
|
2265
2271
|
* @param {Uint8Array} iv
|
|
2266
2272
|
* @returns {StreamCipher}
|
|
2267
2273
|
*/
|
|
2268
|
-
static
|
|
2274
|
+
static new_sosemanuk(key, iv) {
|
|
2269
2275
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2270
2276
|
const len0 = WASM_VECTOR_LEN;
|
|
2271
2277
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2272
2278
|
const len1 = WASM_VECTOR_LEN;
|
|
2273
|
-
const ret = wasm.
|
|
2279
|
+
const ret = wasm.streamcipher_new_sosemanuk(ptr0, len0, ptr1, len1);
|
|
2274
2280
|
if (ret[2]) {
|
|
2275
2281
|
throw takeFromExternrefTable0(ret[1]);
|
|
2276
2282
|
}
|
|
@@ -2281,12 +2287,12 @@ export class StreamCipher {
|
|
|
2281
2287
|
* @param {Uint8Array} iv
|
|
2282
2288
|
* @returns {StreamCipher}
|
|
2283
2289
|
*/
|
|
2284
|
-
static
|
|
2290
|
+
static new_anubis_cfb(key, iv) {
|
|
2285
2291
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2286
2292
|
const len0 = WASM_VECTOR_LEN;
|
|
2287
2293
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2288
2294
|
const len1 = WASM_VECTOR_LEN;
|
|
2289
|
-
const ret = wasm.
|
|
2295
|
+
const ret = wasm.streamcipher_new_anubis_cfb(ptr0, len0, ptr1, len1);
|
|
2290
2296
|
if (ret[2]) {
|
|
2291
2297
|
throw takeFromExternrefTable0(ret[1]);
|
|
2292
2298
|
}
|
|
@@ -2297,12 +2303,12 @@ export class StreamCipher {
|
|
|
2297
2303
|
* @param {Uint8Array} iv
|
|
2298
2304
|
* @returns {StreamCipher}
|
|
2299
2305
|
*/
|
|
2300
|
-
static
|
|
2306
|
+
static new_anubis_ctr(key, iv) {
|
|
2301
2307
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2302
2308
|
const len0 = WASM_VECTOR_LEN;
|
|
2303
2309
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2304
2310
|
const len1 = WASM_VECTOR_LEN;
|
|
2305
|
-
const ret = wasm.
|
|
2311
|
+
const ret = wasm.streamcipher_new_anubis_ctr(ptr0, len0, ptr1, len1);
|
|
2306
2312
|
if (ret[2]) {
|
|
2307
2313
|
throw takeFromExternrefTable0(ret[1]);
|
|
2308
2314
|
}
|
|
@@ -2313,12 +2319,12 @@ export class StreamCipher {
|
|
|
2313
2319
|
* @param {Uint8Array} iv
|
|
2314
2320
|
* @returns {StreamCipher}
|
|
2315
2321
|
*/
|
|
2316
|
-
static
|
|
2322
|
+
static new_anubis_ofb(key, iv) {
|
|
2317
2323
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2318
2324
|
const len0 = WASM_VECTOR_LEN;
|
|
2319
2325
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2320
2326
|
const len1 = WASM_VECTOR_LEN;
|
|
2321
|
-
const ret = wasm.
|
|
2327
|
+
const ret = wasm.streamcipher_new_anubis_ofb(ptr0, len0, ptr1, len1);
|
|
2322
2328
|
if (ret[2]) {
|
|
2323
2329
|
throw takeFromExternrefTable0(ret[1]);
|
|
2324
2330
|
}
|
|
@@ -2329,12 +2335,12 @@ export class StreamCipher {
|
|
|
2329
2335
|
* @param {Uint8Array} iv
|
|
2330
2336
|
* @returns {StreamCipher}
|
|
2331
2337
|
*/
|
|
2332
|
-
static
|
|
2338
|
+
static new_kasumi_cfb(key, iv) {
|
|
2333
2339
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2334
2340
|
const len0 = WASM_VECTOR_LEN;
|
|
2335
2341
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2336
2342
|
const len1 = WASM_VECTOR_LEN;
|
|
2337
|
-
const ret = wasm.
|
|
2343
|
+
const ret = wasm.streamcipher_new_kasumi_cfb(ptr0, len0, ptr1, len1);
|
|
2338
2344
|
if (ret[2]) {
|
|
2339
2345
|
throw takeFromExternrefTable0(ret[1]);
|
|
2340
2346
|
}
|
|
@@ -2345,12 +2351,12 @@ export class StreamCipher {
|
|
|
2345
2351
|
* @param {Uint8Array} iv
|
|
2346
2352
|
* @returns {StreamCipher}
|
|
2347
2353
|
*/
|
|
2348
|
-
static
|
|
2354
|
+
static new_kasumi_ctr(key, iv) {
|
|
2349
2355
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2350
2356
|
const len0 = WASM_VECTOR_LEN;
|
|
2351
2357
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2352
2358
|
const len1 = WASM_VECTOR_LEN;
|
|
2353
|
-
const ret = wasm.
|
|
2359
|
+
const ret = wasm.streamcipher_new_kasumi_ctr(ptr0, len0, ptr1, len1);
|
|
2354
2360
|
if (ret[2]) {
|
|
2355
2361
|
throw takeFromExternrefTable0(ret[1]);
|
|
2356
2362
|
}
|
|
@@ -2361,12 +2367,12 @@ export class StreamCipher {
|
|
|
2361
2367
|
* @param {Uint8Array} iv
|
|
2362
2368
|
* @returns {StreamCipher}
|
|
2363
2369
|
*/
|
|
2364
|
-
static
|
|
2370
|
+
static new_kasumi_ofb(key, iv) {
|
|
2365
2371
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2366
2372
|
const len0 = WASM_VECTOR_LEN;
|
|
2367
2373
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2368
2374
|
const len1 = WASM_VECTOR_LEN;
|
|
2369
|
-
const ret = wasm.
|
|
2375
|
+
const ret = wasm.streamcipher_new_kasumi_ofb(ptr0, len0, ptr1, len1);
|
|
2370
2376
|
if (ret[2]) {
|
|
2371
2377
|
throw takeFromExternrefTable0(ret[1]);
|
|
2372
2378
|
}
|
|
@@ -2377,12 +2383,12 @@ export class StreamCipher {
|
|
|
2377
2383
|
* @param {Uint8Array} iv
|
|
2378
2384
|
* @returns {StreamCipher}
|
|
2379
2385
|
*/
|
|
2380
|
-
static
|
|
2386
|
+
static new_khazad_cfb(key, iv) {
|
|
2381
2387
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2382
2388
|
const len0 = WASM_VECTOR_LEN;
|
|
2383
2389
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2384
2390
|
const len1 = WASM_VECTOR_LEN;
|
|
2385
|
-
const ret = wasm.
|
|
2391
|
+
const ret = wasm.streamcipher_new_khazad_cfb(ptr0, len0, ptr1, len1);
|
|
2386
2392
|
if (ret[2]) {
|
|
2387
2393
|
throw takeFromExternrefTable0(ret[1]);
|
|
2388
2394
|
}
|
|
@@ -2393,12 +2399,12 @@ export class StreamCipher {
|
|
|
2393
2399
|
* @param {Uint8Array} iv
|
|
2394
2400
|
* @returns {StreamCipher}
|
|
2395
2401
|
*/
|
|
2396
|
-
static
|
|
2402
|
+
static new_khazad_ctr(key, iv) {
|
|
2397
2403
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2398
2404
|
const len0 = WASM_VECTOR_LEN;
|
|
2399
2405
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2400
2406
|
const len1 = WASM_VECTOR_LEN;
|
|
2401
|
-
const ret = wasm.
|
|
2407
|
+
const ret = wasm.streamcipher_new_khazad_ctr(ptr0, len0, ptr1, len1);
|
|
2402
2408
|
if (ret[2]) {
|
|
2403
2409
|
throw takeFromExternrefTable0(ret[1]);
|
|
2404
2410
|
}
|
|
@@ -2409,12 +2415,12 @@ export class StreamCipher {
|
|
|
2409
2415
|
* @param {Uint8Array} iv
|
|
2410
2416
|
* @returns {StreamCipher}
|
|
2411
2417
|
*/
|
|
2412
|
-
static
|
|
2418
|
+
static new_khazad_ofb(key, iv) {
|
|
2413
2419
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2414
2420
|
const len0 = WASM_VECTOR_LEN;
|
|
2415
2421
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2416
2422
|
const len1 = WASM_VECTOR_LEN;
|
|
2417
|
-
const ret = wasm.
|
|
2423
|
+
const ret = wasm.streamcipher_new_khazad_ofb(ptr0, len0, ptr1, len1);
|
|
2418
2424
|
if (ret[2]) {
|
|
2419
2425
|
throw takeFromExternrefTable0(ret[1]);
|
|
2420
2426
|
}
|
|
@@ -2423,14 +2429,15 @@ export class StreamCipher {
|
|
|
2423
2429
|
/**
|
|
2424
2430
|
* @param {Uint8Array} key
|
|
2425
2431
|
* @param {Uint8Array} iv
|
|
2432
|
+
* @param {number | null} [rounds]
|
|
2426
2433
|
* @returns {StreamCipher}
|
|
2427
2434
|
*/
|
|
2428
|
-
static
|
|
2435
|
+
static new_multi2_cfb(key, iv, rounds) {
|
|
2429
2436
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2430
2437
|
const len0 = WASM_VECTOR_LEN;
|
|
2431
2438
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2432
2439
|
const len1 = WASM_VECTOR_LEN;
|
|
2433
|
-
const ret = wasm.
|
|
2440
|
+
const ret = wasm.streamcipher_new_multi2_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2434
2441
|
if (ret[2]) {
|
|
2435
2442
|
throw takeFromExternrefTable0(ret[1]);
|
|
2436
2443
|
}
|
|
@@ -2439,14 +2446,15 @@ export class StreamCipher {
|
|
|
2439
2446
|
/**
|
|
2440
2447
|
* @param {Uint8Array} key
|
|
2441
2448
|
* @param {Uint8Array} iv
|
|
2449
|
+
* @param {number | null} [rounds]
|
|
2442
2450
|
* @returns {StreamCipher}
|
|
2443
2451
|
*/
|
|
2444
|
-
static
|
|
2452
|
+
static new_multi2_ctr(key, iv, rounds) {
|
|
2445
2453
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2446
2454
|
const len0 = WASM_VECTOR_LEN;
|
|
2447
2455
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2448
2456
|
const len1 = WASM_VECTOR_LEN;
|
|
2449
|
-
const ret = wasm.
|
|
2457
|
+
const ret = wasm.streamcipher_new_multi2_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2450
2458
|
if (ret[2]) {
|
|
2451
2459
|
throw takeFromExternrefTable0(ret[1]);
|
|
2452
2460
|
}
|
|
@@ -2455,14 +2463,15 @@ export class StreamCipher {
|
|
|
2455
2463
|
/**
|
|
2456
2464
|
* @param {Uint8Array} key
|
|
2457
2465
|
* @param {Uint8Array} iv
|
|
2466
|
+
* @param {number | null} [rounds]
|
|
2458
2467
|
* @returns {StreamCipher}
|
|
2459
2468
|
*/
|
|
2460
|
-
static
|
|
2469
|
+
static new_multi2_ofb(key, iv, rounds) {
|
|
2461
2470
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2462
2471
|
const len0 = WASM_VECTOR_LEN;
|
|
2463
2472
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2464
2473
|
const len1 = WASM_VECTOR_LEN;
|
|
2465
|
-
const ret = wasm.
|
|
2474
|
+
const ret = wasm.streamcipher_new_multi2_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2466
2475
|
if (ret[2]) {
|
|
2467
2476
|
throw takeFromExternrefTable0(ret[1]);
|
|
2468
2477
|
}
|
|
@@ -2473,12 +2482,12 @@ export class StreamCipher {
|
|
|
2473
2482
|
* @param {Uint8Array} iv
|
|
2474
2483
|
* @returns {StreamCipher}
|
|
2475
2484
|
*/
|
|
2476
|
-
static
|
|
2485
|
+
static new_noekeon_cfb(key, iv) {
|
|
2477
2486
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2478
2487
|
const len0 = WASM_VECTOR_LEN;
|
|
2479
2488
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2480
2489
|
const len1 = WASM_VECTOR_LEN;
|
|
2481
|
-
const ret = wasm.
|
|
2490
|
+
const ret = wasm.streamcipher_new_noekeon_cfb(ptr0, len0, ptr1, len1);
|
|
2482
2491
|
if (ret[2]) {
|
|
2483
2492
|
throw takeFromExternrefTable0(ret[1]);
|
|
2484
2493
|
}
|
|
@@ -2489,12 +2498,12 @@ export class StreamCipher {
|
|
|
2489
2498
|
* @param {Uint8Array} iv
|
|
2490
2499
|
* @returns {StreamCipher}
|
|
2491
2500
|
*/
|
|
2492
|
-
static
|
|
2501
|
+
static new_noekeon_ctr(key, iv) {
|
|
2493
2502
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2494
2503
|
const len0 = WASM_VECTOR_LEN;
|
|
2495
2504
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2496
2505
|
const len1 = WASM_VECTOR_LEN;
|
|
2497
|
-
const ret = wasm.
|
|
2506
|
+
const ret = wasm.streamcipher_new_noekeon_ctr(ptr0, len0, ptr1, len1);
|
|
2498
2507
|
if (ret[2]) {
|
|
2499
2508
|
throw takeFromExternrefTable0(ret[1]);
|
|
2500
2509
|
}
|
|
@@ -2505,12 +2514,12 @@ export class StreamCipher {
|
|
|
2505
2514
|
* @param {Uint8Array} iv
|
|
2506
2515
|
* @returns {StreamCipher}
|
|
2507
2516
|
*/
|
|
2508
|
-
static
|
|
2517
|
+
static new_noekeon_ofb(key, iv) {
|
|
2509
2518
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2510
2519
|
const len0 = WASM_VECTOR_LEN;
|
|
2511
2520
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2512
2521
|
const len1 = WASM_VECTOR_LEN;
|
|
2513
|
-
const ret = wasm.
|
|
2522
|
+
const ret = wasm.streamcipher_new_noekeon_ofb(ptr0, len0, ptr1, len1);
|
|
2514
2523
|
if (ret[2]) {
|
|
2515
2524
|
throw takeFromExternrefTable0(ret[1]);
|
|
2516
2525
|
}
|
|
@@ -2521,12 +2530,12 @@ export class StreamCipher {
|
|
|
2521
2530
|
* @param {Uint8Array} iv
|
|
2522
2531
|
* @returns {StreamCipher}
|
|
2523
2532
|
*/
|
|
2524
|
-
static
|
|
2533
|
+
static new_serpent_cfb(key, iv) {
|
|
2525
2534
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2526
2535
|
const len0 = WASM_VECTOR_LEN;
|
|
2527
2536
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2528
2537
|
const len1 = WASM_VECTOR_LEN;
|
|
2529
|
-
const ret = wasm.
|
|
2538
|
+
const ret = wasm.streamcipher_new_serpent_cfb(ptr0, len0, ptr1, len1);
|
|
2530
2539
|
if (ret[2]) {
|
|
2531
2540
|
throw takeFromExternrefTable0(ret[1]);
|
|
2532
2541
|
}
|
|
@@ -2535,15 +2544,14 @@ export class StreamCipher {
|
|
|
2535
2544
|
/**
|
|
2536
2545
|
* @param {Uint8Array} key
|
|
2537
2546
|
* @param {Uint8Array} iv
|
|
2538
|
-
* @param {number | null} [rounds]
|
|
2539
2547
|
* @returns {StreamCipher}
|
|
2540
2548
|
*/
|
|
2541
|
-
static
|
|
2549
|
+
static new_serpent_ctr(key, iv) {
|
|
2542
2550
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2543
2551
|
const len0 = WASM_VECTOR_LEN;
|
|
2544
2552
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2545
2553
|
const len1 = WASM_VECTOR_LEN;
|
|
2546
|
-
const ret = wasm.
|
|
2554
|
+
const ret = wasm.streamcipher_new_serpent_ctr(ptr0, len0, ptr1, len1);
|
|
2547
2555
|
if (ret[2]) {
|
|
2548
2556
|
throw takeFromExternrefTable0(ret[1]);
|
|
2549
2557
|
}
|
|
@@ -2552,15 +2560,14 @@ export class StreamCipher {
|
|
|
2552
2560
|
/**
|
|
2553
2561
|
* @param {Uint8Array} key
|
|
2554
2562
|
* @param {Uint8Array} iv
|
|
2555
|
-
* @param {number | null} [rounds]
|
|
2556
2563
|
* @returns {StreamCipher}
|
|
2557
2564
|
*/
|
|
2558
|
-
static
|
|
2565
|
+
static new_serpent_ofb(key, iv) {
|
|
2559
2566
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2560
2567
|
const len0 = WASM_VECTOR_LEN;
|
|
2561
2568
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2562
2569
|
const len1 = WASM_VECTOR_LEN;
|
|
2563
|
-
const ret = wasm.
|
|
2570
|
+
const ret = wasm.streamcipher_new_serpent_ofb(ptr0, len0, ptr1, len1);
|
|
2564
2571
|
if (ret[2]) {
|
|
2565
2572
|
throw takeFromExternrefTable0(ret[1]);
|
|
2566
2573
|
}
|
|
@@ -2569,15 +2576,14 @@ export class StreamCipher {
|
|
|
2569
2576
|
/**
|
|
2570
2577
|
* @param {Uint8Array} key
|
|
2571
2578
|
* @param {Uint8Array} iv
|
|
2572
|
-
* @param {number | null} [rounds]
|
|
2573
2579
|
* @returns {StreamCipher}
|
|
2574
2580
|
*/
|
|
2575
|
-
static
|
|
2581
|
+
static new_twofish_cfb(key, iv) {
|
|
2576
2582
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2577
2583
|
const len0 = WASM_VECTOR_LEN;
|
|
2578
2584
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2579
2585
|
const len1 = WASM_VECTOR_LEN;
|
|
2580
|
-
const ret = wasm.
|
|
2586
|
+
const ret = wasm.streamcipher_new_twofish_cfb(ptr0, len0, ptr1, len1);
|
|
2581
2587
|
if (ret[2]) {
|
|
2582
2588
|
throw takeFromExternrefTable0(ret[1]);
|
|
2583
2589
|
}
|
|
@@ -2586,15 +2592,14 @@ export class StreamCipher {
|
|
|
2586
2592
|
/**
|
|
2587
2593
|
* @param {Uint8Array} key
|
|
2588
2594
|
* @param {Uint8Array} iv
|
|
2589
|
-
* @param {number | null} [rounds]
|
|
2590
2595
|
* @returns {StreamCipher}
|
|
2591
2596
|
*/
|
|
2592
|
-
static
|
|
2597
|
+
static new_twofish_ctr(key, iv) {
|
|
2593
2598
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2594
2599
|
const len0 = WASM_VECTOR_LEN;
|
|
2595
2600
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2596
2601
|
const len1 = WASM_VECTOR_LEN;
|
|
2597
|
-
const ret = wasm.
|
|
2602
|
+
const ret = wasm.streamcipher_new_twofish_ctr(ptr0, len0, ptr1, len1);
|
|
2598
2603
|
if (ret[2]) {
|
|
2599
2604
|
throw takeFromExternrefTable0(ret[1]);
|
|
2600
2605
|
}
|
|
@@ -2603,15 +2608,14 @@ export class StreamCipher {
|
|
|
2603
2608
|
/**
|
|
2604
2609
|
* @param {Uint8Array} key
|
|
2605
2610
|
* @param {Uint8Array} iv
|
|
2606
|
-
* @param {number | null} [rounds]
|
|
2607
2611
|
* @returns {StreamCipher}
|
|
2608
2612
|
*/
|
|
2609
|
-
static
|
|
2613
|
+
static new_twofish_ofb(key, iv) {
|
|
2610
2614
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2611
2615
|
const len0 = WASM_VECTOR_LEN;
|
|
2612
2616
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2613
2617
|
const len1 = WASM_VECTOR_LEN;
|
|
2614
|
-
const ret = wasm.
|
|
2618
|
+
const ret = wasm.streamcipher_new_twofish_ofb(ptr0, len0, ptr1, len1);
|
|
2615
2619
|
if (ret[2]) {
|
|
2616
2620
|
throw takeFromExternrefTable0(ret[1]);
|
|
2617
2621
|
}
|
|
@@ -2620,15 +2624,14 @@ export class StreamCipher {
|
|
|
2620
2624
|
/**
|
|
2621
2625
|
* @param {Uint8Array} key
|
|
2622
2626
|
* @param {Uint8Array} iv
|
|
2623
|
-
* @param {number | null} [rounds]
|
|
2624
2627
|
* @returns {StreamCipher}
|
|
2625
2628
|
*/
|
|
2626
|
-
static
|
|
2629
|
+
static new_blowfish_cfb(key, iv) {
|
|
2627
2630
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2628
2631
|
const len0 = WASM_VECTOR_LEN;
|
|
2629
2632
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2630
2633
|
const len1 = WASM_VECTOR_LEN;
|
|
2631
|
-
const ret = wasm.
|
|
2634
|
+
const ret = wasm.streamcipher_new_blowfish_cfb(ptr0, len0, ptr1, len1);
|
|
2632
2635
|
if (ret[2]) {
|
|
2633
2636
|
throw takeFromExternrefTable0(ret[1]);
|
|
2634
2637
|
}
|
|
@@ -2637,15 +2640,14 @@ export class StreamCipher {
|
|
|
2637
2640
|
/**
|
|
2638
2641
|
* @param {Uint8Array} key
|
|
2639
2642
|
* @param {Uint8Array} iv
|
|
2640
|
-
* @param {number | null} [rounds]
|
|
2641
2643
|
* @returns {StreamCipher}
|
|
2642
2644
|
*/
|
|
2643
|
-
static
|
|
2645
|
+
static new_blowfish_ctr(key, iv) {
|
|
2644
2646
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2645
2647
|
const len0 = WASM_VECTOR_LEN;
|
|
2646
2648
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2647
2649
|
const len1 = WASM_VECTOR_LEN;
|
|
2648
|
-
const ret = wasm.
|
|
2650
|
+
const ret = wasm.streamcipher_new_blowfish_ctr(ptr0, len0, ptr1, len1);
|
|
2649
2651
|
if (ret[2]) {
|
|
2650
2652
|
throw takeFromExternrefTable0(ret[1]);
|
|
2651
2653
|
}
|
|
@@ -2654,15 +2656,14 @@ export class StreamCipher {
|
|
|
2654
2656
|
/**
|
|
2655
2657
|
* @param {Uint8Array} key
|
|
2656
2658
|
* @param {Uint8Array} iv
|
|
2657
|
-
* @param {number | null} [rounds]
|
|
2658
2659
|
* @returns {StreamCipher}
|
|
2659
2660
|
*/
|
|
2660
|
-
static
|
|
2661
|
+
static new_blowfish_ofb(key, iv) {
|
|
2661
2662
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2662
2663
|
const len0 = WASM_VECTOR_LEN;
|
|
2663
2664
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2664
2665
|
const len1 = WASM_VECTOR_LEN;
|
|
2665
|
-
const ret = wasm.
|
|
2666
|
+
const ret = wasm.streamcipher_new_blowfish_ofb(ptr0, len0, ptr1, len1);
|
|
2666
2667
|
if (ret[2]) {
|
|
2667
2668
|
throw takeFromExternrefTable0(ret[1]);
|
|
2668
2669
|
}
|
|
@@ -2674,12 +2675,12 @@ export class StreamCipher {
|
|
|
2674
2675
|
* @param {number | null} [rounds]
|
|
2675
2676
|
* @returns {StreamCipher}
|
|
2676
2677
|
*/
|
|
2677
|
-
static
|
|
2678
|
+
static new_camellia_cfb(key, iv, rounds) {
|
|
2678
2679
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2679
2680
|
const len0 = WASM_VECTOR_LEN;
|
|
2680
2681
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2681
2682
|
const len1 = WASM_VECTOR_LEN;
|
|
2682
|
-
const ret = wasm.
|
|
2683
|
+
const ret = wasm.streamcipher_new_camellia_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2683
2684
|
if (ret[2]) {
|
|
2684
2685
|
throw takeFromExternrefTable0(ret[1]);
|
|
2685
2686
|
}
|
|
@@ -2691,12 +2692,12 @@ export class StreamCipher {
|
|
|
2691
2692
|
* @param {number | null} [rounds]
|
|
2692
2693
|
* @returns {StreamCipher}
|
|
2693
2694
|
*/
|
|
2694
|
-
static
|
|
2695
|
+
static new_camellia_ctr(key, iv, rounds) {
|
|
2695
2696
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2696
2697
|
const len0 = WASM_VECTOR_LEN;
|
|
2697
2698
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2698
2699
|
const len1 = WASM_VECTOR_LEN;
|
|
2699
|
-
const ret = wasm.
|
|
2700
|
+
const ret = wasm.streamcipher_new_camellia_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2700
2701
|
if (ret[2]) {
|
|
2701
2702
|
throw takeFromExternrefTable0(ret[1]);
|
|
2702
2703
|
}
|
|
@@ -2708,12 +2709,12 @@ export class StreamCipher {
|
|
|
2708
2709
|
* @param {number | null} [rounds]
|
|
2709
2710
|
* @returns {StreamCipher}
|
|
2710
2711
|
*/
|
|
2711
|
-
static
|
|
2712
|
+
static new_camellia_ofb(key, iv, rounds) {
|
|
2712
2713
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2713
2714
|
const len0 = WASM_VECTOR_LEN;
|
|
2714
2715
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2715
2716
|
const len1 = WASM_VECTOR_LEN;
|
|
2716
|
-
const ret = wasm.
|
|
2717
|
+
const ret = wasm.streamcipher_new_camellia_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2717
2718
|
if (ret[2]) {
|
|
2718
2719
|
throw takeFromExternrefTable0(ret[1]);
|
|
2719
2720
|
}
|
|
@@ -2722,28 +2723,14 @@ export class StreamCipher {
|
|
|
2722
2723
|
/**
|
|
2723
2724
|
* @param {Uint8Array} key
|
|
2724
2725
|
* @param {Uint8Array} iv
|
|
2725
|
-
* @param {number | null} [rounds]
|
|
2726
2726
|
* @returns {StreamCipher}
|
|
2727
2727
|
*/
|
|
2728
|
-
static
|
|
2728
|
+
static new_skipjack_cfb(key, iv) {
|
|
2729
2729
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2730
2730
|
const len0 = WASM_VECTOR_LEN;
|
|
2731
2731
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2732
2732
|
const len1 = WASM_VECTOR_LEN;
|
|
2733
|
-
const ret = wasm.
|
|
2734
|
-
if (ret[2]) {
|
|
2735
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2736
|
-
}
|
|
2737
|
-
return StreamCipher.__wrap(ret[0]);
|
|
2738
|
-
}
|
|
2739
|
-
/**
|
|
2740
|
-
* @param {Uint8Array} key
|
|
2741
|
-
* @returns {StreamCipher}
|
|
2742
|
-
*/
|
|
2743
|
-
static new_rc4(key) {
|
|
2744
|
-
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2745
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2746
|
-
const ret = wasm.streamcipher_new_rc4(ptr0, len0);
|
|
2733
|
+
const ret = wasm.streamcipher_new_skipjack_cfb(ptr0, len0, ptr1, len1);
|
|
2747
2734
|
if (ret[2]) {
|
|
2748
2735
|
throw takeFromExternrefTable0(ret[1]);
|
|
2749
2736
|
}
|
|
@@ -2754,12 +2741,12 @@ export class StreamCipher {
|
|
|
2754
2741
|
* @param {Uint8Array} iv
|
|
2755
2742
|
* @returns {StreamCipher}
|
|
2756
2743
|
*/
|
|
2757
|
-
static
|
|
2744
|
+
static new_skipjack_ctr(key, iv) {
|
|
2758
2745
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2759
2746
|
const len0 = WASM_VECTOR_LEN;
|
|
2760
2747
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2761
2748
|
const len1 = WASM_VECTOR_LEN;
|
|
2762
|
-
const ret = wasm.
|
|
2749
|
+
const ret = wasm.streamcipher_new_skipjack_ctr(ptr0, len0, ptr1, len1);
|
|
2763
2750
|
if (ret[2]) {
|
|
2764
2751
|
throw takeFromExternrefTable0(ret[1]);
|
|
2765
2752
|
}
|
|
@@ -2770,12 +2757,12 @@ export class StreamCipher {
|
|
|
2770
2757
|
* @param {Uint8Array} iv
|
|
2771
2758
|
* @returns {StreamCipher}
|
|
2772
2759
|
*/
|
|
2773
|
-
static
|
|
2760
|
+
static new_skipjack_ofb(key, iv) {
|
|
2774
2761
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2775
2762
|
const len0 = WASM_VECTOR_LEN;
|
|
2776
2763
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2777
2764
|
const len1 = WASM_VECTOR_LEN;
|
|
2778
|
-
const ret = wasm.
|
|
2765
|
+
const ret = wasm.streamcipher_new_skipjack_ofb(ptr0, len0, ptr1, len1);
|
|
2779
2766
|
if (ret[2]) {
|
|
2780
2767
|
throw takeFromExternrefTable0(ret[1]);
|
|
2781
2768
|
}
|
|
@@ -2786,12 +2773,12 @@ export class StreamCipher {
|
|
|
2786
2773
|
* @param {Uint8Array} iv
|
|
2787
2774
|
* @returns {StreamCipher}
|
|
2788
2775
|
*/
|
|
2789
|
-
static
|
|
2776
|
+
static new_tripledes_cfb(key, iv) {
|
|
2790
2777
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2791
2778
|
const len0 = WASM_VECTOR_LEN;
|
|
2792
2779
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2793
2780
|
const len1 = WASM_VECTOR_LEN;
|
|
2794
|
-
const ret = wasm.
|
|
2781
|
+
const ret = wasm.streamcipher_new_tripledes_cfb(ptr0, len0, ptr1, len1);
|
|
2795
2782
|
if (ret[2]) {
|
|
2796
2783
|
throw takeFromExternrefTable0(ret[1]);
|
|
2797
2784
|
}
|
|
@@ -2802,12 +2789,12 @@ export class StreamCipher {
|
|
|
2802
2789
|
* @param {Uint8Array} iv
|
|
2803
2790
|
* @returns {StreamCipher}
|
|
2804
2791
|
*/
|
|
2805
|
-
static
|
|
2792
|
+
static new_tripledes_ctr(key, iv) {
|
|
2806
2793
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2807
2794
|
const len0 = WASM_VECTOR_LEN;
|
|
2808
2795
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2809
2796
|
const len1 = WASM_VECTOR_LEN;
|
|
2810
|
-
const ret = wasm.
|
|
2797
|
+
const ret = wasm.streamcipher_new_tripledes_ctr(ptr0, len0, ptr1, len1);
|
|
2811
2798
|
if (ret[2]) {
|
|
2812
2799
|
throw takeFromExternrefTable0(ret[1]);
|
|
2813
2800
|
}
|
|
@@ -2818,12 +2805,12 @@ export class StreamCipher {
|
|
|
2818
2805
|
* @param {Uint8Array} iv
|
|
2819
2806
|
* @returns {StreamCipher}
|
|
2820
2807
|
*/
|
|
2821
|
-
static
|
|
2808
|
+
static new_tripledes_ofb(key, iv) {
|
|
2822
2809
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2823
2810
|
const len0 = WASM_VECTOR_LEN;
|
|
2824
2811
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2825
2812
|
const len1 = WASM_VECTOR_LEN;
|
|
2826
|
-
const ret = wasm.
|
|
2813
|
+
const ret = wasm.streamcipher_new_tripledes_ofb(ptr0, len0, ptr1, len1);
|
|
2827
2814
|
if (ret[2]) {
|
|
2828
2815
|
throw takeFromExternrefTable0(ret[1]);
|
|
2829
2816
|
}
|
|
@@ -2832,10 +2819,10 @@ export class StreamCipher {
|
|
|
2832
2819
|
/**
|
|
2833
2820
|
* @param {Uint8Array} data
|
|
2834
2821
|
*/
|
|
2835
|
-
|
|
2822
|
+
decrypt(data) {
|
|
2836
2823
|
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2837
2824
|
var len0 = WASM_VECTOR_LEN;
|
|
2838
|
-
const ret = wasm.
|
|
2825
|
+
const ret = wasm.streamcipher_decrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
2839
2826
|
if (ret[1]) {
|
|
2840
2827
|
throw takeFromExternrefTable0(ret[0]);
|
|
2841
2828
|
}
|
|
@@ -2843,14 +2830,27 @@ export class StreamCipher {
|
|
|
2843
2830
|
/**
|
|
2844
2831
|
* @param {Uint8Array} data
|
|
2845
2832
|
*/
|
|
2846
|
-
|
|
2833
|
+
encrypt(data) {
|
|
2847
2834
|
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2848
2835
|
var len0 = WASM_VECTOR_LEN;
|
|
2849
|
-
const ret = wasm.
|
|
2836
|
+
const ret = wasm.streamcipher_encrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
2850
2837
|
if (ret[1]) {
|
|
2851
2838
|
throw takeFromExternrefTable0(ret[0]);
|
|
2852
2839
|
}
|
|
2853
2840
|
}
|
|
2841
|
+
/**
|
|
2842
|
+
* @param {Uint8Array} key
|
|
2843
|
+
* @returns {StreamCipher}
|
|
2844
|
+
*/
|
|
2845
|
+
static new_rc4(key) {
|
|
2846
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2847
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2848
|
+
const ret = wasm.streamcipher_new_rc4(ptr0, len0);
|
|
2849
|
+
if (ret[2]) {
|
|
2850
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2851
|
+
}
|
|
2852
|
+
return StreamCipher.__wrap(ret[0]);
|
|
2853
|
+
}
|
|
2854
2854
|
}
|
|
2855
2855
|
if (Symbol.dispose) StreamCipher.prototype[Symbol.dispose] = StreamCipher.prototype.free;
|
|
2856
2856
|
|