@cathaysia/crown-wasm 0.26.5 → 0.26.6
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 +166 -166
- package/crown_wasm_bg.js +688 -688
- package/crown_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/crown_wasm_bg.js
CHANGED
|
@@ -83,23 +83,14 @@ 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
|
-
}
|
|
93
86
|
/**
|
|
94
87
|
* @param {Uint8Array} key
|
|
95
|
-
* @param {number} tag_size
|
|
96
|
-
* @param {number} nonce_size
|
|
97
88
|
* @returns {AeadCipher}
|
|
98
89
|
*/
|
|
99
|
-
static
|
|
90
|
+
static new_kasumi_gcm(key) {
|
|
100
91
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
101
92
|
const len0 = WASM_VECTOR_LEN;
|
|
102
|
-
const ret = wasm.
|
|
93
|
+
const ret = wasm.aeadcipher_new_kasumi_gcm(ptr0, len0);
|
|
103
94
|
if (ret[2]) {
|
|
104
95
|
throw takeFromExternrefTable0(ret[1]);
|
|
105
96
|
}
|
|
@@ -111,10 +102,10 @@ export class AeadCipher {
|
|
|
111
102
|
* @param {number} nonce_size
|
|
112
103
|
* @returns {AeadCipher}
|
|
113
104
|
*/
|
|
114
|
-
static
|
|
105
|
+
static new_kasumi_ocb3(key, tag_size, nonce_size) {
|
|
115
106
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
116
107
|
const len0 = WASM_VECTOR_LEN;
|
|
117
|
-
const ret = wasm.
|
|
108
|
+
const ret = wasm.aeadcipher_new_kasumi_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
118
109
|
if (ret[2]) {
|
|
119
110
|
throw takeFromExternrefTable0(ret[1]);
|
|
120
111
|
}
|
|
@@ -122,12 +113,14 @@ export class AeadCipher {
|
|
|
122
113
|
}
|
|
123
114
|
/**
|
|
124
115
|
* @param {Uint8Array} key
|
|
116
|
+
* @param {number} tag_size
|
|
117
|
+
* @param {number} nonce_size
|
|
125
118
|
* @returns {AeadCipher}
|
|
126
119
|
*/
|
|
127
|
-
static
|
|
120
|
+
static new_kasumi_ccm(key, tag_size, nonce_size) {
|
|
128
121
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
129
122
|
const len0 = WASM_VECTOR_LEN;
|
|
130
|
-
const ret = wasm.
|
|
123
|
+
const ret = wasm.aeadcipher_new_kasumi_ccm(ptr0, len0, tag_size, nonce_size);
|
|
131
124
|
if (ret[2]) {
|
|
132
125
|
throw takeFromExternrefTable0(ret[1]);
|
|
133
126
|
}
|
|
@@ -139,10 +132,10 @@ export class AeadCipher {
|
|
|
139
132
|
* @param {number} nonce_size
|
|
140
133
|
* @returns {AeadCipher}
|
|
141
134
|
*/
|
|
142
|
-
static
|
|
135
|
+
static new_kasumi_eax(key, tag_size, nonce_size) {
|
|
143
136
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
144
137
|
const len0 = WASM_VECTOR_LEN;
|
|
145
|
-
const ret = wasm.
|
|
138
|
+
const ret = wasm.aeadcipher_new_kasumi_eax(ptr0, len0, tag_size, nonce_size);
|
|
146
139
|
if (ret[2]) {
|
|
147
140
|
throw takeFromExternrefTable0(ret[1]);
|
|
148
141
|
}
|
|
@@ -150,14 +143,12 @@ export class AeadCipher {
|
|
|
150
143
|
}
|
|
151
144
|
/**
|
|
152
145
|
* @param {Uint8Array} key
|
|
153
|
-
* @param {number} tag_size
|
|
154
|
-
* @param {number} nonce_size
|
|
155
146
|
* @returns {AeadCipher}
|
|
156
147
|
*/
|
|
157
|
-
static
|
|
148
|
+
static new_kseed_gcm(key) {
|
|
158
149
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
159
150
|
const len0 = WASM_VECTOR_LEN;
|
|
160
|
-
const ret = wasm.
|
|
151
|
+
const ret = wasm.aeadcipher_new_kseed_gcm(ptr0, len0);
|
|
161
152
|
if (ret[2]) {
|
|
162
153
|
throw takeFromExternrefTable0(ret[1]);
|
|
163
154
|
}
|
|
@@ -165,12 +156,14 @@ export class AeadCipher {
|
|
|
165
156
|
}
|
|
166
157
|
/**
|
|
167
158
|
* @param {Uint8Array} key
|
|
159
|
+
* @param {number} tag_size
|
|
160
|
+
* @param {number} nonce_size
|
|
168
161
|
* @returns {AeadCipher}
|
|
169
162
|
*/
|
|
170
|
-
static
|
|
163
|
+
static new_kseed_ocb3(key, tag_size, nonce_size) {
|
|
171
164
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
172
165
|
const len0 = WASM_VECTOR_LEN;
|
|
173
|
-
const ret = wasm.
|
|
166
|
+
const ret = wasm.aeadcipher_new_kseed_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
174
167
|
if (ret[2]) {
|
|
175
168
|
throw takeFromExternrefTable0(ret[1]);
|
|
176
169
|
}
|
|
@@ -180,13 +173,12 @@ export class AeadCipher {
|
|
|
180
173
|
* @param {Uint8Array} key
|
|
181
174
|
* @param {number} tag_size
|
|
182
175
|
* @param {number} nonce_size
|
|
183
|
-
* @param {number | null} [rounds]
|
|
184
176
|
* @returns {AeadCipher}
|
|
185
177
|
*/
|
|
186
|
-
static
|
|
178
|
+
static new_kseed_ccm(key, tag_size, nonce_size) {
|
|
187
179
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
188
180
|
const len0 = WASM_VECTOR_LEN;
|
|
189
|
-
const ret = wasm.
|
|
181
|
+
const ret = wasm.aeadcipher_new_kseed_ccm(ptr0, len0, tag_size, nonce_size);
|
|
190
182
|
if (ret[2]) {
|
|
191
183
|
throw takeFromExternrefTable0(ret[1]);
|
|
192
184
|
}
|
|
@@ -196,13 +188,12 @@ export class AeadCipher {
|
|
|
196
188
|
* @param {Uint8Array} key
|
|
197
189
|
* @param {number} tag_size
|
|
198
190
|
* @param {number} nonce_size
|
|
199
|
-
* @param {number | null} [rounds]
|
|
200
191
|
* @returns {AeadCipher}
|
|
201
192
|
*/
|
|
202
|
-
static
|
|
193
|
+
static new_kseed_eax(key, tag_size, nonce_size) {
|
|
203
194
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
204
195
|
const len0 = WASM_VECTOR_LEN;
|
|
205
|
-
const ret = wasm.
|
|
196
|
+
const ret = wasm.aeadcipher_new_kseed_eax(ptr0, len0, tag_size, nonce_size);
|
|
206
197
|
if (ret[2]) {
|
|
207
198
|
throw takeFromExternrefTable0(ret[1]);
|
|
208
199
|
}
|
|
@@ -210,13 +201,12 @@ export class AeadCipher {
|
|
|
210
201
|
}
|
|
211
202
|
/**
|
|
212
203
|
* @param {Uint8Array} key
|
|
213
|
-
* @param {number | null} [rounds]
|
|
214
204
|
* @returns {AeadCipher}
|
|
215
205
|
*/
|
|
216
|
-
static
|
|
206
|
+
static new_anubis_gcm(key) {
|
|
217
207
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
218
208
|
const len0 = WASM_VECTOR_LEN;
|
|
219
|
-
const ret = wasm.
|
|
209
|
+
const ret = wasm.aeadcipher_new_anubis_gcm(ptr0, len0);
|
|
220
210
|
if (ret[2]) {
|
|
221
211
|
throw takeFromExternrefTable0(ret[1]);
|
|
222
212
|
}
|
|
@@ -226,13 +216,12 @@ export class AeadCipher {
|
|
|
226
216
|
* @param {Uint8Array} key
|
|
227
217
|
* @param {number} tag_size
|
|
228
218
|
* @param {number} nonce_size
|
|
229
|
-
* @param {number | null} [rounds]
|
|
230
219
|
* @returns {AeadCipher}
|
|
231
220
|
*/
|
|
232
|
-
static
|
|
221
|
+
static new_anubis_ocb3(key, tag_size, nonce_size) {
|
|
233
222
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
234
223
|
const len0 = WASM_VECTOR_LEN;
|
|
235
|
-
const ret = wasm.
|
|
224
|
+
const ret = wasm.aeadcipher_new_anubis_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
236
225
|
if (ret[2]) {
|
|
237
226
|
throw takeFromExternrefTable0(ret[1]);
|
|
238
227
|
}
|
|
@@ -245,10 +234,10 @@ export class AeadCipher {
|
|
|
245
234
|
* @param {number | null} [rounds]
|
|
246
235
|
* @returns {AeadCipher}
|
|
247
236
|
*/
|
|
248
|
-
static
|
|
237
|
+
static new_camellia_eax(key, tag_size, nonce_size, rounds) {
|
|
249
238
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
250
239
|
const len0 = WASM_VECTOR_LEN;
|
|
251
|
-
const ret = wasm.
|
|
240
|
+
const ret = wasm.aeadcipher_new_camellia_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
252
241
|
if (ret[2]) {
|
|
253
242
|
throw takeFromExternrefTable0(ret[1]);
|
|
254
243
|
}
|
|
@@ -259,10 +248,10 @@ export class AeadCipher {
|
|
|
259
248
|
* @param {number | null} [rounds]
|
|
260
249
|
* @returns {AeadCipher}
|
|
261
250
|
*/
|
|
262
|
-
static
|
|
251
|
+
static new_multi2_gcm(key, rounds) {
|
|
263
252
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
264
253
|
const len0 = WASM_VECTOR_LEN;
|
|
265
|
-
const ret = wasm.
|
|
254
|
+
const ret = wasm.aeadcipher_new_multi2_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
266
255
|
if (ret[2]) {
|
|
267
256
|
throw takeFromExternrefTable0(ret[1]);
|
|
268
257
|
}
|
|
@@ -272,12 +261,13 @@ export class AeadCipher {
|
|
|
272
261
|
* @param {Uint8Array} key
|
|
273
262
|
* @param {number} tag_size
|
|
274
263
|
* @param {number} nonce_size
|
|
264
|
+
* @param {number | null} [rounds]
|
|
275
265
|
* @returns {AeadCipher}
|
|
276
266
|
*/
|
|
277
|
-
static
|
|
267
|
+
static new_multi2_ccm(key, tag_size, nonce_size, rounds) {
|
|
278
268
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
279
269
|
const len0 = WASM_VECTOR_LEN;
|
|
280
|
-
const ret = wasm.
|
|
270
|
+
const ret = wasm.aeadcipher_new_multi2_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
281
271
|
if (ret[2]) {
|
|
282
272
|
throw takeFromExternrefTable0(ret[1]);
|
|
283
273
|
}
|
|
@@ -287,12 +277,13 @@ export class AeadCipher {
|
|
|
287
277
|
* @param {Uint8Array} key
|
|
288
278
|
* @param {number} tag_size
|
|
289
279
|
* @param {number} nonce_size
|
|
280
|
+
* @param {number | null} [rounds]
|
|
290
281
|
* @returns {AeadCipher}
|
|
291
282
|
*/
|
|
292
|
-
static
|
|
283
|
+
static new_multi2_eax(key, tag_size, nonce_size, rounds) {
|
|
293
284
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
294
285
|
const len0 = WASM_VECTOR_LEN;
|
|
295
|
-
const ret = wasm.
|
|
286
|
+
const ret = wasm.aeadcipher_new_multi2_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
296
287
|
if (ret[2]) {
|
|
297
288
|
throw takeFromExternrefTable0(ret[1]);
|
|
298
289
|
}
|
|
@@ -302,10 +293,10 @@ export class AeadCipher {
|
|
|
302
293
|
* @param {Uint8Array} key
|
|
303
294
|
* @returns {AeadCipher}
|
|
304
295
|
*/
|
|
305
|
-
static
|
|
296
|
+
static new_chacha20_poly1305(key) {
|
|
306
297
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
307
298
|
const len0 = WASM_VECTOR_LEN;
|
|
308
|
-
const ret = wasm.
|
|
299
|
+
const ret = wasm.aeadcipher_new_chacha20_poly1305(ptr0, len0);
|
|
309
300
|
if (ret[2]) {
|
|
310
301
|
throw takeFromExternrefTable0(ret[1]);
|
|
311
302
|
}
|
|
@@ -313,46 +304,71 @@ export class AeadCipher {
|
|
|
313
304
|
}
|
|
314
305
|
/**
|
|
315
306
|
* @param {Uint8Array} key
|
|
316
|
-
* @param {number} tag_size
|
|
317
|
-
* @param {number} nonce_size
|
|
318
307
|
* @returns {AeadCipher}
|
|
319
308
|
*/
|
|
320
|
-
static
|
|
309
|
+
static new_xchacha20_poly1305(key) {
|
|
321
310
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
322
311
|
const len0 = WASM_VECTOR_LEN;
|
|
323
|
-
const ret = wasm.
|
|
312
|
+
const ret = wasm.aeadcipher_new_xchacha20_poly1305(ptr0, len0);
|
|
324
313
|
if (ret[2]) {
|
|
325
314
|
throw takeFromExternrefTable0(ret[1]);
|
|
326
315
|
}
|
|
327
316
|
return AeadCipher.__wrap(ret[0]);
|
|
328
317
|
}
|
|
329
318
|
/**
|
|
330
|
-
* @
|
|
331
|
-
* @param {number} tag_size
|
|
332
|
-
* @param {number} nonce_size
|
|
333
|
-
* @returns {AeadCipher}
|
|
319
|
+
* @returns {number}
|
|
334
320
|
*/
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
321
|
+
nonce_size() {
|
|
322
|
+
const ret = wasm.aeadcipher_nonce_size(this.__wbg_ptr);
|
|
323
|
+
return ret >>> 0;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* @param {Uint8Array} data
|
|
327
|
+
* @param {Uint8Array} tag
|
|
328
|
+
* @param {Uint8Array} nonce
|
|
329
|
+
* @param {Uint8Array} aad
|
|
330
|
+
*/
|
|
331
|
+
open_in_place_separate_tag(data, tag, nonce, aad) {
|
|
332
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
333
|
+
var len0 = WASM_VECTOR_LEN;
|
|
334
|
+
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
|
|
335
|
+
const len1 = WASM_VECTOR_LEN;
|
|
336
|
+
const ptr2 = passArray8ToWasm0(nonce, wasm.__wbindgen_malloc);
|
|
337
|
+
const len2 = WASM_VECTOR_LEN;
|
|
338
|
+
const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
|
|
339
|
+
const len3 = WASM_VECTOR_LEN;
|
|
340
|
+
const ret = wasm.aeadcipher_open_in_place_separate_tag(this.__wbg_ptr, ptr0, len0, data, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
341
|
+
if (ret[1]) {
|
|
342
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
341
343
|
}
|
|
342
|
-
return AeadCipher.__wrap(ret[0]);
|
|
343
344
|
}
|
|
344
345
|
/**
|
|
345
|
-
* @param {Uint8Array}
|
|
346
|
-
* @
|
|
346
|
+
* @param {Uint8Array} data
|
|
347
|
+
* @param {Uint8Array} nonce
|
|
348
|
+
* @param {Uint8Array} aad
|
|
349
|
+
* @returns {Uint8Array}
|
|
347
350
|
*/
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
seal_in_place_separate_tag(data, nonce, aad) {
|
|
352
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
353
|
+
var len0 = WASM_VECTOR_LEN;
|
|
354
|
+
const ptr1 = passArray8ToWasm0(nonce, wasm.__wbindgen_malloc);
|
|
355
|
+
const len1 = WASM_VECTOR_LEN;
|
|
356
|
+
const ptr2 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
|
|
357
|
+
const len2 = WASM_VECTOR_LEN;
|
|
358
|
+
const ret = wasm.aeadcipher_seal_in_place_separate_tag(this.__wbg_ptr, ptr0, len0, data, ptr1, len1, ptr2, len2);
|
|
359
|
+
if (ret[3]) {
|
|
360
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
354
361
|
}
|
|
355
|
-
|
|
362
|
+
var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
363
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
364
|
+
return v4;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* @returns {number}
|
|
368
|
+
*/
|
|
369
|
+
tag_size() {
|
|
370
|
+
const ret = wasm.aeadcipher_tag_size(this.__wbg_ptr);
|
|
371
|
+
return ret >>> 0;
|
|
356
372
|
}
|
|
357
373
|
/**
|
|
358
374
|
* @param {Uint8Array} key
|
|
@@ -360,10 +376,10 @@ export class AeadCipher {
|
|
|
360
376
|
* @param {number} nonce_size
|
|
361
377
|
* @returns {AeadCipher}
|
|
362
378
|
*/
|
|
363
|
-
static
|
|
379
|
+
static new_anubis_ccm(key, tag_size, nonce_size) {
|
|
364
380
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
365
381
|
const len0 = WASM_VECTOR_LEN;
|
|
366
|
-
const ret = wasm.
|
|
382
|
+
const ret = wasm.aeadcipher_new_anubis_ccm(ptr0, len0, tag_size, nonce_size);
|
|
367
383
|
if (ret[2]) {
|
|
368
384
|
throw takeFromExternrefTable0(ret[1]);
|
|
369
385
|
}
|
|
@@ -375,10 +391,10 @@ export class AeadCipher {
|
|
|
375
391
|
* @param {number} nonce_size
|
|
376
392
|
* @returns {AeadCipher}
|
|
377
393
|
*/
|
|
378
|
-
static
|
|
394
|
+
static new_anubis_eax(key, tag_size, nonce_size) {
|
|
379
395
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
380
396
|
const len0 = WASM_VECTOR_LEN;
|
|
381
|
-
const ret = wasm.
|
|
397
|
+
const ret = wasm.aeadcipher_new_anubis_eax(ptr0, len0, tag_size, nonce_size);
|
|
382
398
|
if (ret[2]) {
|
|
383
399
|
throw takeFromExternrefTable0(ret[1]);
|
|
384
400
|
}
|
|
@@ -388,10 +404,10 @@ export class AeadCipher {
|
|
|
388
404
|
* @param {Uint8Array} key
|
|
389
405
|
* @returns {AeadCipher}
|
|
390
406
|
*/
|
|
391
|
-
static
|
|
407
|
+
static new_noekeon_gcm(key) {
|
|
392
408
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
393
409
|
const len0 = WASM_VECTOR_LEN;
|
|
394
|
-
const ret = wasm.
|
|
410
|
+
const ret = wasm.aeadcipher_new_noekeon_gcm(ptr0, len0);
|
|
395
411
|
if (ret[2]) {
|
|
396
412
|
throw takeFromExternrefTable0(ret[1]);
|
|
397
413
|
}
|
|
@@ -403,10 +419,10 @@ export class AeadCipher {
|
|
|
403
419
|
* @param {number} nonce_size
|
|
404
420
|
* @returns {AeadCipher}
|
|
405
421
|
*/
|
|
406
|
-
static
|
|
422
|
+
static new_noekeon_ocb3(key, tag_size, nonce_size) {
|
|
407
423
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
408
424
|
const len0 = WASM_VECTOR_LEN;
|
|
409
|
-
const ret = wasm.
|
|
425
|
+
const ret = wasm.aeadcipher_new_noekeon_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
410
426
|
if (ret[2]) {
|
|
411
427
|
throw takeFromExternrefTable0(ret[1]);
|
|
412
428
|
}
|
|
@@ -418,10 +434,10 @@ export class AeadCipher {
|
|
|
418
434
|
* @param {number} nonce_size
|
|
419
435
|
* @returns {AeadCipher}
|
|
420
436
|
*/
|
|
421
|
-
static
|
|
437
|
+
static new_noekeon_ccm(key, tag_size, nonce_size) {
|
|
422
438
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
423
439
|
const len0 = WASM_VECTOR_LEN;
|
|
424
|
-
const ret = wasm.
|
|
440
|
+
const ret = wasm.aeadcipher_new_noekeon_ccm(ptr0, len0, tag_size, nonce_size);
|
|
425
441
|
if (ret[2]) {
|
|
426
442
|
throw takeFromExternrefTable0(ret[1]);
|
|
427
443
|
}
|
|
@@ -433,10 +449,10 @@ export class AeadCipher {
|
|
|
433
449
|
* @param {number} nonce_size
|
|
434
450
|
* @returns {AeadCipher}
|
|
435
451
|
*/
|
|
436
|
-
static
|
|
452
|
+
static new_noekeon_eax(key, tag_size, nonce_size) {
|
|
437
453
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
438
454
|
const len0 = WASM_VECTOR_LEN;
|
|
439
|
-
const ret = wasm.
|
|
455
|
+
const ret = wasm.aeadcipher_new_noekeon_eax(ptr0, len0, tag_size, nonce_size);
|
|
440
456
|
if (ret[2]) {
|
|
441
457
|
throw takeFromExternrefTable0(ret[1]);
|
|
442
458
|
}
|
|
@@ -446,10 +462,10 @@ export class AeadCipher {
|
|
|
446
462
|
* @param {Uint8Array} key
|
|
447
463
|
* @returns {AeadCipher}
|
|
448
464
|
*/
|
|
449
|
-
static
|
|
465
|
+
static new_khazad_gcm(key) {
|
|
450
466
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
451
467
|
const len0 = WASM_VECTOR_LEN;
|
|
452
|
-
const ret = wasm.
|
|
468
|
+
const ret = wasm.aeadcipher_new_khazad_gcm(ptr0, len0);
|
|
453
469
|
if (ret[2]) {
|
|
454
470
|
throw takeFromExternrefTable0(ret[1]);
|
|
455
471
|
}
|
|
@@ -461,10 +477,10 @@ export class AeadCipher {
|
|
|
461
477
|
* @param {number} nonce_size
|
|
462
478
|
* @returns {AeadCipher}
|
|
463
479
|
*/
|
|
464
|
-
static
|
|
480
|
+
static new_khazad_ocb3(key, tag_size, nonce_size) {
|
|
465
481
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
466
482
|
const len0 = WASM_VECTOR_LEN;
|
|
467
|
-
const ret = wasm.
|
|
483
|
+
const ret = wasm.aeadcipher_new_khazad_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
468
484
|
if (ret[2]) {
|
|
469
485
|
throw takeFromExternrefTable0(ret[1]);
|
|
470
486
|
}
|
|
@@ -476,10 +492,10 @@ export class AeadCipher {
|
|
|
476
492
|
* @param {number} nonce_size
|
|
477
493
|
* @returns {AeadCipher}
|
|
478
494
|
*/
|
|
479
|
-
static
|
|
495
|
+
static new_khazad_ccm(key, tag_size, nonce_size) {
|
|
480
496
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
481
497
|
const len0 = WASM_VECTOR_LEN;
|
|
482
|
-
const ret = wasm.
|
|
498
|
+
const ret = wasm.aeadcipher_new_khazad_ccm(ptr0, len0, tag_size, nonce_size);
|
|
483
499
|
if (ret[2]) {
|
|
484
500
|
throw takeFromExternrefTable0(ret[1]);
|
|
485
501
|
}
|
|
@@ -491,10 +507,10 @@ export class AeadCipher {
|
|
|
491
507
|
* @param {number} nonce_size
|
|
492
508
|
* @returns {AeadCipher}
|
|
493
509
|
*/
|
|
494
|
-
static
|
|
510
|
+
static new_khazad_eax(key, tag_size, nonce_size) {
|
|
495
511
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
496
512
|
const len0 = WASM_VECTOR_LEN;
|
|
497
|
-
const ret = wasm.
|
|
513
|
+
const ret = wasm.aeadcipher_new_khazad_eax(ptr0, len0, tag_size, nonce_size);
|
|
498
514
|
if (ret[2]) {
|
|
499
515
|
throw takeFromExternrefTable0(ret[1]);
|
|
500
516
|
}
|
|
@@ -504,10 +520,10 @@ export class AeadCipher {
|
|
|
504
520
|
* @param {Uint8Array} key
|
|
505
521
|
* @returns {AeadCipher}
|
|
506
522
|
*/
|
|
507
|
-
static
|
|
523
|
+
static new_serpent_gcm(key) {
|
|
508
524
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
509
525
|
const len0 = WASM_VECTOR_LEN;
|
|
510
|
-
const ret = wasm.
|
|
526
|
+
const ret = wasm.aeadcipher_new_serpent_gcm(ptr0, len0);
|
|
511
527
|
if (ret[2]) {
|
|
512
528
|
throw takeFromExternrefTable0(ret[1]);
|
|
513
529
|
}
|
|
@@ -519,10 +535,10 @@ export class AeadCipher {
|
|
|
519
535
|
* @param {number} nonce_size
|
|
520
536
|
* @returns {AeadCipher}
|
|
521
537
|
*/
|
|
522
|
-
static
|
|
538
|
+
static new_serpent_ocb3(key, tag_size, nonce_size) {
|
|
523
539
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
524
540
|
const len0 = WASM_VECTOR_LEN;
|
|
525
|
-
const ret = wasm.
|
|
541
|
+
const ret = wasm.aeadcipher_new_serpent_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
526
542
|
if (ret[2]) {
|
|
527
543
|
throw takeFromExternrefTable0(ret[1]);
|
|
528
544
|
}
|
|
@@ -534,10 +550,10 @@ export class AeadCipher {
|
|
|
534
550
|
* @param {number} nonce_size
|
|
535
551
|
* @returns {AeadCipher}
|
|
536
552
|
*/
|
|
537
|
-
static
|
|
553
|
+
static new_serpent_ccm(key, tag_size, nonce_size) {
|
|
538
554
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
539
555
|
const len0 = WASM_VECTOR_LEN;
|
|
540
|
-
const ret = wasm.
|
|
556
|
+
const ret = wasm.aeadcipher_new_serpent_ccm(ptr0, len0, tag_size, nonce_size);
|
|
541
557
|
if (ret[2]) {
|
|
542
558
|
throw takeFromExternrefTable0(ret[1]);
|
|
543
559
|
}
|
|
@@ -549,10 +565,10 @@ export class AeadCipher {
|
|
|
549
565
|
* @param {number} nonce_size
|
|
550
566
|
* @returns {AeadCipher}
|
|
551
567
|
*/
|
|
552
|
-
static
|
|
568
|
+
static new_serpent_eax(key, tag_size, nonce_size) {
|
|
553
569
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
554
570
|
const len0 = WASM_VECTOR_LEN;
|
|
555
|
-
const ret = wasm.
|
|
571
|
+
const ret = wasm.aeadcipher_new_serpent_eax(ptr0, len0, tag_size, nonce_size);
|
|
556
572
|
if (ret[2]) {
|
|
557
573
|
throw takeFromExternrefTable0(ret[1]);
|
|
558
574
|
}
|
|
@@ -560,14 +576,12 @@ export class AeadCipher {
|
|
|
560
576
|
}
|
|
561
577
|
/**
|
|
562
578
|
* @param {Uint8Array} key
|
|
563
|
-
* @param {number} tag_size
|
|
564
|
-
* @param {number} nonce_size
|
|
565
579
|
* @returns {AeadCipher}
|
|
566
580
|
*/
|
|
567
|
-
static
|
|
581
|
+
static new_idea_gcm(key) {
|
|
568
582
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
569
583
|
const len0 = WASM_VECTOR_LEN;
|
|
570
|
-
const ret = wasm.
|
|
584
|
+
const ret = wasm.aeadcipher_new_idea_gcm(ptr0, len0);
|
|
571
585
|
if (ret[2]) {
|
|
572
586
|
throw takeFromExternrefTable0(ret[1]);
|
|
573
587
|
}
|
|
@@ -579,10 +593,10 @@ export class AeadCipher {
|
|
|
579
593
|
* @param {number} nonce_size
|
|
580
594
|
* @returns {AeadCipher}
|
|
581
595
|
*/
|
|
582
|
-
static
|
|
596
|
+
static new_idea_ocb3(key, tag_size, nonce_size) {
|
|
583
597
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
584
598
|
const len0 = WASM_VECTOR_LEN;
|
|
585
|
-
const ret = wasm.
|
|
599
|
+
const ret = wasm.aeadcipher_new_idea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
586
600
|
if (ret[2]) {
|
|
587
601
|
throw takeFromExternrefTable0(ret[1]);
|
|
588
602
|
}
|
|
@@ -590,12 +604,14 @@ export class AeadCipher {
|
|
|
590
604
|
}
|
|
591
605
|
/**
|
|
592
606
|
* @param {Uint8Array} key
|
|
607
|
+
* @param {number} tag_size
|
|
608
|
+
* @param {number} nonce_size
|
|
593
609
|
* @returns {AeadCipher}
|
|
594
610
|
*/
|
|
595
|
-
static
|
|
611
|
+
static new_idea_ccm(key, tag_size, nonce_size) {
|
|
596
612
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
597
613
|
const len0 = WASM_VECTOR_LEN;
|
|
598
|
-
const ret = wasm.
|
|
614
|
+
const ret = wasm.aeadcipher_new_idea_ccm(ptr0, len0, tag_size, nonce_size);
|
|
599
615
|
if (ret[2]) {
|
|
600
616
|
throw takeFromExternrefTable0(ret[1]);
|
|
601
617
|
}
|
|
@@ -607,10 +623,10 @@ export class AeadCipher {
|
|
|
607
623
|
* @param {number} nonce_size
|
|
608
624
|
* @returns {AeadCipher}
|
|
609
625
|
*/
|
|
610
|
-
static
|
|
626
|
+
static new_idea_eax(key, tag_size, nonce_size) {
|
|
611
627
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
612
628
|
const len0 = WASM_VECTOR_LEN;
|
|
613
|
-
const ret = wasm.
|
|
629
|
+
const ret = wasm.aeadcipher_new_idea_eax(ptr0, len0, tag_size, nonce_size);
|
|
614
630
|
if (ret[2]) {
|
|
615
631
|
throw takeFromExternrefTable0(ret[1]);
|
|
616
632
|
}
|
|
@@ -618,14 +634,13 @@ export class AeadCipher {
|
|
|
618
634
|
}
|
|
619
635
|
/**
|
|
620
636
|
* @param {Uint8Array} key
|
|
621
|
-
* @param {number}
|
|
622
|
-
* @param {number} nonce_size
|
|
637
|
+
* @param {number | null} [rounds]
|
|
623
638
|
* @returns {AeadCipher}
|
|
624
639
|
*/
|
|
625
|
-
static
|
|
640
|
+
static new_rc2_gcm(key, rounds) {
|
|
626
641
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
627
642
|
const len0 = WASM_VECTOR_LEN;
|
|
628
|
-
const ret = wasm.
|
|
643
|
+
const ret = wasm.aeadcipher_new_rc2_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
629
644
|
if (ret[2]) {
|
|
630
645
|
throw takeFromExternrefTable0(ret[1]);
|
|
631
646
|
}
|
|
@@ -635,12 +650,13 @@ export class AeadCipher {
|
|
|
635
650
|
* @param {Uint8Array} key
|
|
636
651
|
* @param {number} tag_size
|
|
637
652
|
* @param {number} nonce_size
|
|
653
|
+
* @param {number | null} [rounds]
|
|
638
654
|
* @returns {AeadCipher}
|
|
639
655
|
*/
|
|
640
|
-
static
|
|
656
|
+
static new_rc2_ccm(key, tag_size, nonce_size, rounds) {
|
|
641
657
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
642
658
|
const len0 = WASM_VECTOR_LEN;
|
|
643
|
-
const ret = wasm.
|
|
659
|
+
const ret = wasm.aeadcipher_new_rc2_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
644
660
|
if (ret[2]) {
|
|
645
661
|
throw takeFromExternrefTable0(ret[1]);
|
|
646
662
|
}
|
|
@@ -648,12 +664,15 @@ export class AeadCipher {
|
|
|
648
664
|
}
|
|
649
665
|
/**
|
|
650
666
|
* @param {Uint8Array} key
|
|
667
|
+
* @param {number} tag_size
|
|
668
|
+
* @param {number} nonce_size
|
|
669
|
+
* @param {number | null} [rounds]
|
|
651
670
|
* @returns {AeadCipher}
|
|
652
671
|
*/
|
|
653
|
-
static
|
|
672
|
+
static new_rc2_eax(key, tag_size, nonce_size, rounds) {
|
|
654
673
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
655
674
|
const len0 = WASM_VECTOR_LEN;
|
|
656
|
-
const ret = wasm.
|
|
675
|
+
const ret = wasm.aeadcipher_new_rc2_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
657
676
|
if (ret[2]) {
|
|
658
677
|
throw takeFromExternrefTable0(ret[1]);
|
|
659
678
|
}
|
|
@@ -661,14 +680,13 @@ export class AeadCipher {
|
|
|
661
680
|
}
|
|
662
681
|
/**
|
|
663
682
|
* @param {Uint8Array} key
|
|
664
|
-
* @param {number}
|
|
665
|
-
* @param {number} nonce_size
|
|
683
|
+
* @param {number | null} [rounds]
|
|
666
684
|
* @returns {AeadCipher}
|
|
667
685
|
*/
|
|
668
|
-
static
|
|
686
|
+
static new_rc5_gcm(key, rounds) {
|
|
669
687
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
670
688
|
const len0 = WASM_VECTOR_LEN;
|
|
671
|
-
const ret = wasm.
|
|
689
|
+
const ret = wasm.aeadcipher_new_rc5_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
672
690
|
if (ret[2]) {
|
|
673
691
|
throw takeFromExternrefTable0(ret[1]);
|
|
674
692
|
}
|
|
@@ -678,12 +696,13 @@ export class AeadCipher {
|
|
|
678
696
|
* @param {Uint8Array} key
|
|
679
697
|
* @param {number} tag_size
|
|
680
698
|
* @param {number} nonce_size
|
|
699
|
+
* @param {number | null} [rounds]
|
|
681
700
|
* @returns {AeadCipher}
|
|
682
701
|
*/
|
|
683
|
-
static
|
|
702
|
+
static new_rc5_ccm(key, tag_size, nonce_size, rounds) {
|
|
684
703
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
685
704
|
const len0 = WASM_VECTOR_LEN;
|
|
686
|
-
const ret = wasm.
|
|
705
|
+
const ret = wasm.aeadcipher_new_rc5_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
687
706
|
if (ret[2]) {
|
|
688
707
|
throw takeFromExternrefTable0(ret[1]);
|
|
689
708
|
}
|
|
@@ -693,12 +712,13 @@ export class AeadCipher {
|
|
|
693
712
|
* @param {Uint8Array} key
|
|
694
713
|
* @param {number} tag_size
|
|
695
714
|
* @param {number} nonce_size
|
|
715
|
+
* @param {number | null} [rounds]
|
|
696
716
|
* @returns {AeadCipher}
|
|
697
717
|
*/
|
|
698
|
-
static
|
|
718
|
+
static new_rc5_eax(key, tag_size, nonce_size, rounds) {
|
|
699
719
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
700
720
|
const len0 = WASM_VECTOR_LEN;
|
|
701
|
-
const ret = wasm.
|
|
721
|
+
const ret = wasm.aeadcipher_new_rc5_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
702
722
|
if (ret[2]) {
|
|
703
723
|
throw takeFromExternrefTable0(ret[1]);
|
|
704
724
|
}
|
|
@@ -706,12 +726,13 @@ export class AeadCipher {
|
|
|
706
726
|
}
|
|
707
727
|
/**
|
|
708
728
|
* @param {Uint8Array} key
|
|
729
|
+
* @param {number | null} [rounds]
|
|
709
730
|
* @returns {AeadCipher}
|
|
710
731
|
*/
|
|
711
|
-
static
|
|
732
|
+
static new_camellia_gcm(key, rounds) {
|
|
712
733
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
713
734
|
const len0 = WASM_VECTOR_LEN;
|
|
714
|
-
const ret = wasm.
|
|
735
|
+
const ret = wasm.aeadcipher_new_camellia_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
715
736
|
if (ret[2]) {
|
|
716
737
|
throw takeFromExternrefTable0(ret[1]);
|
|
717
738
|
}
|
|
@@ -721,12 +742,13 @@ export class AeadCipher {
|
|
|
721
742
|
* @param {Uint8Array} key
|
|
722
743
|
* @param {number} tag_size
|
|
723
744
|
* @param {number} nonce_size
|
|
745
|
+
* @param {number | null} [rounds]
|
|
724
746
|
* @returns {AeadCipher}
|
|
725
747
|
*/
|
|
726
|
-
static
|
|
748
|
+
static new_camellia_ccm(key, tag_size, nonce_size, rounds) {
|
|
727
749
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
728
750
|
const len0 = WASM_VECTOR_LEN;
|
|
729
|
-
const ret = wasm.
|
|
751
|
+
const ret = wasm.aeadcipher_new_camellia_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
730
752
|
if (ret[2]) {
|
|
731
753
|
throw takeFromExternrefTable0(ret[1]);
|
|
732
754
|
}
|
|
@@ -738,10 +760,10 @@ export class AeadCipher {
|
|
|
738
760
|
* @param {number} nonce_size
|
|
739
761
|
* @returns {AeadCipher}
|
|
740
762
|
*/
|
|
741
|
-
static
|
|
763
|
+
static new_tripledes_ccm(key, tag_size, nonce_size) {
|
|
742
764
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
743
765
|
const len0 = WASM_VECTOR_LEN;
|
|
744
|
-
const ret = wasm.
|
|
766
|
+
const ret = wasm.aeadcipher_new_tripledes_ccm(ptr0, len0, tag_size, nonce_size);
|
|
745
767
|
if (ret[2]) {
|
|
746
768
|
throw takeFromExternrefTable0(ret[1]);
|
|
747
769
|
}
|
|
@@ -753,10 +775,10 @@ export class AeadCipher {
|
|
|
753
775
|
* @param {number} nonce_size
|
|
754
776
|
* @returns {AeadCipher}
|
|
755
777
|
*/
|
|
756
|
-
static
|
|
778
|
+
static new_tripledes_eax(key, tag_size, nonce_size) {
|
|
757
779
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
758
780
|
const len0 = WASM_VECTOR_LEN;
|
|
759
|
-
const ret = wasm.
|
|
781
|
+
const ret = wasm.aeadcipher_new_tripledes_eax(ptr0, len0, tag_size, nonce_size);
|
|
760
782
|
if (ret[2]) {
|
|
761
783
|
throw takeFromExternrefTable0(ret[1]);
|
|
762
784
|
}
|
|
@@ -766,10 +788,10 @@ export class AeadCipher {
|
|
|
766
788
|
* @param {Uint8Array} key
|
|
767
789
|
* @returns {AeadCipher}
|
|
768
790
|
*/
|
|
769
|
-
static
|
|
791
|
+
static new_tea_gcm(key) {
|
|
770
792
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
771
793
|
const len0 = WASM_VECTOR_LEN;
|
|
772
|
-
const ret = wasm.
|
|
794
|
+
const ret = wasm.aeadcipher_new_tea_gcm(ptr0, len0);
|
|
773
795
|
if (ret[2]) {
|
|
774
796
|
throw takeFromExternrefTable0(ret[1]);
|
|
775
797
|
}
|
|
@@ -781,10 +803,10 @@ export class AeadCipher {
|
|
|
781
803
|
* @param {number} nonce_size
|
|
782
804
|
* @returns {AeadCipher}
|
|
783
805
|
*/
|
|
784
|
-
static
|
|
806
|
+
static new_tea_ocb3(key, tag_size, nonce_size) {
|
|
785
807
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
786
808
|
const len0 = WASM_VECTOR_LEN;
|
|
787
|
-
const ret = wasm.
|
|
809
|
+
const ret = wasm.aeadcipher_new_tea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
788
810
|
if (ret[2]) {
|
|
789
811
|
throw takeFromExternrefTable0(ret[1]);
|
|
790
812
|
}
|
|
@@ -796,10 +818,10 @@ export class AeadCipher {
|
|
|
796
818
|
* @param {number} nonce_size
|
|
797
819
|
* @returns {AeadCipher}
|
|
798
820
|
*/
|
|
799
|
-
static
|
|
821
|
+
static new_tea_ccm(key, tag_size, nonce_size) {
|
|
800
822
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
801
823
|
const len0 = WASM_VECTOR_LEN;
|
|
802
|
-
const ret = wasm.
|
|
824
|
+
const ret = wasm.aeadcipher_new_tea_ccm(ptr0, len0, tag_size, nonce_size);
|
|
803
825
|
if (ret[2]) {
|
|
804
826
|
throw takeFromExternrefTable0(ret[1]);
|
|
805
827
|
}
|
|
@@ -811,10 +833,10 @@ export class AeadCipher {
|
|
|
811
833
|
* @param {number} nonce_size
|
|
812
834
|
* @returns {AeadCipher}
|
|
813
835
|
*/
|
|
814
|
-
static
|
|
836
|
+
static new_tea_eax(key, tag_size, nonce_size) {
|
|
815
837
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
816
838
|
const len0 = WASM_VECTOR_LEN;
|
|
817
|
-
const ret = wasm.
|
|
839
|
+
const ret = wasm.aeadcipher_new_tea_eax(ptr0, len0, tag_size, nonce_size);
|
|
818
840
|
if (ret[2]) {
|
|
819
841
|
throw takeFromExternrefTable0(ret[1]);
|
|
820
842
|
}
|
|
@@ -824,10 +846,10 @@ export class AeadCipher {
|
|
|
824
846
|
* @param {Uint8Array} key
|
|
825
847
|
* @returns {AeadCipher}
|
|
826
848
|
*/
|
|
827
|
-
static
|
|
849
|
+
static new_twofish_gcm(key) {
|
|
828
850
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
829
851
|
const len0 = WASM_VECTOR_LEN;
|
|
830
|
-
const ret = wasm.
|
|
852
|
+
const ret = wasm.aeadcipher_new_twofish_gcm(ptr0, len0);
|
|
831
853
|
if (ret[2]) {
|
|
832
854
|
throw takeFromExternrefTable0(ret[1]);
|
|
833
855
|
}
|
|
@@ -839,10 +861,10 @@ export class AeadCipher {
|
|
|
839
861
|
* @param {number} nonce_size
|
|
840
862
|
* @returns {AeadCipher}
|
|
841
863
|
*/
|
|
842
|
-
static
|
|
864
|
+
static new_twofish_ocb3(key, tag_size, nonce_size) {
|
|
843
865
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
844
866
|
const len0 = WASM_VECTOR_LEN;
|
|
845
|
-
const ret = wasm.
|
|
867
|
+
const ret = wasm.aeadcipher_new_twofish_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
846
868
|
if (ret[2]) {
|
|
847
869
|
throw takeFromExternrefTable0(ret[1]);
|
|
848
870
|
}
|
|
@@ -854,10 +876,10 @@ export class AeadCipher {
|
|
|
854
876
|
* @param {number} nonce_size
|
|
855
877
|
* @returns {AeadCipher}
|
|
856
878
|
*/
|
|
857
|
-
static
|
|
879
|
+
static new_twofish_ccm(key, tag_size, nonce_size) {
|
|
858
880
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
859
881
|
const len0 = WASM_VECTOR_LEN;
|
|
860
|
-
const ret = wasm.
|
|
882
|
+
const ret = wasm.aeadcipher_new_twofish_ccm(ptr0, len0, tag_size, nonce_size);
|
|
861
883
|
if (ret[2]) {
|
|
862
884
|
throw takeFromExternrefTable0(ret[1]);
|
|
863
885
|
}
|
|
@@ -865,12 +887,27 @@ export class AeadCipher {
|
|
|
865
887
|
}
|
|
866
888
|
/**
|
|
867
889
|
* @param {Uint8Array} key
|
|
890
|
+
* @param {number} tag_size
|
|
891
|
+
* @param {number} nonce_size
|
|
868
892
|
* @returns {AeadCipher}
|
|
869
893
|
*/
|
|
870
|
-
static
|
|
894
|
+
static new_twofish_eax(key, tag_size, nonce_size) {
|
|
871
895
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
872
896
|
const len0 = WASM_VECTOR_LEN;
|
|
873
|
-
const ret = wasm.
|
|
897
|
+
const ret = wasm.aeadcipher_new_twofish_eax(ptr0, len0, tag_size, nonce_size);
|
|
898
|
+
if (ret[2]) {
|
|
899
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
900
|
+
}
|
|
901
|
+
return AeadCipher.__wrap(ret[0]);
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* @param {Uint8Array} key
|
|
905
|
+
* @returns {AeadCipher}
|
|
906
|
+
*/
|
|
907
|
+
static new_xtea_gcm(key) {
|
|
908
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
909
|
+
const len0 = WASM_VECTOR_LEN;
|
|
910
|
+
const ret = wasm.aeadcipher_new_xtea_gcm(ptr0, len0);
|
|
874
911
|
if (ret[2]) {
|
|
875
912
|
throw takeFromExternrefTable0(ret[1]);
|
|
876
913
|
}
|
|
@@ -882,10 +919,10 @@ export class AeadCipher {
|
|
|
882
919
|
* @param {number} nonce_size
|
|
883
920
|
* @returns {AeadCipher}
|
|
884
921
|
*/
|
|
885
|
-
static
|
|
922
|
+
static new_xtea_ocb3(key, tag_size, nonce_size) {
|
|
886
923
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
887
924
|
const len0 = WASM_VECTOR_LEN;
|
|
888
|
-
const ret = wasm.
|
|
925
|
+
const ret = wasm.aeadcipher_new_xtea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
889
926
|
if (ret[2]) {
|
|
890
927
|
throw takeFromExternrefTable0(ret[1]);
|
|
891
928
|
}
|
|
@@ -895,13 +932,12 @@ export class AeadCipher {
|
|
|
895
932
|
* @param {Uint8Array} key
|
|
896
933
|
* @param {number} tag_size
|
|
897
934
|
* @param {number} nonce_size
|
|
898
|
-
* @param {number | null} [rounds]
|
|
899
935
|
* @returns {AeadCipher}
|
|
900
936
|
*/
|
|
901
|
-
static
|
|
937
|
+
static new_xtea_ccm(key, tag_size, nonce_size) {
|
|
902
938
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
903
939
|
const len0 = WASM_VECTOR_LEN;
|
|
904
|
-
const ret = wasm.
|
|
940
|
+
const ret = wasm.aeadcipher_new_xtea_ccm(ptr0, len0, tag_size, nonce_size);
|
|
905
941
|
if (ret[2]) {
|
|
906
942
|
throw takeFromExternrefTable0(ret[1]);
|
|
907
943
|
}
|
|
@@ -911,13 +947,12 @@ export class AeadCipher {
|
|
|
911
947
|
* @param {Uint8Array} key
|
|
912
948
|
* @param {number} tag_size
|
|
913
949
|
* @param {number} nonce_size
|
|
914
|
-
* @param {number | null} [rounds]
|
|
915
950
|
* @returns {AeadCipher}
|
|
916
951
|
*/
|
|
917
|
-
static
|
|
952
|
+
static new_xtea_eax(key, tag_size, nonce_size) {
|
|
918
953
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
919
954
|
const len0 = WASM_VECTOR_LEN;
|
|
920
|
-
const ret = wasm.
|
|
955
|
+
const ret = wasm.aeadcipher_new_xtea_eax(ptr0, len0, tag_size, nonce_size);
|
|
921
956
|
if (ret[2]) {
|
|
922
957
|
throw takeFromExternrefTable0(ret[1]);
|
|
923
958
|
}
|
|
@@ -925,13 +960,12 @@ export class AeadCipher {
|
|
|
925
960
|
}
|
|
926
961
|
/**
|
|
927
962
|
* @param {Uint8Array} key
|
|
928
|
-
* @param {number | null} [rounds]
|
|
929
963
|
* @returns {AeadCipher}
|
|
930
964
|
*/
|
|
931
|
-
static
|
|
965
|
+
static new_rc6_gcm(key) {
|
|
932
966
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
933
967
|
const len0 = WASM_VECTOR_LEN;
|
|
934
|
-
const ret = wasm.
|
|
968
|
+
const ret = wasm.aeadcipher_new_rc6_gcm(ptr0, len0);
|
|
935
969
|
if (ret[2]) {
|
|
936
970
|
throw takeFromExternrefTable0(ret[1]);
|
|
937
971
|
}
|
|
@@ -943,10 +977,10 @@ export class AeadCipher {
|
|
|
943
977
|
* @param {number} nonce_size
|
|
944
978
|
* @returns {AeadCipher}
|
|
945
979
|
*/
|
|
946
|
-
static
|
|
980
|
+
static new_rc6_ocb3(key, tag_size, nonce_size) {
|
|
947
981
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
948
982
|
const len0 = WASM_VECTOR_LEN;
|
|
949
|
-
const ret = wasm.
|
|
983
|
+
const ret = wasm.aeadcipher_new_rc6_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
950
984
|
if (ret[2]) {
|
|
951
985
|
throw takeFromExternrefTable0(ret[1]);
|
|
952
986
|
}
|
|
@@ -958,10 +992,10 @@ export class AeadCipher {
|
|
|
958
992
|
* @param {number} nonce_size
|
|
959
993
|
* @returns {AeadCipher}
|
|
960
994
|
*/
|
|
961
|
-
static
|
|
995
|
+
static new_rc6_ccm(key, tag_size, nonce_size) {
|
|
962
996
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
963
997
|
const len0 = WASM_VECTOR_LEN;
|
|
964
|
-
const ret = wasm.
|
|
998
|
+
const ret = wasm.aeadcipher_new_rc6_ccm(ptr0, len0, tag_size, nonce_size);
|
|
965
999
|
if (ret[2]) {
|
|
966
1000
|
throw takeFromExternrefTable0(ret[1]);
|
|
967
1001
|
}
|
|
@@ -973,10 +1007,10 @@ export class AeadCipher {
|
|
|
973
1007
|
* @param {number} nonce_size
|
|
974
1008
|
* @returns {AeadCipher}
|
|
975
1009
|
*/
|
|
976
|
-
static
|
|
1010
|
+
static new_rc6_eax(key, tag_size, nonce_size) {
|
|
977
1011
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
978
1012
|
const len0 = WASM_VECTOR_LEN;
|
|
979
|
-
const ret = wasm.
|
|
1013
|
+
const ret = wasm.aeadcipher_new_rc6_eax(ptr0, len0, tag_size, nonce_size);
|
|
980
1014
|
if (ret[2]) {
|
|
981
1015
|
throw takeFromExternrefTable0(ret[1]);
|
|
982
1016
|
}
|
|
@@ -984,14 +1018,12 @@ export class AeadCipher {
|
|
|
984
1018
|
}
|
|
985
1019
|
/**
|
|
986
1020
|
* @param {Uint8Array} key
|
|
987
|
-
* @param {number} tag_size
|
|
988
|
-
* @param {number} nonce_size
|
|
989
1021
|
* @returns {AeadCipher}
|
|
990
1022
|
*/
|
|
991
|
-
static
|
|
1023
|
+
static new_sm4_gcm(key) {
|
|
992
1024
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
993
1025
|
const len0 = WASM_VECTOR_LEN;
|
|
994
|
-
const ret = wasm.
|
|
1026
|
+
const ret = wasm.aeadcipher_new_sm4_gcm(ptr0, len0);
|
|
995
1027
|
if (ret[2]) {
|
|
996
1028
|
throw takeFromExternrefTable0(ret[1]);
|
|
997
1029
|
}
|
|
@@ -1003,10 +1035,10 @@ export class AeadCipher {
|
|
|
1003
1035
|
* @param {number} nonce_size
|
|
1004
1036
|
* @returns {AeadCipher}
|
|
1005
1037
|
*/
|
|
1006
|
-
static
|
|
1038
|
+
static new_sm4_ocb3(key, tag_size, nonce_size) {
|
|
1007
1039
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1008
1040
|
const len0 = WASM_VECTOR_LEN;
|
|
1009
|
-
const ret = wasm.
|
|
1041
|
+
const ret = wasm.aeadcipher_new_sm4_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1010
1042
|
if (ret[2]) {
|
|
1011
1043
|
throw takeFromExternrefTable0(ret[1]);
|
|
1012
1044
|
}
|
|
@@ -1014,12 +1046,14 @@ export class AeadCipher {
|
|
|
1014
1046
|
}
|
|
1015
1047
|
/**
|
|
1016
1048
|
* @param {Uint8Array} key
|
|
1049
|
+
* @param {number} tag_size
|
|
1050
|
+
* @param {number} nonce_size
|
|
1017
1051
|
* @returns {AeadCipher}
|
|
1018
1052
|
*/
|
|
1019
|
-
static
|
|
1053
|
+
static new_sm4_ccm(key, tag_size, nonce_size) {
|
|
1020
1054
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1021
1055
|
const len0 = WASM_VECTOR_LEN;
|
|
1022
|
-
const ret = wasm.
|
|
1056
|
+
const ret = wasm.aeadcipher_new_sm4_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1023
1057
|
if (ret[2]) {
|
|
1024
1058
|
throw takeFromExternrefTable0(ret[1]);
|
|
1025
1059
|
}
|
|
@@ -1031,10 +1065,10 @@ export class AeadCipher {
|
|
|
1031
1065
|
* @param {number} nonce_size
|
|
1032
1066
|
* @returns {AeadCipher}
|
|
1033
1067
|
*/
|
|
1034
|
-
static
|
|
1068
|
+
static new_sm4_eax(key, tag_size, nonce_size) {
|
|
1035
1069
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1036
1070
|
const len0 = WASM_VECTOR_LEN;
|
|
1037
|
-
const ret = wasm.
|
|
1071
|
+
const ret = wasm.aeadcipher_new_sm4_eax(ptr0, len0, tag_size, nonce_size);
|
|
1038
1072
|
if (ret[2]) {
|
|
1039
1073
|
throw takeFromExternrefTable0(ret[1]);
|
|
1040
1074
|
}
|
|
@@ -1042,14 +1076,12 @@ export class AeadCipher {
|
|
|
1042
1076
|
}
|
|
1043
1077
|
/**
|
|
1044
1078
|
* @param {Uint8Array} key
|
|
1045
|
-
* @param {number} tag_size
|
|
1046
|
-
* @param {number} nonce_size
|
|
1047
1079
|
* @returns {AeadCipher}
|
|
1048
1080
|
*/
|
|
1049
|
-
static
|
|
1081
|
+
static new_skipjack_gcm(key) {
|
|
1050
1082
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1051
1083
|
const len0 = WASM_VECTOR_LEN;
|
|
1052
|
-
const ret = wasm.
|
|
1084
|
+
const ret = wasm.aeadcipher_new_skipjack_gcm(ptr0, len0);
|
|
1053
1085
|
if (ret[2]) {
|
|
1054
1086
|
throw takeFromExternrefTable0(ret[1]);
|
|
1055
1087
|
}
|
|
@@ -1057,12 +1089,14 @@ export class AeadCipher {
|
|
|
1057
1089
|
}
|
|
1058
1090
|
/**
|
|
1059
1091
|
* @param {Uint8Array} key
|
|
1092
|
+
* @param {number} tag_size
|
|
1093
|
+
* @param {number} nonce_size
|
|
1060
1094
|
* @returns {AeadCipher}
|
|
1061
1095
|
*/
|
|
1062
|
-
static
|
|
1096
|
+
static new_skipjack_ocb3(key, tag_size, nonce_size) {
|
|
1063
1097
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1064
1098
|
const len0 = WASM_VECTOR_LEN;
|
|
1065
|
-
const ret = wasm.
|
|
1099
|
+
const ret = wasm.aeadcipher_new_skipjack_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1066
1100
|
if (ret[2]) {
|
|
1067
1101
|
throw takeFromExternrefTable0(ret[1]);
|
|
1068
1102
|
}
|
|
@@ -1074,10 +1108,10 @@ export class AeadCipher {
|
|
|
1074
1108
|
* @param {number} nonce_size
|
|
1075
1109
|
* @returns {AeadCipher}
|
|
1076
1110
|
*/
|
|
1077
|
-
static
|
|
1111
|
+
static new_skipjack_ccm(key, tag_size, nonce_size) {
|
|
1078
1112
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1079
1113
|
const len0 = WASM_VECTOR_LEN;
|
|
1080
|
-
const ret = wasm.
|
|
1114
|
+
const ret = wasm.aeadcipher_new_skipjack_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1081
1115
|
if (ret[2]) {
|
|
1082
1116
|
throw takeFromExternrefTable0(ret[1]);
|
|
1083
1117
|
}
|
|
@@ -1089,10 +1123,10 @@ export class AeadCipher {
|
|
|
1089
1123
|
* @param {number} nonce_size
|
|
1090
1124
|
* @returns {AeadCipher}
|
|
1091
1125
|
*/
|
|
1092
|
-
static
|
|
1126
|
+
static new_skipjack_eax(key, tag_size, nonce_size) {
|
|
1093
1127
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1094
1128
|
const len0 = WASM_VECTOR_LEN;
|
|
1095
|
-
const ret = wasm.
|
|
1129
|
+
const ret = wasm.aeadcipher_new_skipjack_eax(ptr0, len0, tag_size, nonce_size);
|
|
1096
1130
|
if (ret[2]) {
|
|
1097
1131
|
throw takeFromExternrefTable0(ret[1]);
|
|
1098
1132
|
}
|
|
@@ -1102,10 +1136,10 @@ export class AeadCipher {
|
|
|
1102
1136
|
* @param {Uint8Array} key
|
|
1103
1137
|
* @returns {AeadCipher}
|
|
1104
1138
|
*/
|
|
1105
|
-
static
|
|
1139
|
+
static new_aes_gcm(key) {
|
|
1106
1140
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1107
1141
|
const len0 = WASM_VECTOR_LEN;
|
|
1108
|
-
const ret = wasm.
|
|
1142
|
+
const ret = wasm.aeadcipher_new_aes_gcm(ptr0, len0);
|
|
1109
1143
|
if (ret[2]) {
|
|
1110
1144
|
throw takeFromExternrefTable0(ret[1]);
|
|
1111
1145
|
}
|
|
@@ -1117,10 +1151,10 @@ export class AeadCipher {
|
|
|
1117
1151
|
* @param {number} nonce_size
|
|
1118
1152
|
* @returns {AeadCipher}
|
|
1119
1153
|
*/
|
|
1120
|
-
static
|
|
1154
|
+
static new_aes_ocb3(key, tag_size, nonce_size) {
|
|
1121
1155
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1122
1156
|
const len0 = WASM_VECTOR_LEN;
|
|
1123
|
-
const ret = wasm.
|
|
1157
|
+
const ret = wasm.aeadcipher_new_aes_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1124
1158
|
if (ret[2]) {
|
|
1125
1159
|
throw takeFromExternrefTable0(ret[1]);
|
|
1126
1160
|
}
|
|
@@ -1132,10 +1166,10 @@ export class AeadCipher {
|
|
|
1132
1166
|
* @param {number} nonce_size
|
|
1133
1167
|
* @returns {AeadCipher}
|
|
1134
1168
|
*/
|
|
1135
|
-
static
|
|
1169
|
+
static new_aes_ccm(key, tag_size, nonce_size) {
|
|
1136
1170
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1137
1171
|
const len0 = WASM_VECTOR_LEN;
|
|
1138
|
-
const ret = wasm.
|
|
1172
|
+
const ret = wasm.aeadcipher_new_aes_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1139
1173
|
if (ret[2]) {
|
|
1140
1174
|
throw takeFromExternrefTable0(ret[1]);
|
|
1141
1175
|
}
|
|
@@ -1143,12 +1177,14 @@ export class AeadCipher {
|
|
|
1143
1177
|
}
|
|
1144
1178
|
/**
|
|
1145
1179
|
* @param {Uint8Array} key
|
|
1180
|
+
* @param {number} tag_size
|
|
1181
|
+
* @param {number} nonce_size
|
|
1146
1182
|
* @returns {AeadCipher}
|
|
1147
1183
|
*/
|
|
1148
|
-
static
|
|
1184
|
+
static new_aes_eax(key, tag_size, nonce_size) {
|
|
1149
1185
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1150
1186
|
const len0 = WASM_VECTOR_LEN;
|
|
1151
|
-
const ret = wasm.
|
|
1187
|
+
const ret = wasm.aeadcipher_new_aes_eax(ptr0, len0, tag_size, nonce_size);
|
|
1152
1188
|
if (ret[2]) {
|
|
1153
1189
|
throw takeFromExternrefTable0(ret[1]);
|
|
1154
1190
|
}
|
|
@@ -1156,15 +1192,12 @@ export class AeadCipher {
|
|
|
1156
1192
|
}
|
|
1157
1193
|
/**
|
|
1158
1194
|
* @param {Uint8Array} key
|
|
1159
|
-
* @param {number} tag_size
|
|
1160
|
-
* @param {number} nonce_size
|
|
1161
|
-
* @param {number | null} [rounds]
|
|
1162
1195
|
* @returns {AeadCipher}
|
|
1163
1196
|
*/
|
|
1164
|
-
static
|
|
1197
|
+
static new_aria_gcm(key) {
|
|
1165
1198
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1166
1199
|
const len0 = WASM_VECTOR_LEN;
|
|
1167
|
-
const ret = wasm.
|
|
1200
|
+
const ret = wasm.aeadcipher_new_aria_gcm(ptr0, len0);
|
|
1168
1201
|
if (ret[2]) {
|
|
1169
1202
|
throw takeFromExternrefTable0(ret[1]);
|
|
1170
1203
|
}
|
|
@@ -1174,13 +1207,12 @@ export class AeadCipher {
|
|
|
1174
1207
|
* @param {Uint8Array} key
|
|
1175
1208
|
* @param {number} tag_size
|
|
1176
1209
|
* @param {number} nonce_size
|
|
1177
|
-
* @param {number | null} [rounds]
|
|
1178
1210
|
* @returns {AeadCipher}
|
|
1179
1211
|
*/
|
|
1180
|
-
static
|
|
1212
|
+
static new_aria_ocb3(key, tag_size, nonce_size) {
|
|
1181
1213
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1182
1214
|
const len0 = WASM_VECTOR_LEN;
|
|
1183
|
-
const ret = wasm.
|
|
1215
|
+
const ret = wasm.aeadcipher_new_aria_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1184
1216
|
if (ret[2]) {
|
|
1185
1217
|
throw takeFromExternrefTable0(ret[1]);
|
|
1186
1218
|
}
|
|
@@ -1188,13 +1220,14 @@ export class AeadCipher {
|
|
|
1188
1220
|
}
|
|
1189
1221
|
/**
|
|
1190
1222
|
* @param {Uint8Array} key
|
|
1191
|
-
* @param {number
|
|
1223
|
+
* @param {number} tag_size
|
|
1224
|
+
* @param {number} nonce_size
|
|
1192
1225
|
* @returns {AeadCipher}
|
|
1193
1226
|
*/
|
|
1194
|
-
static
|
|
1227
|
+
static new_aria_ccm(key, tag_size, nonce_size) {
|
|
1195
1228
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1196
1229
|
const len0 = WASM_VECTOR_LEN;
|
|
1197
|
-
const ret = wasm.
|
|
1230
|
+
const ret = wasm.aeadcipher_new_aria_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1198
1231
|
if (ret[2]) {
|
|
1199
1232
|
throw takeFromExternrefTable0(ret[1]);
|
|
1200
1233
|
}
|
|
@@ -1206,10 +1239,10 @@ export class AeadCipher {
|
|
|
1206
1239
|
* @param {number} nonce_size
|
|
1207
1240
|
* @returns {AeadCipher}
|
|
1208
1241
|
*/
|
|
1209
|
-
static
|
|
1242
|
+
static new_aria_eax(key, tag_size, nonce_size) {
|
|
1210
1243
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1211
1244
|
const len0 = WASM_VECTOR_LEN;
|
|
1212
|
-
const ret = wasm.
|
|
1245
|
+
const ret = wasm.aeadcipher_new_aria_eax(ptr0, len0, tag_size, nonce_size);
|
|
1213
1246
|
if (ret[2]) {
|
|
1214
1247
|
throw takeFromExternrefTable0(ret[1]);
|
|
1215
1248
|
}
|
|
@@ -1217,14 +1250,12 @@ export class AeadCipher {
|
|
|
1217
1250
|
}
|
|
1218
1251
|
/**
|
|
1219
1252
|
* @param {Uint8Array} key
|
|
1220
|
-
* @param {number} tag_size
|
|
1221
|
-
* @param {number} nonce_size
|
|
1222
1253
|
* @returns {AeadCipher}
|
|
1223
1254
|
*/
|
|
1224
|
-
static
|
|
1255
|
+
static new_blowfish_gcm(key) {
|
|
1225
1256
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1226
1257
|
const len0 = WASM_VECTOR_LEN;
|
|
1227
|
-
const ret = wasm.
|
|
1258
|
+
const ret = wasm.aeadcipher_new_blowfish_gcm(ptr0, len0);
|
|
1228
1259
|
if (ret[2]) {
|
|
1229
1260
|
throw takeFromExternrefTable0(ret[1]);
|
|
1230
1261
|
}
|
|
@@ -1236,10 +1267,10 @@ export class AeadCipher {
|
|
|
1236
1267
|
* @param {number} nonce_size
|
|
1237
1268
|
* @returns {AeadCipher}
|
|
1238
1269
|
*/
|
|
1239
|
-
static
|
|
1270
|
+
static new_blowfish_ocb3(key, tag_size, nonce_size) {
|
|
1240
1271
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1241
1272
|
const len0 = WASM_VECTOR_LEN;
|
|
1242
|
-
const ret = wasm.
|
|
1273
|
+
const ret = wasm.aeadcipher_new_blowfish_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1243
1274
|
if (ret[2]) {
|
|
1244
1275
|
throw takeFromExternrefTable0(ret[1]);
|
|
1245
1276
|
}
|
|
@@ -1251,10 +1282,10 @@ export class AeadCipher {
|
|
|
1251
1282
|
* @param {number} nonce_size
|
|
1252
1283
|
* @returns {AeadCipher}
|
|
1253
1284
|
*/
|
|
1254
|
-
static
|
|
1285
|
+
static new_blowfish_ccm(key, tag_size, nonce_size) {
|
|
1255
1286
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1256
1287
|
const len0 = WASM_VECTOR_LEN;
|
|
1257
|
-
const ret = wasm.
|
|
1288
|
+
const ret = wasm.aeadcipher_new_blowfish_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1258
1289
|
if (ret[2]) {
|
|
1259
1290
|
throw takeFromExternrefTable0(ret[1]);
|
|
1260
1291
|
}
|
|
@@ -1262,12 +1293,14 @@ export class AeadCipher {
|
|
|
1262
1293
|
}
|
|
1263
1294
|
/**
|
|
1264
1295
|
* @param {Uint8Array} key
|
|
1296
|
+
* @param {number} tag_size
|
|
1297
|
+
* @param {number} nonce_size
|
|
1265
1298
|
* @returns {AeadCipher}
|
|
1266
1299
|
*/
|
|
1267
|
-
static
|
|
1300
|
+
static new_blowfish_eax(key, tag_size, nonce_size) {
|
|
1268
1301
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1269
1302
|
const len0 = WASM_VECTOR_LEN;
|
|
1270
|
-
const ret = wasm.
|
|
1303
|
+
const ret = wasm.aeadcipher_new_blowfish_eax(ptr0, len0, tag_size, nonce_size);
|
|
1271
1304
|
if (ret[2]) {
|
|
1272
1305
|
throw takeFromExternrefTable0(ret[1]);
|
|
1273
1306
|
}
|
|
@@ -1275,14 +1308,12 @@ export class AeadCipher {
|
|
|
1275
1308
|
}
|
|
1276
1309
|
/**
|
|
1277
1310
|
* @param {Uint8Array} key
|
|
1278
|
-
* @param {number} tag_size
|
|
1279
|
-
* @param {number} nonce_size
|
|
1280
1311
|
* @returns {AeadCipher}
|
|
1281
1312
|
*/
|
|
1282
|
-
static
|
|
1313
|
+
static new_cast5_gcm(key) {
|
|
1283
1314
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1284
1315
|
const len0 = WASM_VECTOR_LEN;
|
|
1285
|
-
const ret = wasm.
|
|
1316
|
+
const ret = wasm.aeadcipher_new_cast5_gcm(ptr0, len0);
|
|
1286
1317
|
if (ret[2]) {
|
|
1287
1318
|
throw takeFromExternrefTable0(ret[1]);
|
|
1288
1319
|
}
|
|
@@ -1294,10 +1325,10 @@ export class AeadCipher {
|
|
|
1294
1325
|
* @param {number} nonce_size
|
|
1295
1326
|
* @returns {AeadCipher}
|
|
1296
1327
|
*/
|
|
1297
|
-
static
|
|
1328
|
+
static new_cast5_ocb3(key, tag_size, nonce_size) {
|
|
1298
1329
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1299
1330
|
const len0 = WASM_VECTOR_LEN;
|
|
1300
|
-
const ret = wasm.
|
|
1331
|
+
const ret = wasm.aeadcipher_new_cast5_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1301
1332
|
if (ret[2]) {
|
|
1302
1333
|
throw takeFromExternrefTable0(ret[1]);
|
|
1303
1334
|
}
|
|
@@ -1309,10 +1340,10 @@ export class AeadCipher {
|
|
|
1309
1340
|
* @param {number} nonce_size
|
|
1310
1341
|
* @returns {AeadCipher}
|
|
1311
1342
|
*/
|
|
1312
|
-
static
|
|
1343
|
+
static new_cast5_ccm(key, tag_size, nonce_size) {
|
|
1313
1344
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1314
1345
|
const len0 = WASM_VECTOR_LEN;
|
|
1315
|
-
const ret = wasm.
|
|
1346
|
+
const ret = wasm.aeadcipher_new_cast5_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1316
1347
|
if (ret[2]) {
|
|
1317
1348
|
throw takeFromExternrefTable0(ret[1]);
|
|
1318
1349
|
}
|
|
@@ -1324,10 +1355,10 @@ export class AeadCipher {
|
|
|
1324
1355
|
* @param {number} nonce_size
|
|
1325
1356
|
* @returns {AeadCipher}
|
|
1326
1357
|
*/
|
|
1327
|
-
static
|
|
1358
|
+
static new_cast5_eax(key, tag_size, nonce_size) {
|
|
1328
1359
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1329
1360
|
const len0 = WASM_VECTOR_LEN;
|
|
1330
|
-
const ret = wasm.
|
|
1361
|
+
const ret = wasm.aeadcipher_new_cast5_eax(ptr0, len0, tag_size, nonce_size);
|
|
1331
1362
|
if (ret[2]) {
|
|
1332
1363
|
throw takeFromExternrefTable0(ret[1]);
|
|
1333
1364
|
}
|
|
@@ -1335,14 +1366,12 @@ export class AeadCipher {
|
|
|
1335
1366
|
}
|
|
1336
1367
|
/**
|
|
1337
1368
|
* @param {Uint8Array} key
|
|
1338
|
-
* @param {number} tag_size
|
|
1339
|
-
* @param {number} nonce_size
|
|
1340
1369
|
* @returns {AeadCipher}
|
|
1341
1370
|
*/
|
|
1342
|
-
static
|
|
1371
|
+
static new_des_gcm(key) {
|
|
1343
1372
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1344
1373
|
const len0 = WASM_VECTOR_LEN;
|
|
1345
|
-
const ret = wasm.
|
|
1374
|
+
const ret = wasm.aeadcipher_new_des_gcm(ptr0, len0);
|
|
1346
1375
|
if (ret[2]) {
|
|
1347
1376
|
throw takeFromExternrefTable0(ret[1]);
|
|
1348
1377
|
}
|
|
@@ -1350,12 +1379,14 @@ export class AeadCipher {
|
|
|
1350
1379
|
}
|
|
1351
1380
|
/**
|
|
1352
1381
|
* @param {Uint8Array} key
|
|
1382
|
+
* @param {number} tag_size
|
|
1383
|
+
* @param {number} nonce_size
|
|
1353
1384
|
* @returns {AeadCipher}
|
|
1354
1385
|
*/
|
|
1355
|
-
static
|
|
1386
|
+
static new_des_ocb3(key, tag_size, nonce_size) {
|
|
1356
1387
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1357
1388
|
const len0 = WASM_VECTOR_LEN;
|
|
1358
|
-
const ret = wasm.
|
|
1389
|
+
const ret = wasm.aeadcipher_new_des_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1359
1390
|
if (ret[2]) {
|
|
1360
1391
|
throw takeFromExternrefTable0(ret[1]);
|
|
1361
1392
|
}
|
|
@@ -1367,10 +1398,10 @@ export class AeadCipher {
|
|
|
1367
1398
|
* @param {number} nonce_size
|
|
1368
1399
|
* @returns {AeadCipher}
|
|
1369
1400
|
*/
|
|
1370
|
-
static
|
|
1401
|
+
static new_des_ccm(key, tag_size, nonce_size) {
|
|
1371
1402
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1372
1403
|
const len0 = WASM_VECTOR_LEN;
|
|
1373
|
-
const ret = wasm.
|
|
1404
|
+
const ret = wasm.aeadcipher_new_des_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1374
1405
|
if (ret[2]) {
|
|
1375
1406
|
throw takeFromExternrefTable0(ret[1]);
|
|
1376
1407
|
}
|
|
@@ -1378,12 +1409,14 @@ export class AeadCipher {
|
|
|
1378
1409
|
}
|
|
1379
1410
|
/**
|
|
1380
1411
|
* @param {Uint8Array} key
|
|
1412
|
+
* @param {number} tag_size
|
|
1413
|
+
* @param {number} nonce_size
|
|
1381
1414
|
* @returns {AeadCipher}
|
|
1382
1415
|
*/
|
|
1383
|
-
static
|
|
1416
|
+
static new_des_eax(key, tag_size, nonce_size) {
|
|
1384
1417
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1385
1418
|
const len0 = WASM_VECTOR_LEN;
|
|
1386
|
-
const ret = wasm.
|
|
1419
|
+
const ret = wasm.aeadcipher_new_des_eax(ptr0, len0, tag_size, nonce_size);
|
|
1387
1420
|
if (ret[2]) {
|
|
1388
1421
|
throw takeFromExternrefTable0(ret[1]);
|
|
1389
1422
|
}
|
|
@@ -1393,62 +1426,29 @@ export class AeadCipher {
|
|
|
1393
1426
|
* @param {Uint8Array} key
|
|
1394
1427
|
* @returns {AeadCipher}
|
|
1395
1428
|
*/
|
|
1396
|
-
static
|
|
1429
|
+
static new_tripledes_gcm(key) {
|
|
1397
1430
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1398
1431
|
const len0 = WASM_VECTOR_LEN;
|
|
1399
|
-
const ret = wasm.
|
|
1432
|
+
const ret = wasm.aeadcipher_new_tripledes_gcm(ptr0, len0);
|
|
1400
1433
|
if (ret[2]) {
|
|
1401
1434
|
throw takeFromExternrefTable0(ret[1]);
|
|
1402
1435
|
}
|
|
1403
1436
|
return AeadCipher.__wrap(ret[0]);
|
|
1404
1437
|
}
|
|
1405
1438
|
/**
|
|
1406
|
-
* @param {Uint8Array}
|
|
1407
|
-
* @param {
|
|
1408
|
-
* @param {
|
|
1409
|
-
* @
|
|
1410
|
-
*/
|
|
1411
|
-
open_in_place_separate_tag(data, tag, nonce, aad) {
|
|
1412
|
-
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1413
|
-
var len0 = WASM_VECTOR_LEN;
|
|
1414
|
-
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
|
|
1415
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1416
|
-
const ptr2 = passArray8ToWasm0(nonce, wasm.__wbindgen_malloc);
|
|
1417
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1418
|
-
const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
|
|
1419
|
-
const len3 = WASM_VECTOR_LEN;
|
|
1420
|
-
const ret = wasm.aeadcipher_open_in_place_separate_tag(this.__wbg_ptr, ptr0, len0, data, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1421
|
-
if (ret[1]) {
|
|
1422
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
1423
|
-
}
|
|
1424
|
-
}
|
|
1425
|
-
/**
|
|
1426
|
-
* @param {Uint8Array} data
|
|
1427
|
-
* @param {Uint8Array} nonce
|
|
1428
|
-
* @param {Uint8Array} aad
|
|
1429
|
-
* @returns {Uint8Array}
|
|
1439
|
+
* @param {Uint8Array} key
|
|
1440
|
+
* @param {number} tag_size
|
|
1441
|
+
* @param {number} nonce_size
|
|
1442
|
+
* @returns {AeadCipher}
|
|
1430
1443
|
*/
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1438
|
-
const ret = wasm.aeadcipher_seal_in_place_separate_tag(this.__wbg_ptr, ptr0, len0, data, ptr1, len1, ptr2, len2);
|
|
1439
|
-
if (ret[3]) {
|
|
1440
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1444
|
+
static new_tripledes_ocb3(key, tag_size, nonce_size) {
|
|
1445
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1446
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1447
|
+
const ret = wasm.aeadcipher_new_tripledes_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1448
|
+
if (ret[2]) {
|
|
1449
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1441
1450
|
}
|
|
1442
|
-
|
|
1443
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1444
|
-
return v4;
|
|
1445
|
-
}
|
|
1446
|
-
/**
|
|
1447
|
-
* @returns {number}
|
|
1448
|
-
*/
|
|
1449
|
-
tag_size() {
|
|
1450
|
-
const ret = wasm.aeadcipher_tag_size(this.__wbg_ptr);
|
|
1451
|
-
return ret >>> 0;
|
|
1451
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
1454
|
if (Symbol.dispose) AeadCipher.prototype[Symbol.dispose] = AeadCipher.prototype.free;
|
|
@@ -1481,30 +1481,58 @@ export class BlockCipher {
|
|
|
1481
1481
|
/**
|
|
1482
1482
|
* @param {Uint8Array} key
|
|
1483
1483
|
* @param {Uint8Array} iv
|
|
1484
|
+
* @param {number | null} [rounds]
|
|
1484
1485
|
* @returns {BlockCipher}
|
|
1485
1486
|
*/
|
|
1486
|
-
static
|
|
1487
|
+
static new_multi2_cbc(key, iv, rounds) {
|
|
1487
1488
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1488
1489
|
const len0 = WASM_VECTOR_LEN;
|
|
1489
1490
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1490
1491
|
const len1 = WASM_VECTOR_LEN;
|
|
1491
|
-
const ret = wasm.
|
|
1492
|
+
const ret = wasm.blockcipher_new_multi2_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1492
1493
|
if (ret[2]) {
|
|
1493
1494
|
throw takeFromExternrefTable0(ret[1]);
|
|
1494
1495
|
}
|
|
1495
1496
|
return BlockCipher.__wrap(ret[0]);
|
|
1496
1497
|
}
|
|
1498
|
+
/**
|
|
1499
|
+
* @param {Uint8Array} data
|
|
1500
|
+
* @returns {number}
|
|
1501
|
+
*/
|
|
1502
|
+
decrypt(data) {
|
|
1503
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1504
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1505
|
+
const ret = wasm.blockcipher_decrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
1506
|
+
if (ret[2]) {
|
|
1507
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1508
|
+
}
|
|
1509
|
+
return ret[0] >>> 0;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* @param {Uint8Array} data
|
|
1513
|
+
* @param {number} pos
|
|
1514
|
+
* @returns {number}
|
|
1515
|
+
*/
|
|
1516
|
+
encrypt(data, pos) {
|
|
1517
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1518
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1519
|
+
const ret = wasm.blockcipher_encrypt(this.__wbg_ptr, ptr0, len0, data, pos);
|
|
1520
|
+
if (ret[2]) {
|
|
1521
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1522
|
+
}
|
|
1523
|
+
return ret[0] >>> 0;
|
|
1524
|
+
}
|
|
1497
1525
|
/**
|
|
1498
1526
|
* @param {Uint8Array} key
|
|
1499
1527
|
* @param {Uint8Array} iv
|
|
1500
1528
|
* @returns {BlockCipher}
|
|
1501
1529
|
*/
|
|
1502
|
-
static
|
|
1530
|
+
static new_aes_cbc(key, iv) {
|
|
1503
1531
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1504
1532
|
const len0 = WASM_VECTOR_LEN;
|
|
1505
1533
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1506
1534
|
const len1 = WASM_VECTOR_LEN;
|
|
1507
|
-
const ret = wasm.
|
|
1535
|
+
const ret = wasm.blockcipher_new_aes_cbc(ptr0, len0, ptr1, len1);
|
|
1508
1536
|
if (ret[2]) {
|
|
1509
1537
|
throw takeFromExternrefTable0(ret[1]);
|
|
1510
1538
|
}
|
|
@@ -1513,15 +1541,14 @@ export class BlockCipher {
|
|
|
1513
1541
|
/**
|
|
1514
1542
|
* @param {Uint8Array} key
|
|
1515
1543
|
* @param {Uint8Array} iv
|
|
1516
|
-
* @param {number | null} [rounds]
|
|
1517
1544
|
* @returns {BlockCipher}
|
|
1518
1545
|
*/
|
|
1519
|
-
static
|
|
1546
|
+
static new_aria_cbc(key, iv) {
|
|
1520
1547
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1521
1548
|
const len0 = WASM_VECTOR_LEN;
|
|
1522
1549
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1523
1550
|
const len1 = WASM_VECTOR_LEN;
|
|
1524
|
-
const ret = wasm.
|
|
1551
|
+
const ret = wasm.blockcipher_new_aria_cbc(ptr0, len0, ptr1, len1);
|
|
1525
1552
|
if (ret[2]) {
|
|
1526
1553
|
throw takeFromExternrefTable0(ret[1]);
|
|
1527
1554
|
}
|
|
@@ -1530,15 +1557,14 @@ export class BlockCipher {
|
|
|
1530
1557
|
/**
|
|
1531
1558
|
* @param {Uint8Array} key
|
|
1532
1559
|
* @param {Uint8Array} iv
|
|
1533
|
-
* @param {number | null} [rounds]
|
|
1534
1560
|
* @returns {BlockCipher}
|
|
1535
1561
|
*/
|
|
1536
|
-
static
|
|
1562
|
+
static new_blowfish_cbc(key, iv) {
|
|
1537
1563
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1538
1564
|
const len0 = WASM_VECTOR_LEN;
|
|
1539
1565
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1540
1566
|
const len1 = WASM_VECTOR_LEN;
|
|
1541
|
-
const ret = wasm.
|
|
1567
|
+
const ret = wasm.blockcipher_new_blowfish_cbc(ptr0, len0, ptr1, len1);
|
|
1542
1568
|
if (ret[2]) {
|
|
1543
1569
|
throw takeFromExternrefTable0(ret[1]);
|
|
1544
1570
|
}
|
|
@@ -1549,12 +1575,12 @@ export class BlockCipher {
|
|
|
1549
1575
|
* @param {Uint8Array} iv
|
|
1550
1576
|
* @returns {BlockCipher}
|
|
1551
1577
|
*/
|
|
1552
|
-
static
|
|
1578
|
+
static new_cast5_cbc(key, iv) {
|
|
1553
1579
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1554
1580
|
const len0 = WASM_VECTOR_LEN;
|
|
1555
1581
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1556
1582
|
const len1 = WASM_VECTOR_LEN;
|
|
1557
|
-
const ret = wasm.
|
|
1583
|
+
const ret = wasm.blockcipher_new_cast5_cbc(ptr0, len0, ptr1, len1);
|
|
1558
1584
|
if (ret[2]) {
|
|
1559
1585
|
throw takeFromExternrefTable0(ret[1]);
|
|
1560
1586
|
}
|
|
@@ -1565,12 +1591,12 @@ export class BlockCipher {
|
|
|
1565
1591
|
* @param {Uint8Array} iv
|
|
1566
1592
|
* @returns {BlockCipher}
|
|
1567
1593
|
*/
|
|
1568
|
-
static
|
|
1594
|
+
static new_des_cbc(key, iv) {
|
|
1569
1595
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1570
1596
|
const len0 = WASM_VECTOR_LEN;
|
|
1571
1597
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1572
1598
|
const len1 = WASM_VECTOR_LEN;
|
|
1573
|
-
const ret = wasm.
|
|
1599
|
+
const ret = wasm.blockcipher_new_des_cbc(ptr0, len0, ptr1, len1);
|
|
1574
1600
|
if (ret[2]) {
|
|
1575
1601
|
throw takeFromExternrefTable0(ret[1]);
|
|
1576
1602
|
}
|
|
@@ -1581,12 +1607,12 @@ export class BlockCipher {
|
|
|
1581
1607
|
* @param {Uint8Array} iv
|
|
1582
1608
|
* @returns {BlockCipher}
|
|
1583
1609
|
*/
|
|
1584
|
-
static
|
|
1610
|
+
static new_tripledes_cbc(key, iv) {
|
|
1585
1611
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1586
1612
|
const len0 = WASM_VECTOR_LEN;
|
|
1587
1613
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1588
1614
|
const len1 = WASM_VECTOR_LEN;
|
|
1589
|
-
const ret = wasm.
|
|
1615
|
+
const ret = wasm.blockcipher_new_tripledes_cbc(ptr0, len0, ptr1, len1);
|
|
1590
1616
|
if (ret[2]) {
|
|
1591
1617
|
throw takeFromExternrefTable0(ret[1]);
|
|
1592
1618
|
}
|
|
@@ -1597,12 +1623,12 @@ export class BlockCipher {
|
|
|
1597
1623
|
* @param {Uint8Array} iv
|
|
1598
1624
|
* @returns {BlockCipher}
|
|
1599
1625
|
*/
|
|
1600
|
-
static
|
|
1626
|
+
static new_tea_cbc(key, iv) {
|
|
1601
1627
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1602
1628
|
const len0 = WASM_VECTOR_LEN;
|
|
1603
1629
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1604
1630
|
const len1 = WASM_VECTOR_LEN;
|
|
1605
|
-
const ret = wasm.
|
|
1631
|
+
const ret = wasm.blockcipher_new_tea_cbc(ptr0, len0, ptr1, len1);
|
|
1606
1632
|
if (ret[2]) {
|
|
1607
1633
|
throw takeFromExternrefTable0(ret[1]);
|
|
1608
1634
|
}
|
|
@@ -1613,12 +1639,12 @@ export class BlockCipher {
|
|
|
1613
1639
|
* @param {Uint8Array} iv
|
|
1614
1640
|
* @returns {BlockCipher}
|
|
1615
1641
|
*/
|
|
1616
|
-
static
|
|
1642
|
+
static new_twofish_cbc(key, iv) {
|
|
1617
1643
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1618
1644
|
const len0 = WASM_VECTOR_LEN;
|
|
1619
1645
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1620
1646
|
const len1 = WASM_VECTOR_LEN;
|
|
1621
|
-
const ret = wasm.
|
|
1647
|
+
const ret = wasm.blockcipher_new_twofish_cbc(ptr0, len0, ptr1, len1);
|
|
1622
1648
|
if (ret[2]) {
|
|
1623
1649
|
throw takeFromExternrefTable0(ret[1]);
|
|
1624
1650
|
}
|
|
@@ -1645,12 +1671,12 @@ export class BlockCipher {
|
|
|
1645
1671
|
* @param {Uint8Array} iv
|
|
1646
1672
|
* @returns {BlockCipher}
|
|
1647
1673
|
*/
|
|
1648
|
-
static
|
|
1674
|
+
static new_idea_cbc(key, iv) {
|
|
1649
1675
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1650
1676
|
const len0 = WASM_VECTOR_LEN;
|
|
1651
1677
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1652
1678
|
const len1 = WASM_VECTOR_LEN;
|
|
1653
|
-
const ret = wasm.
|
|
1679
|
+
const ret = wasm.blockcipher_new_idea_cbc(ptr0, len0, ptr1, len1);
|
|
1654
1680
|
if (ret[2]) {
|
|
1655
1681
|
throw takeFromExternrefTable0(ret[1]);
|
|
1656
1682
|
}
|
|
@@ -1661,12 +1687,12 @@ export class BlockCipher {
|
|
|
1661
1687
|
* @param {Uint8Array} iv
|
|
1662
1688
|
* @returns {BlockCipher}
|
|
1663
1689
|
*/
|
|
1664
|
-
static
|
|
1690
|
+
static new_rc6_cbc(key, iv) {
|
|
1665
1691
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1666
1692
|
const len0 = WASM_VECTOR_LEN;
|
|
1667
1693
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1668
1694
|
const len1 = WASM_VECTOR_LEN;
|
|
1669
|
-
const ret = wasm.
|
|
1695
|
+
const ret = wasm.blockcipher_new_rc6_cbc(ptr0, len0, ptr1, len1);
|
|
1670
1696
|
if (ret[2]) {
|
|
1671
1697
|
throw takeFromExternrefTable0(ret[1]);
|
|
1672
1698
|
}
|
|
@@ -1677,12 +1703,12 @@ export class BlockCipher {
|
|
|
1677
1703
|
* @param {Uint8Array} iv
|
|
1678
1704
|
* @returns {BlockCipher}
|
|
1679
1705
|
*/
|
|
1680
|
-
static
|
|
1706
|
+
static new_sm4_cbc(key, iv) {
|
|
1681
1707
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1682
1708
|
const len0 = WASM_VECTOR_LEN;
|
|
1683
1709
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1684
1710
|
const len1 = WASM_VECTOR_LEN;
|
|
1685
|
-
const ret = wasm.
|
|
1711
|
+
const ret = wasm.blockcipher_new_sm4_cbc(ptr0, len0, ptr1, len1);
|
|
1686
1712
|
if (ret[2]) {
|
|
1687
1713
|
throw takeFromExternrefTable0(ret[1]);
|
|
1688
1714
|
}
|
|
@@ -1693,12 +1719,12 @@ export class BlockCipher {
|
|
|
1693
1719
|
* @param {Uint8Array} iv
|
|
1694
1720
|
* @returns {BlockCipher}
|
|
1695
1721
|
*/
|
|
1696
|
-
static
|
|
1722
|
+
static new_skipjack_cbc(key, iv) {
|
|
1697
1723
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1698
1724
|
const len0 = WASM_VECTOR_LEN;
|
|
1699
1725
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1700
1726
|
const len1 = WASM_VECTOR_LEN;
|
|
1701
|
-
const ret = wasm.
|
|
1727
|
+
const ret = wasm.blockcipher_new_skipjack_cbc(ptr0, len0, ptr1, len1);
|
|
1702
1728
|
if (ret[2]) {
|
|
1703
1729
|
throw takeFromExternrefTable0(ret[1]);
|
|
1704
1730
|
}
|
|
@@ -1709,12 +1735,12 @@ export class BlockCipher {
|
|
|
1709
1735
|
* @param {Uint8Array} iv
|
|
1710
1736
|
* @returns {BlockCipher}
|
|
1711
1737
|
*/
|
|
1712
|
-
static
|
|
1738
|
+
static new_kasumi_cbc(key, iv) {
|
|
1713
1739
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1714
1740
|
const len0 = WASM_VECTOR_LEN;
|
|
1715
1741
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1716
1742
|
const len1 = WASM_VECTOR_LEN;
|
|
1717
|
-
const ret = wasm.
|
|
1743
|
+
const ret = wasm.blockcipher_new_kasumi_cbc(ptr0, len0, ptr1, len1);
|
|
1718
1744
|
if (ret[2]) {
|
|
1719
1745
|
throw takeFromExternrefTable0(ret[1]);
|
|
1720
1746
|
}
|
|
@@ -1723,15 +1749,14 @@ export class BlockCipher {
|
|
|
1723
1749
|
/**
|
|
1724
1750
|
* @param {Uint8Array} key
|
|
1725
1751
|
* @param {Uint8Array} iv
|
|
1726
|
-
* @param {number | null} [rounds]
|
|
1727
1752
|
* @returns {BlockCipher}
|
|
1728
1753
|
*/
|
|
1729
|
-
static
|
|
1754
|
+
static new_kseed_cbc(key, iv) {
|
|
1730
1755
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1731
1756
|
const len0 = WASM_VECTOR_LEN;
|
|
1732
1757
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1733
1758
|
const len1 = WASM_VECTOR_LEN;
|
|
1734
|
-
const ret = wasm.
|
|
1759
|
+
const ret = wasm.blockcipher_new_kseed_cbc(ptr0, len0, ptr1, len1);
|
|
1735
1760
|
if (ret[2]) {
|
|
1736
1761
|
throw takeFromExternrefTable0(ret[1]);
|
|
1737
1762
|
}
|
|
@@ -1742,12 +1767,12 @@ export class BlockCipher {
|
|
|
1742
1767
|
* @param {Uint8Array} iv
|
|
1743
1768
|
* @returns {BlockCipher}
|
|
1744
1769
|
*/
|
|
1745
|
-
static
|
|
1770
|
+
static new_anubis_cbc(key, iv) {
|
|
1746
1771
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1747
1772
|
const len0 = WASM_VECTOR_LEN;
|
|
1748
1773
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1749
1774
|
const len1 = WASM_VECTOR_LEN;
|
|
1750
|
-
const ret = wasm.
|
|
1775
|
+
const ret = wasm.blockcipher_new_anubis_cbc(ptr0, len0, ptr1, len1);
|
|
1751
1776
|
if (ret[2]) {
|
|
1752
1777
|
throw takeFromExternrefTable0(ret[1]);
|
|
1753
1778
|
}
|
|
@@ -1758,12 +1783,12 @@ export class BlockCipher {
|
|
|
1758
1783
|
* @param {Uint8Array} iv
|
|
1759
1784
|
* @returns {BlockCipher}
|
|
1760
1785
|
*/
|
|
1761
|
-
static
|
|
1786
|
+
static new_noekeon_cbc(key, iv) {
|
|
1762
1787
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1763
1788
|
const len0 = WASM_VECTOR_LEN;
|
|
1764
1789
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1765
1790
|
const len1 = WASM_VECTOR_LEN;
|
|
1766
|
-
const ret = wasm.
|
|
1791
|
+
const ret = wasm.blockcipher_new_noekeon_cbc(ptr0, len0, ptr1, len1);
|
|
1767
1792
|
if (ret[2]) {
|
|
1768
1793
|
throw takeFromExternrefTable0(ret[1]);
|
|
1769
1794
|
}
|
|
@@ -1774,12 +1799,12 @@ export class BlockCipher {
|
|
|
1774
1799
|
* @param {Uint8Array} iv
|
|
1775
1800
|
* @returns {BlockCipher}
|
|
1776
1801
|
*/
|
|
1777
|
-
static
|
|
1802
|
+
static new_khazad_cbc(key, iv) {
|
|
1778
1803
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1779
1804
|
const len0 = WASM_VECTOR_LEN;
|
|
1780
1805
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1781
1806
|
const len1 = WASM_VECTOR_LEN;
|
|
1782
|
-
const ret = wasm.
|
|
1807
|
+
const ret = wasm.blockcipher_new_khazad_cbc(ptr0, len0, ptr1, len1);
|
|
1783
1808
|
if (ret[2]) {
|
|
1784
1809
|
throw takeFromExternrefTable0(ret[1]);
|
|
1785
1810
|
}
|
|
@@ -1790,12 +1815,12 @@ export class BlockCipher {
|
|
|
1790
1815
|
* @param {Uint8Array} iv
|
|
1791
1816
|
* @returns {BlockCipher}
|
|
1792
1817
|
*/
|
|
1793
|
-
static
|
|
1818
|
+
static new_serpent_cbc(key, iv) {
|
|
1794
1819
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1795
1820
|
const len0 = WASM_VECTOR_LEN;
|
|
1796
1821
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1797
1822
|
const len1 = WASM_VECTOR_LEN;
|
|
1798
|
-
const ret = wasm.
|
|
1823
|
+
const ret = wasm.blockcipher_new_serpent_cbc(ptr0, len0, ptr1, len1);
|
|
1799
1824
|
if (ret[2]) {
|
|
1800
1825
|
throw takeFromExternrefTable0(ret[1]);
|
|
1801
1826
|
}
|
|
@@ -1807,12 +1832,12 @@ export class BlockCipher {
|
|
|
1807
1832
|
* @param {number | null} [rounds]
|
|
1808
1833
|
* @returns {BlockCipher}
|
|
1809
1834
|
*/
|
|
1810
|
-
static
|
|
1835
|
+
static new_rc2_cbc(key, iv, rounds) {
|
|
1811
1836
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1812
1837
|
const len0 = WASM_VECTOR_LEN;
|
|
1813
1838
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1814
1839
|
const len1 = WASM_VECTOR_LEN;
|
|
1815
|
-
const ret = wasm.
|
|
1840
|
+
const ret = wasm.blockcipher_new_rc2_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1816
1841
|
if (ret[2]) {
|
|
1817
1842
|
throw takeFromExternrefTable0(ret[1]);
|
|
1818
1843
|
}
|
|
@@ -1821,14 +1846,15 @@ export class BlockCipher {
|
|
|
1821
1846
|
/**
|
|
1822
1847
|
* @param {Uint8Array} key
|
|
1823
1848
|
* @param {Uint8Array} iv
|
|
1849
|
+
* @param {number | null} [rounds]
|
|
1824
1850
|
* @returns {BlockCipher}
|
|
1825
1851
|
*/
|
|
1826
|
-
static
|
|
1852
|
+
static new_rc5_cbc(key, iv, rounds) {
|
|
1827
1853
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1828
1854
|
const len0 = WASM_VECTOR_LEN;
|
|
1829
1855
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1830
1856
|
const len1 = WASM_VECTOR_LEN;
|
|
1831
|
-
const ret = wasm.
|
|
1857
|
+
const ret = wasm.blockcipher_new_rc5_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1832
1858
|
if (ret[2]) {
|
|
1833
1859
|
throw takeFromExternrefTable0(ret[1]);
|
|
1834
1860
|
}
|
|
@@ -1837,46 +1863,20 @@ export class BlockCipher {
|
|
|
1837
1863
|
/**
|
|
1838
1864
|
* @param {Uint8Array} key
|
|
1839
1865
|
* @param {Uint8Array} iv
|
|
1866
|
+
* @param {number | null} [rounds]
|
|
1840
1867
|
* @returns {BlockCipher}
|
|
1841
1868
|
*/
|
|
1842
|
-
static
|
|
1869
|
+
static new_camellia_cbc(key, iv, rounds) {
|
|
1843
1870
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1844
1871
|
const len0 = WASM_VECTOR_LEN;
|
|
1845
1872
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1846
1873
|
const len1 = WASM_VECTOR_LEN;
|
|
1847
|
-
const ret = wasm.
|
|
1874
|
+
const ret = wasm.blockcipher_new_camellia_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1848
1875
|
if (ret[2]) {
|
|
1849
1876
|
throw takeFromExternrefTable0(ret[1]);
|
|
1850
1877
|
}
|
|
1851
1878
|
return BlockCipher.__wrap(ret[0]);
|
|
1852
1879
|
}
|
|
1853
|
-
/**
|
|
1854
|
-
* @param {Uint8Array} data
|
|
1855
|
-
* @returns {number}
|
|
1856
|
-
*/
|
|
1857
|
-
decrypt(data) {
|
|
1858
|
-
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1859
|
-
var len0 = WASM_VECTOR_LEN;
|
|
1860
|
-
const ret = wasm.blockcipher_decrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
1861
|
-
if (ret[2]) {
|
|
1862
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1863
|
-
}
|
|
1864
|
-
return ret[0] >>> 0;
|
|
1865
|
-
}
|
|
1866
|
-
/**
|
|
1867
|
-
* @param {Uint8Array} data
|
|
1868
|
-
* @param {number} pos
|
|
1869
|
-
* @returns {number}
|
|
1870
|
-
*/
|
|
1871
|
-
encrypt(data, pos) {
|
|
1872
|
-
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1873
|
-
var len0 = WASM_VECTOR_LEN;
|
|
1874
|
-
const ret = wasm.blockcipher_encrypt(this.__wbg_ptr, ptr0, len0, data, pos);
|
|
1875
|
-
if (ret[2]) {
|
|
1876
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1877
|
-
}
|
|
1878
|
-
return ret[0] >>> 0;
|
|
1879
|
-
}
|
|
1880
1880
|
}
|
|
1881
1881
|
if (Symbol.dispose) BlockCipher.prototype[Symbol.dispose] = BlockCipher.prototype.free;
|
|
1882
1882
|
|
|
@@ -1906,17 +1906,13 @@ export class Hash {
|
|
|
1906
1906
|
wasm.__wbg_hash_free(ptr, 0);
|
|
1907
1907
|
}
|
|
1908
1908
|
/**
|
|
1909
|
-
* @
|
|
1910
|
-
*/
|
|
1911
|
-
block_size() {
|
|
1912
|
-
const ret = wasm.hash_block_size(this.__wbg_ptr);
|
|
1913
|
-
return ret >>> 0;
|
|
1914
|
-
}
|
|
1915
|
-
/**
|
|
1909
|
+
* @param {Uint8Array} key
|
|
1916
1910
|
* @returns {Hash}
|
|
1917
1911
|
*/
|
|
1918
|
-
static
|
|
1919
|
-
const
|
|
1912
|
+
static new_md2_hmac(key) {
|
|
1913
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1914
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1915
|
+
const ret = wasm.hash_new_md2_hmac(ptr0, len0);
|
|
1920
1916
|
if (ret[2]) {
|
|
1921
1917
|
throw takeFromExternrefTable0(ret[1]);
|
|
1922
1918
|
}
|
|
@@ -1925,18 +1921,21 @@ export class Hash {
|
|
|
1925
1921
|
/**
|
|
1926
1922
|
* @returns {Hash}
|
|
1927
1923
|
*/
|
|
1928
|
-
static
|
|
1929
|
-
const ret = wasm.
|
|
1924
|
+
static new_md2() {
|
|
1925
|
+
const ret = wasm.hash_new_md2();
|
|
1930
1926
|
if (ret[2]) {
|
|
1931
1927
|
throw takeFromExternrefTable0(ret[1]);
|
|
1932
1928
|
}
|
|
1933
1929
|
return Hash.__wrap(ret[0]);
|
|
1934
1930
|
}
|
|
1935
1931
|
/**
|
|
1932
|
+
* @param {Uint8Array} key
|
|
1936
1933
|
* @returns {Hash}
|
|
1937
1934
|
*/
|
|
1938
|
-
static
|
|
1939
|
-
const
|
|
1935
|
+
static new_md4_hmac(key) {
|
|
1936
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1937
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1938
|
+
const ret = wasm.hash_new_md4_hmac(ptr0, len0);
|
|
1940
1939
|
if (ret[2]) {
|
|
1941
1940
|
throw takeFromExternrefTable0(ret[1]);
|
|
1942
1941
|
}
|
|
@@ -1945,36 +1944,31 @@ export class Hash {
|
|
|
1945
1944
|
/**
|
|
1946
1945
|
* @returns {Hash}
|
|
1947
1946
|
*/
|
|
1948
|
-
static
|
|
1949
|
-
const ret = wasm.
|
|
1947
|
+
static new_md4() {
|
|
1948
|
+
const ret = wasm.hash_new_md4();
|
|
1950
1949
|
if (ret[2]) {
|
|
1951
1950
|
throw takeFromExternrefTable0(ret[1]);
|
|
1952
1951
|
}
|
|
1953
1952
|
return Hash.__wrap(ret[0]);
|
|
1954
1953
|
}
|
|
1955
1954
|
/**
|
|
1956
|
-
* @param {Uint8Array
|
|
1957
|
-
* @param {number} output_len
|
|
1955
|
+
* @param {Uint8Array} key
|
|
1958
1956
|
* @returns {Hash}
|
|
1959
1957
|
*/
|
|
1960
|
-
static
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
const ret = wasm.
|
|
1958
|
+
static new_md5_hmac(key) {
|
|
1959
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1960
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1961
|
+
const ret = wasm.hash_new_md5_hmac(ptr0, len0);
|
|
1964
1962
|
if (ret[2]) {
|
|
1965
1963
|
throw takeFromExternrefTable0(ret[1]);
|
|
1966
1964
|
}
|
|
1967
1965
|
return Hash.__wrap(ret[0]);
|
|
1968
1966
|
}
|
|
1969
1967
|
/**
|
|
1970
|
-
* @param {Uint8Array | null | undefined} key
|
|
1971
|
-
* @param {number} output_len
|
|
1972
1968
|
* @returns {Hash}
|
|
1973
1969
|
*/
|
|
1974
|
-
static
|
|
1975
|
-
|
|
1976
|
-
var len0 = WASM_VECTOR_LEN;
|
|
1977
|
-
const ret = wasm.hash_new_blake2s(ptr0, len0, output_len);
|
|
1970
|
+
static new_md5() {
|
|
1971
|
+
const ret = wasm.hash_new_md5();
|
|
1978
1972
|
if (ret[2]) {
|
|
1979
1973
|
throw takeFromExternrefTable0(ret[1]);
|
|
1980
1974
|
}
|
|
@@ -1984,10 +1978,30 @@ export class Hash {
|
|
|
1984
1978
|
* @param {Uint8Array} key
|
|
1985
1979
|
* @returns {Hash}
|
|
1986
1980
|
*/
|
|
1987
|
-
static
|
|
1981
|
+
static new_sha1_hmac(key) {
|
|
1988
1982
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1989
1983
|
const len0 = WASM_VECTOR_LEN;
|
|
1990
|
-
const ret = wasm.
|
|
1984
|
+
const ret = wasm.hash_new_sha1_hmac(ptr0, len0);
|
|
1985
|
+
if (ret[2]) {
|
|
1986
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1987
|
+
}
|
|
1988
|
+
return Hash.__wrap(ret[0]);
|
|
1989
|
+
}
|
|
1990
|
+
/**
|
|
1991
|
+
* @returns {Hash}
|
|
1992
|
+
*/
|
|
1993
|
+
static new_sha1() {
|
|
1994
|
+
const ret = wasm.hash_new_sha1();
|
|
1995
|
+
if (ret[2]) {
|
|
1996
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1997
|
+
}
|
|
1998
|
+
return Hash.__wrap(ret[0]);
|
|
1999
|
+
}
|
|
2000
|
+
/**
|
|
2001
|
+
* @returns {Hash}
|
|
2002
|
+
*/
|
|
2003
|
+
static new_sha224() {
|
|
2004
|
+
const ret = wasm.hash_new_sha224();
|
|
1991
2005
|
if (ret[2]) {
|
|
1992
2006
|
throw takeFromExternrefTable0(ret[1]);
|
|
1993
2007
|
}
|
|
@@ -1997,10 +2011,20 @@ export class Hash {
|
|
|
1997
2011
|
* @param {Uint8Array} key
|
|
1998
2012
|
* @returns {Hash}
|
|
1999
2013
|
*/
|
|
2000
|
-
static
|
|
2014
|
+
static new_sha224_hmac(key) {
|
|
2001
2015
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2002
2016
|
const len0 = WASM_VECTOR_LEN;
|
|
2003
|
-
const ret = wasm.
|
|
2017
|
+
const ret = wasm.hash_new_sha224_hmac(ptr0, len0);
|
|
2018
|
+
if (ret[2]) {
|
|
2019
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2020
|
+
}
|
|
2021
|
+
return Hash.__wrap(ret[0]);
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* @returns {Hash}
|
|
2025
|
+
*/
|
|
2026
|
+
static new_sha256() {
|
|
2027
|
+
const ret = wasm.hash_new_sha256();
|
|
2004
2028
|
if (ret[2]) {
|
|
2005
2029
|
throw takeFromExternrefTable0(ret[1]);
|
|
2006
2030
|
}
|
|
@@ -2010,10 +2034,10 @@ export class Hash {
|
|
|
2010
2034
|
* @param {Uint8Array} key
|
|
2011
2035
|
* @returns {Hash}
|
|
2012
2036
|
*/
|
|
2013
|
-
static
|
|
2037
|
+
static new_sha256_hmac(key) {
|
|
2014
2038
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2015
2039
|
const len0 = WASM_VECTOR_LEN;
|
|
2016
|
-
const ret = wasm.
|
|
2040
|
+
const ret = wasm.hash_new_sha256_hmac(ptr0, len0);
|
|
2017
2041
|
if (ret[2]) {
|
|
2018
2042
|
throw takeFromExternrefTable0(ret[1]);
|
|
2019
2043
|
}
|
|
@@ -2022,18 +2046,21 @@ export class Hash {
|
|
|
2022
2046
|
/**
|
|
2023
2047
|
* @returns {Hash}
|
|
2024
2048
|
*/
|
|
2025
|
-
static
|
|
2026
|
-
const ret = wasm.
|
|
2049
|
+
static new_sha384() {
|
|
2050
|
+
const ret = wasm.hash_new_sha384();
|
|
2027
2051
|
if (ret[2]) {
|
|
2028
2052
|
throw takeFromExternrefTable0(ret[1]);
|
|
2029
2053
|
}
|
|
2030
2054
|
return Hash.__wrap(ret[0]);
|
|
2031
2055
|
}
|
|
2032
2056
|
/**
|
|
2057
|
+
* @param {Uint8Array} key
|
|
2033
2058
|
* @returns {Hash}
|
|
2034
2059
|
*/
|
|
2035
|
-
static
|
|
2036
|
-
const
|
|
2060
|
+
static new_sha384_hmac(key) {
|
|
2061
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2062
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2063
|
+
const ret = wasm.hash_new_sha384_hmac(ptr0, len0);
|
|
2037
2064
|
if (ret[2]) {
|
|
2038
2065
|
throw takeFromExternrefTable0(ret[1]);
|
|
2039
2066
|
}
|
|
@@ -2042,18 +2069,21 @@ export class Hash {
|
|
|
2042
2069
|
/**
|
|
2043
2070
|
* @returns {Hash}
|
|
2044
2071
|
*/
|
|
2045
|
-
static
|
|
2046
|
-
const ret = wasm.
|
|
2072
|
+
static new_sha512() {
|
|
2073
|
+
const ret = wasm.hash_new_sha512();
|
|
2047
2074
|
if (ret[2]) {
|
|
2048
2075
|
throw takeFromExternrefTable0(ret[1]);
|
|
2049
2076
|
}
|
|
2050
2077
|
return Hash.__wrap(ret[0]);
|
|
2051
2078
|
}
|
|
2052
2079
|
/**
|
|
2080
|
+
* @param {Uint8Array} key
|
|
2053
2081
|
* @returns {Hash}
|
|
2054
2082
|
*/
|
|
2055
|
-
static
|
|
2056
|
-
const
|
|
2083
|
+
static new_sha512_hmac(key) {
|
|
2084
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2085
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2086
|
+
const ret = wasm.hash_new_sha512_hmac(ptr0, len0);
|
|
2057
2087
|
if (ret[2]) {
|
|
2058
2088
|
throw takeFromExternrefTable0(ret[1]);
|
|
2059
2089
|
}
|
|
@@ -2062,18 +2092,31 @@ export class Hash {
|
|
|
2062
2092
|
/**
|
|
2063
2093
|
* @returns {Hash}
|
|
2064
2094
|
*/
|
|
2065
|
-
static
|
|
2066
|
-
const ret = wasm.
|
|
2095
|
+
static new_sha512_224() {
|
|
2096
|
+
const ret = wasm.hash_new_sha512_224();
|
|
2067
2097
|
if (ret[2]) {
|
|
2068
2098
|
throw takeFromExternrefTable0(ret[1]);
|
|
2069
2099
|
}
|
|
2070
2100
|
return Hash.__wrap(ret[0]);
|
|
2071
2101
|
}
|
|
2072
2102
|
/**
|
|
2103
|
+
* @param {Uint8Array} key
|
|
2073
2104
|
* @returns {Hash}
|
|
2074
2105
|
*/
|
|
2075
|
-
static
|
|
2076
|
-
const
|
|
2106
|
+
static new_sha512_224_hmac(key) {
|
|
2107
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2108
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2109
|
+
const ret = wasm.hash_new_sha512_224_hmac(ptr0, len0);
|
|
2110
|
+
if (ret[2]) {
|
|
2111
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2112
|
+
}
|
|
2113
|
+
return Hash.__wrap(ret[0]);
|
|
2114
|
+
}
|
|
2115
|
+
/**
|
|
2116
|
+
* @returns {Hash}
|
|
2117
|
+
*/
|
|
2118
|
+
static new_sha512_256() {
|
|
2119
|
+
const ret = wasm.hash_new_sha512_256();
|
|
2077
2120
|
if (ret[2]) {
|
|
2078
2121
|
throw takeFromExternrefTable0(ret[1]);
|
|
2079
2122
|
}
|
|
@@ -2083,10 +2126,20 @@ export class Hash {
|
|
|
2083
2126
|
* @param {Uint8Array} key
|
|
2084
2127
|
* @returns {Hash}
|
|
2085
2128
|
*/
|
|
2086
|
-
static
|
|
2129
|
+
static new_sha512_256_hmac(key) {
|
|
2087
2130
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2088
2131
|
const len0 = WASM_VECTOR_LEN;
|
|
2089
|
-
const ret = wasm.
|
|
2132
|
+
const ret = wasm.hash_new_sha512_256_hmac(ptr0, len0);
|
|
2133
|
+
if (ret[2]) {
|
|
2134
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2135
|
+
}
|
|
2136
|
+
return Hash.__wrap(ret[0]);
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* @returns {Hash}
|
|
2140
|
+
*/
|
|
2141
|
+
static new_sha3_224() {
|
|
2142
|
+
const ret = wasm.hash_new_sha3_224();
|
|
2090
2143
|
if (ret[2]) {
|
|
2091
2144
|
throw takeFromExternrefTable0(ret[1]);
|
|
2092
2145
|
}
|
|
@@ -2096,10 +2149,10 @@ export class Hash {
|
|
|
2096
2149
|
* @param {Uint8Array} key
|
|
2097
2150
|
* @returns {Hash}
|
|
2098
2151
|
*/
|
|
2099
|
-
static
|
|
2152
|
+
static new_sha3_224_hmac(key) {
|
|
2100
2153
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2101
2154
|
const len0 = WASM_VECTOR_LEN;
|
|
2102
|
-
const ret = wasm.
|
|
2155
|
+
const ret = wasm.hash_new_sha3_224_hmac(ptr0, len0);
|
|
2103
2156
|
if (ret[2]) {
|
|
2104
2157
|
throw takeFromExternrefTable0(ret[1]);
|
|
2105
2158
|
}
|
|
@@ -2108,31 +2161,31 @@ export class Hash {
|
|
|
2108
2161
|
/**
|
|
2109
2162
|
* @returns {Hash}
|
|
2110
2163
|
*/
|
|
2111
|
-
static
|
|
2112
|
-
const ret = wasm.
|
|
2164
|
+
static new_sha3_256() {
|
|
2165
|
+
const ret = wasm.hash_new_sha3_256();
|
|
2113
2166
|
if (ret[2]) {
|
|
2114
2167
|
throw takeFromExternrefTable0(ret[1]);
|
|
2115
2168
|
}
|
|
2116
2169
|
return Hash.__wrap(ret[0]);
|
|
2117
2170
|
}
|
|
2118
2171
|
/**
|
|
2172
|
+
* @param {Uint8Array} key
|
|
2119
2173
|
* @returns {Hash}
|
|
2120
2174
|
*/
|
|
2121
|
-
static
|
|
2122
|
-
const
|
|
2175
|
+
static new_sha3_256_hmac(key) {
|
|
2176
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2177
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2178
|
+
const ret = wasm.hash_new_sha3_256_hmac(ptr0, len0);
|
|
2123
2179
|
if (ret[2]) {
|
|
2124
2180
|
throw takeFromExternrefTable0(ret[1]);
|
|
2125
2181
|
}
|
|
2126
2182
|
return Hash.__wrap(ret[0]);
|
|
2127
2183
|
}
|
|
2128
2184
|
/**
|
|
2129
|
-
* @param {Uint8Array} key
|
|
2130
2185
|
* @returns {Hash}
|
|
2131
2186
|
*/
|
|
2132
|
-
static
|
|
2133
|
-
const
|
|
2134
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2135
|
-
const ret = wasm.hash_new_sha224_hmac(ptr0, len0);
|
|
2187
|
+
static new_sha3_384() {
|
|
2188
|
+
const ret = wasm.hash_new_sha3_384();
|
|
2136
2189
|
if (ret[2]) {
|
|
2137
2190
|
throw takeFromExternrefTable0(ret[1]);
|
|
2138
2191
|
}
|
|
@@ -2142,23 +2195,20 @@ export class Hash {
|
|
|
2142
2195
|
* @param {Uint8Array} key
|
|
2143
2196
|
* @returns {Hash}
|
|
2144
2197
|
*/
|
|
2145
|
-
static
|
|
2198
|
+
static new_sha3_384_hmac(key) {
|
|
2146
2199
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2147
2200
|
const len0 = WASM_VECTOR_LEN;
|
|
2148
|
-
const ret = wasm.
|
|
2201
|
+
const ret = wasm.hash_new_sha3_384_hmac(ptr0, len0);
|
|
2149
2202
|
if (ret[2]) {
|
|
2150
2203
|
throw takeFromExternrefTable0(ret[1]);
|
|
2151
2204
|
}
|
|
2152
2205
|
return Hash.__wrap(ret[0]);
|
|
2153
2206
|
}
|
|
2154
2207
|
/**
|
|
2155
|
-
* @param {Uint8Array} key
|
|
2156
2208
|
* @returns {Hash}
|
|
2157
2209
|
*/
|
|
2158
|
-
static
|
|
2159
|
-
const
|
|
2160
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2161
|
-
const ret = wasm.hash_new_sha384_hmac(ptr0, len0);
|
|
2210
|
+
static new_sha3_512() {
|
|
2211
|
+
const ret = wasm.hash_new_sha3_512();
|
|
2162
2212
|
if (ret[2]) {
|
|
2163
2213
|
throw takeFromExternrefTable0(ret[1]);
|
|
2164
2214
|
}
|
|
@@ -2168,23 +2218,20 @@ export class Hash {
|
|
|
2168
2218
|
* @param {Uint8Array} key
|
|
2169
2219
|
* @returns {Hash}
|
|
2170
2220
|
*/
|
|
2171
|
-
static
|
|
2221
|
+
static new_sha3_512_hmac(key) {
|
|
2172
2222
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2173
2223
|
const len0 = WASM_VECTOR_LEN;
|
|
2174
|
-
const ret = wasm.
|
|
2224
|
+
const ret = wasm.hash_new_sha3_512_hmac(ptr0, len0);
|
|
2175
2225
|
if (ret[2]) {
|
|
2176
2226
|
throw takeFromExternrefTable0(ret[1]);
|
|
2177
2227
|
}
|
|
2178
2228
|
return Hash.__wrap(ret[0]);
|
|
2179
2229
|
}
|
|
2180
2230
|
/**
|
|
2181
|
-
* @param {Uint8Array} key
|
|
2182
2231
|
* @returns {Hash}
|
|
2183
2232
|
*/
|
|
2184
|
-
static
|
|
2185
|
-
const
|
|
2186
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2187
|
-
const ret = wasm.hash_new_sha3_224_hmac(ptr0, len0);
|
|
2233
|
+
static new_shake128() {
|
|
2234
|
+
const ret = wasm.hash_new_shake128();
|
|
2188
2235
|
if (ret[2]) {
|
|
2189
2236
|
throw takeFromExternrefTable0(ret[1]);
|
|
2190
2237
|
}
|
|
@@ -2194,23 +2241,20 @@ export class Hash {
|
|
|
2194
2241
|
* @param {Uint8Array} key
|
|
2195
2242
|
* @returns {Hash}
|
|
2196
2243
|
*/
|
|
2197
|
-
static
|
|
2244
|
+
static new_shake128_hmac(key) {
|
|
2198
2245
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2199
2246
|
const len0 = WASM_VECTOR_LEN;
|
|
2200
|
-
const ret = wasm.
|
|
2247
|
+
const ret = wasm.hash_new_shake128_hmac(ptr0, len0);
|
|
2201
2248
|
if (ret[2]) {
|
|
2202
2249
|
throw takeFromExternrefTable0(ret[1]);
|
|
2203
2250
|
}
|
|
2204
2251
|
return Hash.__wrap(ret[0]);
|
|
2205
2252
|
}
|
|
2206
2253
|
/**
|
|
2207
|
-
* @param {Uint8Array} key
|
|
2208
2254
|
* @returns {Hash}
|
|
2209
2255
|
*/
|
|
2210
|
-
static
|
|
2211
|
-
const
|
|
2212
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2213
|
-
const ret = wasm.hash_new_sha3_384_hmac(ptr0, len0);
|
|
2256
|
+
static new_shake256() {
|
|
2257
|
+
const ret = wasm.hash_new_shake256();
|
|
2214
2258
|
if (ret[2]) {
|
|
2215
2259
|
throw takeFromExternrefTable0(ret[1]);
|
|
2216
2260
|
}
|
|
@@ -2220,10 +2264,10 @@ export class Hash {
|
|
|
2220
2264
|
* @param {Uint8Array} key
|
|
2221
2265
|
* @returns {Hash}
|
|
2222
2266
|
*/
|
|
2223
|
-
static
|
|
2267
|
+
static new_shake256_hmac(key) {
|
|
2224
2268
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2225
2269
|
const len0 = WASM_VECTOR_LEN;
|
|
2226
|
-
const ret = wasm.
|
|
2270
|
+
const ret = wasm.hash_new_shake256_hmac(ptr0, len0);
|
|
2227
2271
|
if (ret[2]) {
|
|
2228
2272
|
throw takeFromExternrefTable0(ret[1]);
|
|
2229
2273
|
}
|
|
@@ -2233,54 +2277,60 @@ export class Hash {
|
|
|
2233
2277
|
* @param {Uint8Array} key
|
|
2234
2278
|
* @returns {Hash}
|
|
2235
2279
|
*/
|
|
2236
|
-
static
|
|
2280
|
+
static new_sm3_hmac(key) {
|
|
2237
2281
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2238
2282
|
const len0 = WASM_VECTOR_LEN;
|
|
2239
|
-
const ret = wasm.
|
|
2283
|
+
const ret = wasm.hash_new_sm3_hmac(ptr0, len0);
|
|
2240
2284
|
if (ret[2]) {
|
|
2241
2285
|
throw takeFromExternrefTable0(ret[1]);
|
|
2242
2286
|
}
|
|
2243
2287
|
return Hash.__wrap(ret[0]);
|
|
2244
2288
|
}
|
|
2245
2289
|
/**
|
|
2246
|
-
* @param {Uint8Array} key
|
|
2247
2290
|
* @returns {Hash}
|
|
2248
2291
|
*/
|
|
2249
|
-
static
|
|
2250
|
-
const
|
|
2251
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2252
|
-
const ret = wasm.hash_new_shake256_hmac(ptr0, len0);
|
|
2292
|
+
static new_sm3() {
|
|
2293
|
+
const ret = wasm.hash_new_sm3();
|
|
2253
2294
|
if (ret[2]) {
|
|
2254
2295
|
throw takeFromExternrefTable0(ret[1]);
|
|
2255
2296
|
}
|
|
2256
2297
|
return Hash.__wrap(ret[0]);
|
|
2257
2298
|
}
|
|
2258
2299
|
/**
|
|
2259
|
-
* @param {Uint8Array} key
|
|
2300
|
+
* @param {Uint8Array | null | undefined} key
|
|
2301
|
+
* @param {number} output_len
|
|
2260
2302
|
* @returns {Hash}
|
|
2261
2303
|
*/
|
|
2262
|
-
static
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
const ret = wasm.
|
|
2304
|
+
static new_blake2s(key, output_len) {
|
|
2305
|
+
var ptr0 = isLikeNone(key) ? 0 : passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2306
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2307
|
+
const ret = wasm.hash_new_blake2s(ptr0, len0, output_len);
|
|
2266
2308
|
if (ret[2]) {
|
|
2267
2309
|
throw takeFromExternrefTable0(ret[1]);
|
|
2268
2310
|
}
|
|
2269
2311
|
return Hash.__wrap(ret[0]);
|
|
2270
2312
|
}
|
|
2271
2313
|
/**
|
|
2272
|
-
* @param {Uint8Array} key
|
|
2314
|
+
* @param {Uint8Array | null | undefined} key
|
|
2315
|
+
* @param {number} output_len
|
|
2273
2316
|
* @returns {Hash}
|
|
2274
2317
|
*/
|
|
2275
|
-
static
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
const ret = wasm.
|
|
2318
|
+
static new_blake2b(key, output_len) {
|
|
2319
|
+
var ptr0 = isLikeNone(key) ? 0 : passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2320
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2321
|
+
const ret = wasm.hash_new_blake2b(ptr0, len0, output_len);
|
|
2279
2322
|
if (ret[2]) {
|
|
2280
2323
|
throw takeFromExternrefTable0(ret[1]);
|
|
2281
2324
|
}
|
|
2282
2325
|
return Hash.__wrap(ret[0]);
|
|
2283
2326
|
}
|
|
2327
|
+
/**
|
|
2328
|
+
* @returns {number}
|
|
2329
|
+
*/
|
|
2330
|
+
block_size() {
|
|
2331
|
+
const ret = wasm.hash_block_size(this.__wbg_ptr);
|
|
2332
|
+
return ret >>> 0;
|
|
2333
|
+
}
|
|
2284
2334
|
/**
|
|
2285
2335
|
* @returns {Uint8Array}
|
|
2286
2336
|
*/
|
|
@@ -2332,56 +2382,6 @@ export class Hash {
|
|
|
2332
2382
|
}
|
|
2333
2383
|
return ret[0] >>> 0;
|
|
2334
2384
|
}
|
|
2335
|
-
/**
|
|
2336
|
-
* @returns {Hash}
|
|
2337
|
-
*/
|
|
2338
|
-
static new_md2() {
|
|
2339
|
-
const ret = wasm.hash_new_md2();
|
|
2340
|
-
if (ret[2]) {
|
|
2341
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2342
|
-
}
|
|
2343
|
-
return Hash.__wrap(ret[0]);
|
|
2344
|
-
}
|
|
2345
|
-
/**
|
|
2346
|
-
* @returns {Hash}
|
|
2347
|
-
*/
|
|
2348
|
-
static new_md4() {
|
|
2349
|
-
const ret = wasm.hash_new_md4();
|
|
2350
|
-
if (ret[2]) {
|
|
2351
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2352
|
-
}
|
|
2353
|
-
return Hash.__wrap(ret[0]);
|
|
2354
|
-
}
|
|
2355
|
-
/**
|
|
2356
|
-
* @returns {Hash}
|
|
2357
|
-
*/
|
|
2358
|
-
static new_md5() {
|
|
2359
|
-
const ret = wasm.hash_new_md5();
|
|
2360
|
-
if (ret[2]) {
|
|
2361
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2362
|
-
}
|
|
2363
|
-
return Hash.__wrap(ret[0]);
|
|
2364
|
-
}
|
|
2365
|
-
/**
|
|
2366
|
-
* @returns {Hash}
|
|
2367
|
-
*/
|
|
2368
|
-
static new_sm3() {
|
|
2369
|
-
const ret = wasm.hash_new_sm3();
|
|
2370
|
-
if (ret[2]) {
|
|
2371
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2372
|
-
}
|
|
2373
|
-
return Hash.__wrap(ret[0]);
|
|
2374
|
-
}
|
|
2375
|
-
/**
|
|
2376
|
-
* @returns {Hash}
|
|
2377
|
-
*/
|
|
2378
|
-
static new_sha1() {
|
|
2379
|
-
const ret = wasm.hash_new_sha1();
|
|
2380
|
-
if (ret[2]) {
|
|
2381
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2382
|
-
}
|
|
2383
|
-
return Hash.__wrap(ret[0]);
|
|
2384
|
-
}
|
|
2385
2385
|
}
|
|
2386
2386
|
if (Symbol.dispose) Hash.prototype[Symbol.dispose] = Hash.prototype.free;
|
|
2387
2387
|
|
|
@@ -2413,14 +2413,15 @@ export class StreamCipher {
|
|
|
2413
2413
|
/**
|
|
2414
2414
|
* @param {Uint8Array} key
|
|
2415
2415
|
* @param {Uint8Array} iv
|
|
2416
|
+
* @param {number | null} [rounds]
|
|
2416
2417
|
* @returns {StreamCipher}
|
|
2417
2418
|
*/
|
|
2418
|
-
static
|
|
2419
|
+
static new_multi2_cfb(key, iv, rounds) {
|
|
2419
2420
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2420
2421
|
const len0 = WASM_VECTOR_LEN;
|
|
2421
2422
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2422
2423
|
const len1 = WASM_VECTOR_LEN;
|
|
2423
|
-
const ret = wasm.
|
|
2424
|
+
const ret = wasm.streamcipher_new_multi2_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2424
2425
|
if (ret[2]) {
|
|
2425
2426
|
throw takeFromExternrefTable0(ret[1]);
|
|
2426
2427
|
}
|
|
@@ -2429,14 +2430,15 @@ export class StreamCipher {
|
|
|
2429
2430
|
/**
|
|
2430
2431
|
* @param {Uint8Array} key
|
|
2431
2432
|
* @param {Uint8Array} iv
|
|
2433
|
+
* @param {number | null} [rounds]
|
|
2432
2434
|
* @returns {StreamCipher}
|
|
2433
2435
|
*/
|
|
2434
|
-
static
|
|
2436
|
+
static new_multi2_ctr(key, iv, rounds) {
|
|
2435
2437
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2436
2438
|
const len0 = WASM_VECTOR_LEN;
|
|
2437
2439
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2438
2440
|
const len1 = WASM_VECTOR_LEN;
|
|
2439
|
-
const ret = wasm.
|
|
2441
|
+
const ret = wasm.streamcipher_new_multi2_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2440
2442
|
if (ret[2]) {
|
|
2441
2443
|
throw takeFromExternrefTable0(ret[1]);
|
|
2442
2444
|
}
|
|
@@ -2445,14 +2447,15 @@ export class StreamCipher {
|
|
|
2445
2447
|
/**
|
|
2446
2448
|
* @param {Uint8Array} key
|
|
2447
2449
|
* @param {Uint8Array} iv
|
|
2450
|
+
* @param {number | null} [rounds]
|
|
2448
2451
|
* @returns {StreamCipher}
|
|
2449
2452
|
*/
|
|
2450
|
-
static
|
|
2453
|
+
static new_multi2_ofb(key, iv, rounds) {
|
|
2451
2454
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2452
2455
|
const len0 = WASM_VECTOR_LEN;
|
|
2453
2456
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2454
2457
|
const len1 = WASM_VECTOR_LEN;
|
|
2455
|
-
const ret = wasm.
|
|
2458
|
+
const ret = wasm.streamcipher_new_multi2_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2456
2459
|
if (ret[2]) {
|
|
2457
2460
|
throw takeFromExternrefTable0(ret[1]);
|
|
2458
2461
|
}
|
|
@@ -2460,15 +2463,12 @@ export class StreamCipher {
|
|
|
2460
2463
|
}
|
|
2461
2464
|
/**
|
|
2462
2465
|
* @param {Uint8Array} key
|
|
2463
|
-
* @param {Uint8Array} iv
|
|
2464
2466
|
* @returns {StreamCipher}
|
|
2465
2467
|
*/
|
|
2466
|
-
static
|
|
2468
|
+
static new_rc4(key) {
|
|
2467
2469
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2468
2470
|
const len0 = WASM_VECTOR_LEN;
|
|
2469
|
-
const
|
|
2470
|
-
const len1 = WASM_VECTOR_LEN;
|
|
2471
|
-
const ret = wasm.streamcipher_new_aes_ofb(ptr0, len0, ptr1, len1);
|
|
2471
|
+
const ret = wasm.streamcipher_new_rc4(ptr0, len0);
|
|
2472
2472
|
if (ret[2]) {
|
|
2473
2473
|
throw takeFromExternrefTable0(ret[1]);
|
|
2474
2474
|
}
|
|
@@ -2479,12 +2479,12 @@ export class StreamCipher {
|
|
|
2479
2479
|
* @param {Uint8Array} iv
|
|
2480
2480
|
* @returns {StreamCipher}
|
|
2481
2481
|
*/
|
|
2482
|
-
static
|
|
2482
|
+
static new_salsa20(key, iv) {
|
|
2483
2483
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2484
2484
|
const len0 = WASM_VECTOR_LEN;
|
|
2485
2485
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2486
2486
|
const len1 = WASM_VECTOR_LEN;
|
|
2487
|
-
const ret = wasm.
|
|
2487
|
+
const ret = wasm.streamcipher_new_salsa20(ptr0, len0, ptr1, len1);
|
|
2488
2488
|
if (ret[2]) {
|
|
2489
2489
|
throw takeFromExternrefTable0(ret[1]);
|
|
2490
2490
|
}
|
|
@@ -2495,12 +2495,12 @@ export class StreamCipher {
|
|
|
2495
2495
|
* @param {Uint8Array} iv
|
|
2496
2496
|
* @returns {StreamCipher}
|
|
2497
2497
|
*/
|
|
2498
|
-
static
|
|
2498
|
+
static new_chacha20(key, iv) {
|
|
2499
2499
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2500
2500
|
const len0 = WASM_VECTOR_LEN;
|
|
2501
2501
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2502
2502
|
const len1 = WASM_VECTOR_LEN;
|
|
2503
|
-
const ret = wasm.
|
|
2503
|
+
const ret = wasm.streamcipher_new_chacha20(ptr0, len0, ptr1, len1);
|
|
2504
2504
|
if (ret[2]) {
|
|
2505
2505
|
throw takeFromExternrefTable0(ret[1]);
|
|
2506
2506
|
}
|
|
@@ -2511,12 +2511,12 @@ export class StreamCipher {
|
|
|
2511
2511
|
* @param {Uint8Array} iv
|
|
2512
2512
|
* @returns {StreamCipher}
|
|
2513
2513
|
*/
|
|
2514
|
-
static
|
|
2514
|
+
static new_rabbit(key, iv) {
|
|
2515
2515
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2516
2516
|
const len0 = WASM_VECTOR_LEN;
|
|
2517
2517
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2518
2518
|
const len1 = WASM_VECTOR_LEN;
|
|
2519
|
-
const ret = wasm.
|
|
2519
|
+
const ret = wasm.streamcipher_new_rabbit(ptr0, len0, ptr1, len1);
|
|
2520
2520
|
if (ret[2]) {
|
|
2521
2521
|
throw takeFromExternrefTable0(ret[1]);
|
|
2522
2522
|
}
|
|
@@ -2525,15 +2525,14 @@ export class StreamCipher {
|
|
|
2525
2525
|
/**
|
|
2526
2526
|
* @param {Uint8Array} key
|
|
2527
2527
|
* @param {Uint8Array} iv
|
|
2528
|
-
* @param {number | null} [rounds]
|
|
2529
2528
|
* @returns {StreamCipher}
|
|
2530
2529
|
*/
|
|
2531
|
-
static
|
|
2530
|
+
static new_sosemanuk(key, iv) {
|
|
2532
2531
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2533
2532
|
const len0 = WASM_VECTOR_LEN;
|
|
2534
2533
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2535
2534
|
const len1 = WASM_VECTOR_LEN;
|
|
2536
|
-
const ret = wasm.
|
|
2535
|
+
const ret = wasm.streamcipher_new_sosemanuk(ptr0, len0, ptr1, len1);
|
|
2537
2536
|
if (ret[2]) {
|
|
2538
2537
|
throw takeFromExternrefTable0(ret[1]);
|
|
2539
2538
|
}
|
|
@@ -2542,32 +2541,52 @@ export class StreamCipher {
|
|
|
2542
2541
|
/**
|
|
2543
2542
|
* @param {Uint8Array} key
|
|
2544
2543
|
* @param {Uint8Array} iv
|
|
2545
|
-
* @param {number | null} [rounds]
|
|
2546
2544
|
* @returns {StreamCipher}
|
|
2547
2545
|
*/
|
|
2548
|
-
static
|
|
2546
|
+
static new_sober128(key, iv) {
|
|
2549
2547
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2550
2548
|
const len0 = WASM_VECTOR_LEN;
|
|
2551
2549
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2552
2550
|
const len1 = WASM_VECTOR_LEN;
|
|
2553
|
-
const ret = wasm.
|
|
2551
|
+
const ret = wasm.streamcipher_new_sober128(ptr0, len0, ptr1, len1);
|
|
2554
2552
|
if (ret[2]) {
|
|
2555
2553
|
throw takeFromExternrefTable0(ret[1]);
|
|
2556
2554
|
}
|
|
2557
2555
|
return StreamCipher.__wrap(ret[0]);
|
|
2558
2556
|
}
|
|
2557
|
+
/**
|
|
2558
|
+
* @param {Uint8Array} data
|
|
2559
|
+
*/
|
|
2560
|
+
decrypt(data) {
|
|
2561
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2562
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2563
|
+
const ret = wasm.streamcipher_decrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
2564
|
+
if (ret[1]) {
|
|
2565
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
/**
|
|
2569
|
+
* @param {Uint8Array} data
|
|
2570
|
+
*/
|
|
2571
|
+
encrypt(data) {
|
|
2572
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2573
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2574
|
+
const ret = wasm.streamcipher_encrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
2575
|
+
if (ret[1]) {
|
|
2576
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2559
2579
|
/**
|
|
2560
2580
|
* @param {Uint8Array} key
|
|
2561
2581
|
* @param {Uint8Array} iv
|
|
2562
|
-
* @param {number | null} [rounds]
|
|
2563
2582
|
* @returns {StreamCipher}
|
|
2564
2583
|
*/
|
|
2565
|
-
static
|
|
2584
|
+
static new_aes_cfb(key, iv) {
|
|
2566
2585
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2567
2586
|
const len0 = WASM_VECTOR_LEN;
|
|
2568
2587
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2569
2588
|
const len1 = WASM_VECTOR_LEN;
|
|
2570
|
-
const ret = wasm.
|
|
2589
|
+
const ret = wasm.streamcipher_new_aes_cfb(ptr0, len0, ptr1, len1);
|
|
2571
2590
|
if (ret[2]) {
|
|
2572
2591
|
throw takeFromExternrefTable0(ret[1]);
|
|
2573
2592
|
}
|
|
@@ -2576,15 +2595,14 @@ export class StreamCipher {
|
|
|
2576
2595
|
/**
|
|
2577
2596
|
* @param {Uint8Array} key
|
|
2578
2597
|
* @param {Uint8Array} iv
|
|
2579
|
-
* @param {number | null} [rounds]
|
|
2580
2598
|
* @returns {StreamCipher}
|
|
2581
2599
|
*/
|
|
2582
|
-
static
|
|
2600
|
+
static new_aes_ctr(key, iv) {
|
|
2583
2601
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2584
2602
|
const len0 = WASM_VECTOR_LEN;
|
|
2585
2603
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2586
2604
|
const len1 = WASM_VECTOR_LEN;
|
|
2587
|
-
const ret = wasm.
|
|
2605
|
+
const ret = wasm.streamcipher_new_aes_ctr(ptr0, len0, ptr1, len1);
|
|
2588
2606
|
if (ret[2]) {
|
|
2589
2607
|
throw takeFromExternrefTable0(ret[1]);
|
|
2590
2608
|
}
|
|
@@ -2593,15 +2611,14 @@ export class StreamCipher {
|
|
|
2593
2611
|
/**
|
|
2594
2612
|
* @param {Uint8Array} key
|
|
2595
2613
|
* @param {Uint8Array} iv
|
|
2596
|
-
* @param {number | null} [rounds]
|
|
2597
2614
|
* @returns {StreamCipher}
|
|
2598
2615
|
*/
|
|
2599
|
-
static
|
|
2616
|
+
static new_aes_ofb(key, iv) {
|
|
2600
2617
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2601
2618
|
const len0 = WASM_VECTOR_LEN;
|
|
2602
2619
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2603
2620
|
const len1 = WASM_VECTOR_LEN;
|
|
2604
|
-
const ret = wasm.
|
|
2621
|
+
const ret = wasm.streamcipher_new_aes_ofb(ptr0, len0, ptr1, len1);
|
|
2605
2622
|
if (ret[2]) {
|
|
2606
2623
|
throw takeFromExternrefTable0(ret[1]);
|
|
2607
2624
|
}
|
|
@@ -2610,15 +2627,14 @@ export class StreamCipher {
|
|
|
2610
2627
|
/**
|
|
2611
2628
|
* @param {Uint8Array} key
|
|
2612
2629
|
* @param {Uint8Array} iv
|
|
2613
|
-
* @param {number | null} [rounds]
|
|
2614
2630
|
* @returns {StreamCipher}
|
|
2615
2631
|
*/
|
|
2616
|
-
static
|
|
2632
|
+
static new_aria_cfb(key, iv) {
|
|
2617
2633
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2618
2634
|
const len0 = WASM_VECTOR_LEN;
|
|
2619
2635
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2620
2636
|
const len1 = WASM_VECTOR_LEN;
|
|
2621
|
-
const ret = wasm.
|
|
2637
|
+
const ret = wasm.streamcipher_new_aria_cfb(ptr0, len0, ptr1, len1);
|
|
2622
2638
|
if (ret[2]) {
|
|
2623
2639
|
throw takeFromExternrefTable0(ret[1]);
|
|
2624
2640
|
}
|
|
@@ -2629,12 +2645,12 @@ export class StreamCipher {
|
|
|
2629
2645
|
* @param {Uint8Array} iv
|
|
2630
2646
|
* @returns {StreamCipher}
|
|
2631
2647
|
*/
|
|
2632
|
-
static
|
|
2648
|
+
static new_aria_ctr(key, iv) {
|
|
2633
2649
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2634
2650
|
const len0 = WASM_VECTOR_LEN;
|
|
2635
2651
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2636
2652
|
const len1 = WASM_VECTOR_LEN;
|
|
2637
|
-
const ret = wasm.
|
|
2653
|
+
const ret = wasm.streamcipher_new_aria_ctr(ptr0, len0, ptr1, len1);
|
|
2638
2654
|
if (ret[2]) {
|
|
2639
2655
|
throw takeFromExternrefTable0(ret[1]);
|
|
2640
2656
|
}
|
|
@@ -2645,12 +2661,12 @@ export class StreamCipher {
|
|
|
2645
2661
|
* @param {Uint8Array} iv
|
|
2646
2662
|
* @returns {StreamCipher}
|
|
2647
2663
|
*/
|
|
2648
|
-
static
|
|
2664
|
+
static new_aria_ofb(key, iv) {
|
|
2649
2665
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2650
2666
|
const len0 = WASM_VECTOR_LEN;
|
|
2651
2667
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2652
2668
|
const len1 = WASM_VECTOR_LEN;
|
|
2653
|
-
const ret = wasm.
|
|
2669
|
+
const ret = wasm.streamcipher_new_aria_ofb(ptr0, len0, ptr1, len1);
|
|
2654
2670
|
if (ret[2]) {
|
|
2655
2671
|
throw takeFromExternrefTable0(ret[1]);
|
|
2656
2672
|
}
|
|
@@ -2661,12 +2677,12 @@ export class StreamCipher {
|
|
|
2661
2677
|
* @param {Uint8Array} iv
|
|
2662
2678
|
* @returns {StreamCipher}
|
|
2663
2679
|
*/
|
|
2664
|
-
static
|
|
2680
|
+
static new_blowfish_cfb(key, iv) {
|
|
2665
2681
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2666
2682
|
const len0 = WASM_VECTOR_LEN;
|
|
2667
2683
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2668
2684
|
const len1 = WASM_VECTOR_LEN;
|
|
2669
|
-
const ret = wasm.
|
|
2685
|
+
const ret = wasm.streamcipher_new_blowfish_cfb(ptr0, len0, ptr1, len1);
|
|
2670
2686
|
if (ret[2]) {
|
|
2671
2687
|
throw takeFromExternrefTable0(ret[1]);
|
|
2672
2688
|
}
|
|
@@ -2677,12 +2693,12 @@ export class StreamCipher {
|
|
|
2677
2693
|
* @param {Uint8Array} iv
|
|
2678
2694
|
* @returns {StreamCipher}
|
|
2679
2695
|
*/
|
|
2680
|
-
static
|
|
2696
|
+
static new_blowfish_ctr(key, iv) {
|
|
2681
2697
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2682
2698
|
const len0 = WASM_VECTOR_LEN;
|
|
2683
2699
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2684
2700
|
const len1 = WASM_VECTOR_LEN;
|
|
2685
|
-
const ret = wasm.
|
|
2701
|
+
const ret = wasm.streamcipher_new_blowfish_ctr(ptr0, len0, ptr1, len1);
|
|
2686
2702
|
if (ret[2]) {
|
|
2687
2703
|
throw takeFromExternrefTable0(ret[1]);
|
|
2688
2704
|
}
|
|
@@ -2693,12 +2709,12 @@ export class StreamCipher {
|
|
|
2693
2709
|
* @param {Uint8Array} iv
|
|
2694
2710
|
* @returns {StreamCipher}
|
|
2695
2711
|
*/
|
|
2696
|
-
static
|
|
2712
|
+
static new_blowfish_ofb(key, iv) {
|
|
2697
2713
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2698
2714
|
const len0 = WASM_VECTOR_LEN;
|
|
2699
2715
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2700
2716
|
const len1 = WASM_VECTOR_LEN;
|
|
2701
|
-
const ret = wasm.
|
|
2717
|
+
const ret = wasm.streamcipher_new_blowfish_ofb(ptr0, len0, ptr1, len1);
|
|
2702
2718
|
if (ret[2]) {
|
|
2703
2719
|
throw takeFromExternrefTable0(ret[1]);
|
|
2704
2720
|
}
|
|
@@ -2709,12 +2725,12 @@ export class StreamCipher {
|
|
|
2709
2725
|
* @param {Uint8Array} iv
|
|
2710
2726
|
* @returns {StreamCipher}
|
|
2711
2727
|
*/
|
|
2712
|
-
static
|
|
2728
|
+
static new_cast5_cfb(key, iv) {
|
|
2713
2729
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2714
2730
|
const len0 = WASM_VECTOR_LEN;
|
|
2715
2731
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2716
2732
|
const len1 = WASM_VECTOR_LEN;
|
|
2717
|
-
const ret = wasm.
|
|
2733
|
+
const ret = wasm.streamcipher_new_cast5_cfb(ptr0, len0, ptr1, len1);
|
|
2718
2734
|
if (ret[2]) {
|
|
2719
2735
|
throw takeFromExternrefTable0(ret[1]);
|
|
2720
2736
|
}
|
|
@@ -2725,12 +2741,12 @@ export class StreamCipher {
|
|
|
2725
2741
|
* @param {Uint8Array} iv
|
|
2726
2742
|
* @returns {StreamCipher}
|
|
2727
2743
|
*/
|
|
2728
|
-
static
|
|
2744
|
+
static new_cast5_ctr(key, iv) {
|
|
2729
2745
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2730
2746
|
const len0 = WASM_VECTOR_LEN;
|
|
2731
2747
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2732
2748
|
const len1 = WASM_VECTOR_LEN;
|
|
2733
|
-
const ret = wasm.
|
|
2749
|
+
const ret = wasm.streamcipher_new_cast5_ctr(ptr0, len0, ptr1, len1);
|
|
2734
2750
|
if (ret[2]) {
|
|
2735
2751
|
throw takeFromExternrefTable0(ret[1]);
|
|
2736
2752
|
}
|
|
@@ -2741,12 +2757,12 @@ export class StreamCipher {
|
|
|
2741
2757
|
* @param {Uint8Array} iv
|
|
2742
2758
|
* @returns {StreamCipher}
|
|
2743
2759
|
*/
|
|
2744
|
-
static
|
|
2760
|
+
static new_cast5_ofb(key, iv) {
|
|
2745
2761
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2746
2762
|
const len0 = WASM_VECTOR_LEN;
|
|
2747
2763
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2748
2764
|
const len1 = WASM_VECTOR_LEN;
|
|
2749
|
-
const ret = wasm.
|
|
2765
|
+
const ret = wasm.streamcipher_new_cast5_ofb(ptr0, len0, ptr1, len1);
|
|
2750
2766
|
if (ret[2]) {
|
|
2751
2767
|
throw takeFromExternrefTable0(ret[1]);
|
|
2752
2768
|
}
|
|
@@ -2757,12 +2773,12 @@ export class StreamCipher {
|
|
|
2757
2773
|
* @param {Uint8Array} iv
|
|
2758
2774
|
* @returns {StreamCipher}
|
|
2759
2775
|
*/
|
|
2760
|
-
static
|
|
2776
|
+
static new_des_cfb(key, iv) {
|
|
2761
2777
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2762
2778
|
const len0 = WASM_VECTOR_LEN;
|
|
2763
2779
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2764
2780
|
const len1 = WASM_VECTOR_LEN;
|
|
2765
|
-
const ret = wasm.
|
|
2781
|
+
const ret = wasm.streamcipher_new_des_cfb(ptr0, len0, ptr1, len1);
|
|
2766
2782
|
if (ret[2]) {
|
|
2767
2783
|
throw takeFromExternrefTable0(ret[1]);
|
|
2768
2784
|
}
|
|
@@ -2773,12 +2789,12 @@ export class StreamCipher {
|
|
|
2773
2789
|
* @param {Uint8Array} iv
|
|
2774
2790
|
* @returns {StreamCipher}
|
|
2775
2791
|
*/
|
|
2776
|
-
static
|
|
2792
|
+
static new_des_ctr(key, iv) {
|
|
2777
2793
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2778
2794
|
const len0 = WASM_VECTOR_LEN;
|
|
2779
2795
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2780
2796
|
const len1 = WASM_VECTOR_LEN;
|
|
2781
|
-
const ret = wasm.
|
|
2797
|
+
const ret = wasm.streamcipher_new_des_ctr(ptr0, len0, ptr1, len1);
|
|
2782
2798
|
if (ret[2]) {
|
|
2783
2799
|
throw takeFromExternrefTable0(ret[1]);
|
|
2784
2800
|
}
|
|
@@ -2789,12 +2805,12 @@ export class StreamCipher {
|
|
|
2789
2805
|
* @param {Uint8Array} iv
|
|
2790
2806
|
* @returns {StreamCipher}
|
|
2791
2807
|
*/
|
|
2792
|
-
static
|
|
2808
|
+
static new_des_ofb(key, iv) {
|
|
2793
2809
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2794
2810
|
const len0 = WASM_VECTOR_LEN;
|
|
2795
2811
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2796
2812
|
const len1 = WASM_VECTOR_LEN;
|
|
2797
|
-
const ret = wasm.
|
|
2813
|
+
const ret = wasm.streamcipher_new_des_ofb(ptr0, len0, ptr1, len1);
|
|
2798
2814
|
if (ret[2]) {
|
|
2799
2815
|
throw takeFromExternrefTable0(ret[1]);
|
|
2800
2816
|
}
|
|
@@ -2805,12 +2821,12 @@ export class StreamCipher {
|
|
|
2805
2821
|
* @param {Uint8Array} iv
|
|
2806
2822
|
* @returns {StreamCipher}
|
|
2807
2823
|
*/
|
|
2808
|
-
static
|
|
2824
|
+
static new_tripledes_cfb(key, iv) {
|
|
2809
2825
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2810
2826
|
const len0 = WASM_VECTOR_LEN;
|
|
2811
2827
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2812
2828
|
const len1 = WASM_VECTOR_LEN;
|
|
2813
|
-
const ret = wasm.
|
|
2829
|
+
const ret = wasm.streamcipher_new_tripledes_cfb(ptr0, len0, ptr1, len1);
|
|
2814
2830
|
if (ret[2]) {
|
|
2815
2831
|
throw takeFromExternrefTable0(ret[1]);
|
|
2816
2832
|
}
|
|
@@ -2821,12 +2837,12 @@ export class StreamCipher {
|
|
|
2821
2837
|
* @param {Uint8Array} iv
|
|
2822
2838
|
* @returns {StreamCipher}
|
|
2823
2839
|
*/
|
|
2824
|
-
static
|
|
2840
|
+
static new_tripledes_ctr(key, iv) {
|
|
2825
2841
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2826
2842
|
const len0 = WASM_VECTOR_LEN;
|
|
2827
2843
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2828
2844
|
const len1 = WASM_VECTOR_LEN;
|
|
2829
|
-
const ret = wasm.
|
|
2845
|
+
const ret = wasm.streamcipher_new_tripledes_ctr(ptr0, len0, ptr1, len1);
|
|
2830
2846
|
if (ret[2]) {
|
|
2831
2847
|
throw takeFromExternrefTable0(ret[1]);
|
|
2832
2848
|
}
|
|
@@ -2837,12 +2853,12 @@ export class StreamCipher {
|
|
|
2837
2853
|
* @param {Uint8Array} iv
|
|
2838
2854
|
* @returns {StreamCipher}
|
|
2839
2855
|
*/
|
|
2840
|
-
static
|
|
2856
|
+
static new_tripledes_ofb(key, iv) {
|
|
2841
2857
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2842
2858
|
const len0 = WASM_VECTOR_LEN;
|
|
2843
2859
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2844
2860
|
const len1 = WASM_VECTOR_LEN;
|
|
2845
|
-
const ret = wasm.
|
|
2861
|
+
const ret = wasm.streamcipher_new_tripledes_ofb(ptr0, len0, ptr1, len1);
|
|
2846
2862
|
if (ret[2]) {
|
|
2847
2863
|
throw takeFromExternrefTable0(ret[1]);
|
|
2848
2864
|
}
|
|
@@ -2853,12 +2869,12 @@ export class StreamCipher {
|
|
|
2853
2869
|
* @param {Uint8Array} iv
|
|
2854
2870
|
* @returns {StreamCipher}
|
|
2855
2871
|
*/
|
|
2856
|
-
static
|
|
2872
|
+
static new_tea_cfb(key, iv) {
|
|
2857
2873
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2858
2874
|
const len0 = WASM_VECTOR_LEN;
|
|
2859
2875
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2860
2876
|
const len1 = WASM_VECTOR_LEN;
|
|
2861
|
-
const ret = wasm.
|
|
2877
|
+
const ret = wasm.streamcipher_new_tea_cfb(ptr0, len0, ptr1, len1);
|
|
2862
2878
|
if (ret[2]) {
|
|
2863
2879
|
throw takeFromExternrefTable0(ret[1]);
|
|
2864
2880
|
}
|
|
@@ -2869,12 +2885,12 @@ export class StreamCipher {
|
|
|
2869
2885
|
* @param {Uint8Array} iv
|
|
2870
2886
|
* @returns {StreamCipher}
|
|
2871
2887
|
*/
|
|
2872
|
-
static
|
|
2888
|
+
static new_tea_ctr(key, iv) {
|
|
2873
2889
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2874
2890
|
const len0 = WASM_VECTOR_LEN;
|
|
2875
2891
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2876
2892
|
const len1 = WASM_VECTOR_LEN;
|
|
2877
|
-
const ret = wasm.
|
|
2893
|
+
const ret = wasm.streamcipher_new_tea_ctr(ptr0, len0, ptr1, len1);
|
|
2878
2894
|
if (ret[2]) {
|
|
2879
2895
|
throw takeFromExternrefTable0(ret[1]);
|
|
2880
2896
|
}
|
|
@@ -2885,12 +2901,12 @@ export class StreamCipher {
|
|
|
2885
2901
|
* @param {Uint8Array} iv
|
|
2886
2902
|
* @returns {StreamCipher}
|
|
2887
2903
|
*/
|
|
2888
|
-
static
|
|
2904
|
+
static new_tea_ofb(key, iv) {
|
|
2889
2905
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2890
2906
|
const len0 = WASM_VECTOR_LEN;
|
|
2891
2907
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2892
2908
|
const len1 = WASM_VECTOR_LEN;
|
|
2893
|
-
const ret = wasm.
|
|
2909
|
+
const ret = wasm.streamcipher_new_tea_ofb(ptr0, len0, ptr1, len1);
|
|
2894
2910
|
if (ret[2]) {
|
|
2895
2911
|
throw takeFromExternrefTable0(ret[1]);
|
|
2896
2912
|
}
|
|
@@ -2901,12 +2917,12 @@ export class StreamCipher {
|
|
|
2901
2917
|
* @param {Uint8Array} iv
|
|
2902
2918
|
* @returns {StreamCipher}
|
|
2903
2919
|
*/
|
|
2904
|
-
static
|
|
2920
|
+
static new_twofish_cfb(key, iv) {
|
|
2905
2921
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2906
2922
|
const len0 = WASM_VECTOR_LEN;
|
|
2907
2923
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2908
2924
|
const len1 = WASM_VECTOR_LEN;
|
|
2909
|
-
const ret = wasm.
|
|
2925
|
+
const ret = wasm.streamcipher_new_twofish_cfb(ptr0, len0, ptr1, len1);
|
|
2910
2926
|
if (ret[2]) {
|
|
2911
2927
|
throw takeFromExternrefTable0(ret[1]);
|
|
2912
2928
|
}
|
|
@@ -2917,12 +2933,12 @@ export class StreamCipher {
|
|
|
2917
2933
|
* @param {Uint8Array} iv
|
|
2918
2934
|
* @returns {StreamCipher}
|
|
2919
2935
|
*/
|
|
2920
|
-
static
|
|
2936
|
+
static new_twofish_ctr(key, iv) {
|
|
2921
2937
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2922
2938
|
const len0 = WASM_VECTOR_LEN;
|
|
2923
2939
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2924
2940
|
const len1 = WASM_VECTOR_LEN;
|
|
2925
|
-
const ret = wasm.
|
|
2941
|
+
const ret = wasm.streamcipher_new_twofish_ctr(ptr0, len0, ptr1, len1);
|
|
2926
2942
|
if (ret[2]) {
|
|
2927
2943
|
throw takeFromExternrefTable0(ret[1]);
|
|
2928
2944
|
}
|
|
@@ -2933,12 +2949,12 @@ export class StreamCipher {
|
|
|
2933
2949
|
* @param {Uint8Array} iv
|
|
2934
2950
|
* @returns {StreamCipher}
|
|
2935
2951
|
*/
|
|
2936
|
-
static
|
|
2952
|
+
static new_twofish_ofb(key, iv) {
|
|
2937
2953
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2938
2954
|
const len0 = WASM_VECTOR_LEN;
|
|
2939
2955
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2940
2956
|
const len1 = WASM_VECTOR_LEN;
|
|
2941
|
-
const ret = wasm.
|
|
2957
|
+
const ret = wasm.streamcipher_new_twofish_ofb(ptr0, len0, ptr1, len1);
|
|
2942
2958
|
if (ret[2]) {
|
|
2943
2959
|
throw takeFromExternrefTable0(ret[1]);
|
|
2944
2960
|
}
|
|
@@ -2949,12 +2965,12 @@ export class StreamCipher {
|
|
|
2949
2965
|
* @param {Uint8Array} iv
|
|
2950
2966
|
* @returns {StreamCipher}
|
|
2951
2967
|
*/
|
|
2952
|
-
static
|
|
2968
|
+
static new_xtea_cfb(key, iv) {
|
|
2953
2969
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2954
2970
|
const len0 = WASM_VECTOR_LEN;
|
|
2955
2971
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2956
2972
|
const len1 = WASM_VECTOR_LEN;
|
|
2957
|
-
const ret = wasm.
|
|
2973
|
+
const ret = wasm.streamcipher_new_xtea_cfb(ptr0, len0, ptr1, len1);
|
|
2958
2974
|
if (ret[2]) {
|
|
2959
2975
|
throw takeFromExternrefTable0(ret[1]);
|
|
2960
2976
|
}
|
|
@@ -2965,12 +2981,12 @@ export class StreamCipher {
|
|
|
2965
2981
|
* @param {Uint8Array} iv
|
|
2966
2982
|
* @returns {StreamCipher}
|
|
2967
2983
|
*/
|
|
2968
|
-
static
|
|
2984
|
+
static new_xtea_ctr(key, iv) {
|
|
2969
2985
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2970
2986
|
const len0 = WASM_VECTOR_LEN;
|
|
2971
2987
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2972
2988
|
const len1 = WASM_VECTOR_LEN;
|
|
2973
|
-
const ret = wasm.
|
|
2989
|
+
const ret = wasm.streamcipher_new_xtea_ctr(ptr0, len0, ptr1, len1);
|
|
2974
2990
|
if (ret[2]) {
|
|
2975
2991
|
throw takeFromExternrefTable0(ret[1]);
|
|
2976
2992
|
}
|
|
@@ -2981,12 +2997,12 @@ export class StreamCipher {
|
|
|
2981
2997
|
* @param {Uint8Array} iv
|
|
2982
2998
|
* @returns {StreamCipher}
|
|
2983
2999
|
*/
|
|
2984
|
-
static
|
|
3000
|
+
static new_xtea_ofb(key, iv) {
|
|
2985
3001
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2986
3002
|
const len0 = WASM_VECTOR_LEN;
|
|
2987
3003
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2988
3004
|
const len1 = WASM_VECTOR_LEN;
|
|
2989
|
-
const ret = wasm.
|
|
3005
|
+
const ret = wasm.streamcipher_new_xtea_ofb(ptr0, len0, ptr1, len1);
|
|
2990
3006
|
if (ret[2]) {
|
|
2991
3007
|
throw takeFromExternrefTable0(ret[1]);
|
|
2992
3008
|
}
|
|
@@ -2997,12 +3013,12 @@ export class StreamCipher {
|
|
|
2997
3013
|
* @param {Uint8Array} iv
|
|
2998
3014
|
* @returns {StreamCipher}
|
|
2999
3015
|
*/
|
|
3000
|
-
static
|
|
3016
|
+
static new_idea_cfb(key, iv) {
|
|
3001
3017
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3002
3018
|
const len0 = WASM_VECTOR_LEN;
|
|
3003
3019
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3004
3020
|
const len1 = WASM_VECTOR_LEN;
|
|
3005
|
-
const ret = wasm.
|
|
3021
|
+
const ret = wasm.streamcipher_new_idea_cfb(ptr0, len0, ptr1, len1);
|
|
3006
3022
|
if (ret[2]) {
|
|
3007
3023
|
throw takeFromExternrefTable0(ret[1]);
|
|
3008
3024
|
}
|
|
@@ -3013,12 +3029,12 @@ export class StreamCipher {
|
|
|
3013
3029
|
* @param {Uint8Array} iv
|
|
3014
3030
|
* @returns {StreamCipher}
|
|
3015
3031
|
*/
|
|
3016
|
-
static
|
|
3032
|
+
static new_idea_ctr(key, iv) {
|
|
3017
3033
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3018
3034
|
const len0 = WASM_VECTOR_LEN;
|
|
3019
3035
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3020
3036
|
const len1 = WASM_VECTOR_LEN;
|
|
3021
|
-
const ret = wasm.
|
|
3037
|
+
const ret = wasm.streamcipher_new_idea_ctr(ptr0, len0, ptr1, len1);
|
|
3022
3038
|
if (ret[2]) {
|
|
3023
3039
|
throw takeFromExternrefTable0(ret[1]);
|
|
3024
3040
|
}
|
|
@@ -3029,12 +3045,12 @@ export class StreamCipher {
|
|
|
3029
3045
|
* @param {Uint8Array} iv
|
|
3030
3046
|
* @returns {StreamCipher}
|
|
3031
3047
|
*/
|
|
3032
|
-
static
|
|
3048
|
+
static new_idea_ofb(key, iv) {
|
|
3033
3049
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3034
3050
|
const len0 = WASM_VECTOR_LEN;
|
|
3035
3051
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3036
3052
|
const len1 = WASM_VECTOR_LEN;
|
|
3037
|
-
const ret = wasm.
|
|
3053
|
+
const ret = wasm.streamcipher_new_idea_ofb(ptr0, len0, ptr1, len1);
|
|
3038
3054
|
if (ret[2]) {
|
|
3039
3055
|
throw takeFromExternrefTable0(ret[1]);
|
|
3040
3056
|
}
|
|
@@ -3045,12 +3061,12 @@ export class StreamCipher {
|
|
|
3045
3061
|
* @param {Uint8Array} iv
|
|
3046
3062
|
* @returns {StreamCipher}
|
|
3047
3063
|
*/
|
|
3048
|
-
static
|
|
3064
|
+
static new_rc6_cfb(key, iv) {
|
|
3049
3065
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3050
3066
|
const len0 = WASM_VECTOR_LEN;
|
|
3051
3067
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3052
3068
|
const len1 = WASM_VECTOR_LEN;
|
|
3053
|
-
const ret = wasm.
|
|
3069
|
+
const ret = wasm.streamcipher_new_rc6_cfb(ptr0, len0, ptr1, len1);
|
|
3054
3070
|
if (ret[2]) {
|
|
3055
3071
|
throw takeFromExternrefTable0(ret[1]);
|
|
3056
3072
|
}
|
|
@@ -3061,12 +3077,12 @@ export class StreamCipher {
|
|
|
3061
3077
|
* @param {Uint8Array} iv
|
|
3062
3078
|
* @returns {StreamCipher}
|
|
3063
3079
|
*/
|
|
3064
|
-
static
|
|
3080
|
+
static new_rc6_ctr(key, iv) {
|
|
3065
3081
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3066
3082
|
const len0 = WASM_VECTOR_LEN;
|
|
3067
3083
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3068
3084
|
const len1 = WASM_VECTOR_LEN;
|
|
3069
|
-
const ret = wasm.
|
|
3085
|
+
const ret = wasm.streamcipher_new_rc6_ctr(ptr0, len0, ptr1, len1);
|
|
3070
3086
|
if (ret[2]) {
|
|
3071
3087
|
throw takeFromExternrefTable0(ret[1]);
|
|
3072
3088
|
}
|
|
@@ -3077,12 +3093,12 @@ export class StreamCipher {
|
|
|
3077
3093
|
* @param {Uint8Array} iv
|
|
3078
3094
|
* @returns {StreamCipher}
|
|
3079
3095
|
*/
|
|
3080
|
-
static
|
|
3096
|
+
static new_rc6_ofb(key, iv) {
|
|
3081
3097
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3082
3098
|
const len0 = WASM_VECTOR_LEN;
|
|
3083
3099
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3084
3100
|
const len1 = WASM_VECTOR_LEN;
|
|
3085
|
-
const ret = wasm.
|
|
3101
|
+
const ret = wasm.streamcipher_new_rc6_ofb(ptr0, len0, ptr1, len1);
|
|
3086
3102
|
if (ret[2]) {
|
|
3087
3103
|
throw takeFromExternrefTable0(ret[1]);
|
|
3088
3104
|
}
|
|
@@ -3093,12 +3109,12 @@ export class StreamCipher {
|
|
|
3093
3109
|
* @param {Uint8Array} iv
|
|
3094
3110
|
* @returns {StreamCipher}
|
|
3095
3111
|
*/
|
|
3096
|
-
static
|
|
3112
|
+
static new_sm4_cfb(key, iv) {
|
|
3097
3113
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3098
3114
|
const len0 = WASM_VECTOR_LEN;
|
|
3099
3115
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3100
3116
|
const len1 = WASM_VECTOR_LEN;
|
|
3101
|
-
const ret = wasm.
|
|
3117
|
+
const ret = wasm.streamcipher_new_sm4_cfb(ptr0, len0, ptr1, len1);
|
|
3102
3118
|
if (ret[2]) {
|
|
3103
3119
|
throw takeFromExternrefTable0(ret[1]);
|
|
3104
3120
|
}
|
|
@@ -3109,12 +3125,12 @@ export class StreamCipher {
|
|
|
3109
3125
|
* @param {Uint8Array} iv
|
|
3110
3126
|
* @returns {StreamCipher}
|
|
3111
3127
|
*/
|
|
3112
|
-
static
|
|
3128
|
+
static new_sm4_ctr(key, iv) {
|
|
3113
3129
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3114
3130
|
const len0 = WASM_VECTOR_LEN;
|
|
3115
3131
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3116
3132
|
const len1 = WASM_VECTOR_LEN;
|
|
3117
|
-
const ret = wasm.
|
|
3133
|
+
const ret = wasm.streamcipher_new_sm4_ctr(ptr0, len0, ptr1, len1);
|
|
3118
3134
|
if (ret[2]) {
|
|
3119
3135
|
throw takeFromExternrefTable0(ret[1]);
|
|
3120
3136
|
}
|
|
@@ -3125,12 +3141,12 @@ export class StreamCipher {
|
|
|
3125
3141
|
* @param {Uint8Array} iv
|
|
3126
3142
|
* @returns {StreamCipher}
|
|
3127
3143
|
*/
|
|
3128
|
-
static
|
|
3144
|
+
static new_sm4_ofb(key, iv) {
|
|
3129
3145
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3130
3146
|
const len0 = WASM_VECTOR_LEN;
|
|
3131
3147
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3132
3148
|
const len1 = WASM_VECTOR_LEN;
|
|
3133
|
-
const ret = wasm.
|
|
3149
|
+
const ret = wasm.streamcipher_new_sm4_ofb(ptr0, len0, ptr1, len1);
|
|
3134
3150
|
if (ret[2]) {
|
|
3135
3151
|
throw takeFromExternrefTable0(ret[1]);
|
|
3136
3152
|
}
|
|
@@ -3141,12 +3157,12 @@ export class StreamCipher {
|
|
|
3141
3157
|
* @param {Uint8Array} iv
|
|
3142
3158
|
* @returns {StreamCipher}
|
|
3143
3159
|
*/
|
|
3144
|
-
static
|
|
3160
|
+
static new_skipjack_cfb(key, iv) {
|
|
3145
3161
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3146
3162
|
const len0 = WASM_VECTOR_LEN;
|
|
3147
3163
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3148
3164
|
const len1 = WASM_VECTOR_LEN;
|
|
3149
|
-
const ret = wasm.
|
|
3165
|
+
const ret = wasm.streamcipher_new_skipjack_cfb(ptr0, len0, ptr1, len1);
|
|
3150
3166
|
if (ret[2]) {
|
|
3151
3167
|
throw takeFromExternrefTable0(ret[1]);
|
|
3152
3168
|
}
|
|
@@ -3157,12 +3173,12 @@ export class StreamCipher {
|
|
|
3157
3173
|
* @param {Uint8Array} iv
|
|
3158
3174
|
* @returns {StreamCipher}
|
|
3159
3175
|
*/
|
|
3160
|
-
static
|
|
3176
|
+
static new_skipjack_ctr(key, iv) {
|
|
3161
3177
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3162
3178
|
const len0 = WASM_VECTOR_LEN;
|
|
3163
3179
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3164
3180
|
const len1 = WASM_VECTOR_LEN;
|
|
3165
|
-
const ret = wasm.
|
|
3181
|
+
const ret = wasm.streamcipher_new_skipjack_ctr(ptr0, len0, ptr1, len1);
|
|
3166
3182
|
if (ret[2]) {
|
|
3167
3183
|
throw takeFromExternrefTable0(ret[1]);
|
|
3168
3184
|
}
|
|
@@ -3173,12 +3189,12 @@ export class StreamCipher {
|
|
|
3173
3189
|
* @param {Uint8Array} iv
|
|
3174
3190
|
* @returns {StreamCipher}
|
|
3175
3191
|
*/
|
|
3176
|
-
static
|
|
3192
|
+
static new_skipjack_ofb(key, iv) {
|
|
3177
3193
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3178
3194
|
const len0 = WASM_VECTOR_LEN;
|
|
3179
3195
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3180
3196
|
const len1 = WASM_VECTOR_LEN;
|
|
3181
|
-
const ret = wasm.
|
|
3197
|
+
const ret = wasm.streamcipher_new_skipjack_ofb(ptr0, len0, ptr1, len1);
|
|
3182
3198
|
if (ret[2]) {
|
|
3183
3199
|
throw takeFromExternrefTable0(ret[1]);
|
|
3184
3200
|
}
|
|
@@ -3189,12 +3205,12 @@ export class StreamCipher {
|
|
|
3189
3205
|
* @param {Uint8Array} iv
|
|
3190
3206
|
* @returns {StreamCipher}
|
|
3191
3207
|
*/
|
|
3192
|
-
static
|
|
3208
|
+
static new_kasumi_cfb(key, iv) {
|
|
3193
3209
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3194
3210
|
const len0 = WASM_VECTOR_LEN;
|
|
3195
3211
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3196
3212
|
const len1 = WASM_VECTOR_LEN;
|
|
3197
|
-
const ret = wasm.
|
|
3213
|
+
const ret = wasm.streamcipher_new_kasumi_cfb(ptr0, len0, ptr1, len1);
|
|
3198
3214
|
if (ret[2]) {
|
|
3199
3215
|
throw takeFromExternrefTable0(ret[1]);
|
|
3200
3216
|
}
|
|
@@ -3205,12 +3221,12 @@ export class StreamCipher {
|
|
|
3205
3221
|
* @param {Uint8Array} iv
|
|
3206
3222
|
* @returns {StreamCipher}
|
|
3207
3223
|
*/
|
|
3208
|
-
static
|
|
3224
|
+
static new_kasumi_ctr(key, iv) {
|
|
3209
3225
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3210
3226
|
const len0 = WASM_VECTOR_LEN;
|
|
3211
3227
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3212
3228
|
const len1 = WASM_VECTOR_LEN;
|
|
3213
|
-
const ret = wasm.
|
|
3229
|
+
const ret = wasm.streamcipher_new_kasumi_ctr(ptr0, len0, ptr1, len1);
|
|
3214
3230
|
if (ret[2]) {
|
|
3215
3231
|
throw takeFromExternrefTable0(ret[1]);
|
|
3216
3232
|
}
|
|
@@ -3219,15 +3235,14 @@ export class StreamCipher {
|
|
|
3219
3235
|
/**
|
|
3220
3236
|
* @param {Uint8Array} key
|
|
3221
3237
|
* @param {Uint8Array} iv
|
|
3222
|
-
* @param {number | null} [rounds]
|
|
3223
3238
|
* @returns {StreamCipher}
|
|
3224
3239
|
*/
|
|
3225
|
-
static
|
|
3240
|
+
static new_kasumi_ofb(key, iv) {
|
|
3226
3241
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3227
3242
|
const len0 = WASM_VECTOR_LEN;
|
|
3228
3243
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3229
3244
|
const len1 = WASM_VECTOR_LEN;
|
|
3230
|
-
const ret = wasm.
|
|
3245
|
+
const ret = wasm.streamcipher_new_kasumi_ofb(ptr0, len0, ptr1, len1);
|
|
3231
3246
|
if (ret[2]) {
|
|
3232
3247
|
throw takeFromExternrefTable0(ret[1]);
|
|
3233
3248
|
}
|
|
@@ -3236,15 +3251,14 @@ export class StreamCipher {
|
|
|
3236
3251
|
/**
|
|
3237
3252
|
* @param {Uint8Array} key
|
|
3238
3253
|
* @param {Uint8Array} iv
|
|
3239
|
-
* @param {number | null} [rounds]
|
|
3240
3254
|
* @returns {StreamCipher}
|
|
3241
3255
|
*/
|
|
3242
|
-
static
|
|
3256
|
+
static new_kseed_cfb(key, iv) {
|
|
3243
3257
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3244
3258
|
const len0 = WASM_VECTOR_LEN;
|
|
3245
3259
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3246
3260
|
const len1 = WASM_VECTOR_LEN;
|
|
3247
|
-
const ret = wasm.
|
|
3261
|
+
const ret = wasm.streamcipher_new_kseed_cfb(ptr0, len0, ptr1, len1);
|
|
3248
3262
|
if (ret[2]) {
|
|
3249
3263
|
throw takeFromExternrefTable0(ret[1]);
|
|
3250
3264
|
}
|
|
@@ -3253,15 +3267,14 @@ export class StreamCipher {
|
|
|
3253
3267
|
/**
|
|
3254
3268
|
* @param {Uint8Array} key
|
|
3255
3269
|
* @param {Uint8Array} iv
|
|
3256
|
-
* @param {number | null} [rounds]
|
|
3257
3270
|
* @returns {StreamCipher}
|
|
3258
3271
|
*/
|
|
3259
|
-
static
|
|
3272
|
+
static new_kseed_ctr(key, iv) {
|
|
3260
3273
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3261
3274
|
const len0 = WASM_VECTOR_LEN;
|
|
3262
3275
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3263
3276
|
const len1 = WASM_VECTOR_LEN;
|
|
3264
|
-
const ret = wasm.
|
|
3277
|
+
const ret = wasm.streamcipher_new_kseed_ctr(ptr0, len0, ptr1, len1);
|
|
3265
3278
|
if (ret[2]) {
|
|
3266
3279
|
throw takeFromExternrefTable0(ret[1]);
|
|
3267
3280
|
}
|
|
@@ -3272,12 +3285,12 @@ export class StreamCipher {
|
|
|
3272
3285
|
* @param {Uint8Array} iv
|
|
3273
3286
|
* @returns {StreamCipher}
|
|
3274
3287
|
*/
|
|
3275
|
-
static
|
|
3288
|
+
static new_kseed_ofb(key, iv) {
|
|
3276
3289
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3277
3290
|
const len0 = WASM_VECTOR_LEN;
|
|
3278
3291
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3279
3292
|
const len1 = WASM_VECTOR_LEN;
|
|
3280
|
-
const ret = wasm.
|
|
3293
|
+
const ret = wasm.streamcipher_new_kseed_ofb(ptr0, len0, ptr1, len1);
|
|
3281
3294
|
if (ret[2]) {
|
|
3282
3295
|
throw takeFromExternrefTable0(ret[1]);
|
|
3283
3296
|
}
|
|
@@ -3288,12 +3301,12 @@ export class StreamCipher {
|
|
|
3288
3301
|
* @param {Uint8Array} iv
|
|
3289
3302
|
* @returns {StreamCipher}
|
|
3290
3303
|
*/
|
|
3291
|
-
static
|
|
3304
|
+
static new_anubis_cfb(key, iv) {
|
|
3292
3305
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3293
3306
|
const len0 = WASM_VECTOR_LEN;
|
|
3294
3307
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3295
3308
|
const len1 = WASM_VECTOR_LEN;
|
|
3296
|
-
const ret = wasm.
|
|
3309
|
+
const ret = wasm.streamcipher_new_anubis_cfb(ptr0, len0, ptr1, len1);
|
|
3297
3310
|
if (ret[2]) {
|
|
3298
3311
|
throw takeFromExternrefTable0(ret[1]);
|
|
3299
3312
|
}
|
|
@@ -3304,12 +3317,12 @@ export class StreamCipher {
|
|
|
3304
3317
|
* @param {Uint8Array} iv
|
|
3305
3318
|
* @returns {StreamCipher}
|
|
3306
3319
|
*/
|
|
3307
|
-
static
|
|
3320
|
+
static new_anubis_ctr(key, iv) {
|
|
3308
3321
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3309
3322
|
const len0 = WASM_VECTOR_LEN;
|
|
3310
3323
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3311
3324
|
const len1 = WASM_VECTOR_LEN;
|
|
3312
|
-
const ret = wasm.
|
|
3325
|
+
const ret = wasm.streamcipher_new_anubis_ctr(ptr0, len0, ptr1, len1);
|
|
3313
3326
|
if (ret[2]) {
|
|
3314
3327
|
throw takeFromExternrefTable0(ret[1]);
|
|
3315
3328
|
}
|
|
@@ -3320,12 +3333,12 @@ export class StreamCipher {
|
|
|
3320
3333
|
* @param {Uint8Array} iv
|
|
3321
3334
|
* @returns {StreamCipher}
|
|
3322
3335
|
*/
|
|
3323
|
-
static
|
|
3336
|
+
static new_anubis_ofb(key, iv) {
|
|
3324
3337
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3325
3338
|
const len0 = WASM_VECTOR_LEN;
|
|
3326
3339
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3327
3340
|
const len1 = WASM_VECTOR_LEN;
|
|
3328
|
-
const ret = wasm.
|
|
3341
|
+
const ret = wasm.streamcipher_new_anubis_ofb(ptr0, len0, ptr1, len1);
|
|
3329
3342
|
if (ret[2]) {
|
|
3330
3343
|
throw takeFromExternrefTable0(ret[1]);
|
|
3331
3344
|
}
|
|
@@ -3336,12 +3349,12 @@ export class StreamCipher {
|
|
|
3336
3349
|
* @param {Uint8Array} iv
|
|
3337
3350
|
* @returns {StreamCipher}
|
|
3338
3351
|
*/
|
|
3339
|
-
static
|
|
3352
|
+
static new_noekeon_cfb(key, iv) {
|
|
3340
3353
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3341
3354
|
const len0 = WASM_VECTOR_LEN;
|
|
3342
3355
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3343
3356
|
const len1 = WASM_VECTOR_LEN;
|
|
3344
|
-
const ret = wasm.
|
|
3357
|
+
const ret = wasm.streamcipher_new_noekeon_cfb(ptr0, len0, ptr1, len1);
|
|
3345
3358
|
if (ret[2]) {
|
|
3346
3359
|
throw takeFromExternrefTable0(ret[1]);
|
|
3347
3360
|
}
|
|
@@ -3352,12 +3365,12 @@ export class StreamCipher {
|
|
|
3352
3365
|
* @param {Uint8Array} iv
|
|
3353
3366
|
* @returns {StreamCipher}
|
|
3354
3367
|
*/
|
|
3355
|
-
static
|
|
3368
|
+
static new_noekeon_ctr(key, iv) {
|
|
3356
3369
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3357
3370
|
const len0 = WASM_VECTOR_LEN;
|
|
3358
3371
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3359
3372
|
const len1 = WASM_VECTOR_LEN;
|
|
3360
|
-
const ret = wasm.
|
|
3373
|
+
const ret = wasm.streamcipher_new_noekeon_ctr(ptr0, len0, ptr1, len1);
|
|
3361
3374
|
if (ret[2]) {
|
|
3362
3375
|
throw takeFromExternrefTable0(ret[1]);
|
|
3363
3376
|
}
|
|
@@ -3368,12 +3381,12 @@ export class StreamCipher {
|
|
|
3368
3381
|
* @param {Uint8Array} iv
|
|
3369
3382
|
* @returns {StreamCipher}
|
|
3370
3383
|
*/
|
|
3371
|
-
static
|
|
3384
|
+
static new_noekeon_ofb(key, iv) {
|
|
3372
3385
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3373
3386
|
const len0 = WASM_VECTOR_LEN;
|
|
3374
3387
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3375
3388
|
const len1 = WASM_VECTOR_LEN;
|
|
3376
|
-
const ret = wasm.
|
|
3389
|
+
const ret = wasm.streamcipher_new_noekeon_ofb(ptr0, len0, ptr1, len1);
|
|
3377
3390
|
if (ret[2]) {
|
|
3378
3391
|
throw takeFromExternrefTable0(ret[1]);
|
|
3379
3392
|
}
|
|
@@ -3384,12 +3397,12 @@ export class StreamCipher {
|
|
|
3384
3397
|
* @param {Uint8Array} iv
|
|
3385
3398
|
* @returns {StreamCipher}
|
|
3386
3399
|
*/
|
|
3387
|
-
static
|
|
3400
|
+
static new_khazad_cfb(key, iv) {
|
|
3388
3401
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3389
3402
|
const len0 = WASM_VECTOR_LEN;
|
|
3390
3403
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3391
3404
|
const len1 = WASM_VECTOR_LEN;
|
|
3392
|
-
const ret = wasm.
|
|
3405
|
+
const ret = wasm.streamcipher_new_khazad_cfb(ptr0, len0, ptr1, len1);
|
|
3393
3406
|
if (ret[2]) {
|
|
3394
3407
|
throw takeFromExternrefTable0(ret[1]);
|
|
3395
3408
|
}
|
|
@@ -3400,12 +3413,12 @@ export class StreamCipher {
|
|
|
3400
3413
|
* @param {Uint8Array} iv
|
|
3401
3414
|
* @returns {StreamCipher}
|
|
3402
3415
|
*/
|
|
3403
|
-
static
|
|
3416
|
+
static new_khazad_ctr(key, iv) {
|
|
3404
3417
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3405
3418
|
const len0 = WASM_VECTOR_LEN;
|
|
3406
3419
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3407
3420
|
const len1 = WASM_VECTOR_LEN;
|
|
3408
|
-
const ret = wasm.
|
|
3421
|
+
const ret = wasm.streamcipher_new_khazad_ctr(ptr0, len0, ptr1, len1);
|
|
3409
3422
|
if (ret[2]) {
|
|
3410
3423
|
throw takeFromExternrefTable0(ret[1]);
|
|
3411
3424
|
}
|
|
@@ -3416,12 +3429,12 @@ export class StreamCipher {
|
|
|
3416
3429
|
* @param {Uint8Array} iv
|
|
3417
3430
|
* @returns {StreamCipher}
|
|
3418
3431
|
*/
|
|
3419
|
-
static
|
|
3432
|
+
static new_khazad_ofb(key, iv) {
|
|
3420
3433
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3421
3434
|
const len0 = WASM_VECTOR_LEN;
|
|
3422
3435
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3423
3436
|
const len1 = WASM_VECTOR_LEN;
|
|
3424
|
-
const ret = wasm.
|
|
3437
|
+
const ret = wasm.streamcipher_new_khazad_ofb(ptr0, len0, ptr1, len1);
|
|
3425
3438
|
if (ret[2]) {
|
|
3426
3439
|
throw takeFromExternrefTable0(ret[1]);
|
|
3427
3440
|
}
|
|
@@ -3432,12 +3445,12 @@ export class StreamCipher {
|
|
|
3432
3445
|
* @param {Uint8Array} iv
|
|
3433
3446
|
* @returns {StreamCipher}
|
|
3434
3447
|
*/
|
|
3435
|
-
static
|
|
3448
|
+
static new_serpent_cfb(key, iv) {
|
|
3436
3449
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3437
3450
|
const len0 = WASM_VECTOR_LEN;
|
|
3438
3451
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3439
3452
|
const len1 = WASM_VECTOR_LEN;
|
|
3440
|
-
const ret = wasm.
|
|
3453
|
+
const ret = wasm.streamcipher_new_serpent_cfb(ptr0, len0, ptr1, len1);
|
|
3441
3454
|
if (ret[2]) {
|
|
3442
3455
|
throw takeFromExternrefTable0(ret[1]);
|
|
3443
3456
|
}
|
|
@@ -3448,12 +3461,12 @@ export class StreamCipher {
|
|
|
3448
3461
|
* @param {Uint8Array} iv
|
|
3449
3462
|
* @returns {StreamCipher}
|
|
3450
3463
|
*/
|
|
3451
|
-
static
|
|
3464
|
+
static new_serpent_ctr(key, iv) {
|
|
3452
3465
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3453
3466
|
const len0 = WASM_VECTOR_LEN;
|
|
3454
3467
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3455
3468
|
const len1 = WASM_VECTOR_LEN;
|
|
3456
|
-
const ret = wasm.
|
|
3469
|
+
const ret = wasm.streamcipher_new_serpent_ctr(ptr0, len0, ptr1, len1);
|
|
3457
3470
|
if (ret[2]) {
|
|
3458
3471
|
throw takeFromExternrefTable0(ret[1]);
|
|
3459
3472
|
}
|
|
@@ -3462,15 +3475,14 @@ export class StreamCipher {
|
|
|
3462
3475
|
/**
|
|
3463
3476
|
* @param {Uint8Array} key
|
|
3464
3477
|
* @param {Uint8Array} iv
|
|
3465
|
-
* @param {number | null} [rounds]
|
|
3466
3478
|
* @returns {StreamCipher}
|
|
3467
3479
|
*/
|
|
3468
|
-
static
|
|
3480
|
+
static new_serpent_ofb(key, iv) {
|
|
3469
3481
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3470
3482
|
const len0 = WASM_VECTOR_LEN;
|
|
3471
3483
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3472
3484
|
const len1 = WASM_VECTOR_LEN;
|
|
3473
|
-
const ret = wasm.
|
|
3485
|
+
const ret = wasm.streamcipher_new_serpent_ofb(ptr0, len0, ptr1, len1);
|
|
3474
3486
|
if (ret[2]) {
|
|
3475
3487
|
throw takeFromExternrefTable0(ret[1]);
|
|
3476
3488
|
}
|
|
@@ -3482,12 +3494,12 @@ export class StreamCipher {
|
|
|
3482
3494
|
* @param {number | null} [rounds]
|
|
3483
3495
|
* @returns {StreamCipher}
|
|
3484
3496
|
*/
|
|
3485
|
-
static
|
|
3497
|
+
static new_rc2_cfb(key, iv, rounds) {
|
|
3486
3498
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3487
3499
|
const len0 = WASM_VECTOR_LEN;
|
|
3488
3500
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3489
3501
|
const len1 = WASM_VECTOR_LEN;
|
|
3490
|
-
const ret = wasm.
|
|
3502
|
+
const ret = wasm.streamcipher_new_rc2_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3491
3503
|
if (ret[2]) {
|
|
3492
3504
|
throw takeFromExternrefTable0(ret[1]);
|
|
3493
3505
|
}
|
|
@@ -3499,12 +3511,12 @@ export class StreamCipher {
|
|
|
3499
3511
|
* @param {number | null} [rounds]
|
|
3500
3512
|
* @returns {StreamCipher}
|
|
3501
3513
|
*/
|
|
3502
|
-
static
|
|
3514
|
+
static new_rc2_ctr(key, iv, rounds) {
|
|
3503
3515
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3504
3516
|
const len0 = WASM_VECTOR_LEN;
|
|
3505
3517
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3506
3518
|
const len1 = WASM_VECTOR_LEN;
|
|
3507
|
-
const ret = wasm.
|
|
3519
|
+
const ret = wasm.streamcipher_new_rc2_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3508
3520
|
if (ret[2]) {
|
|
3509
3521
|
throw takeFromExternrefTable0(ret[1]);
|
|
3510
3522
|
}
|
|
@@ -3513,14 +3525,15 @@ export class StreamCipher {
|
|
|
3513
3525
|
/**
|
|
3514
3526
|
* @param {Uint8Array} key
|
|
3515
3527
|
* @param {Uint8Array} iv
|
|
3528
|
+
* @param {number | null} [rounds]
|
|
3516
3529
|
* @returns {StreamCipher}
|
|
3517
3530
|
*/
|
|
3518
|
-
static
|
|
3531
|
+
static new_rc2_ofb(key, iv, rounds) {
|
|
3519
3532
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3520
3533
|
const len0 = WASM_VECTOR_LEN;
|
|
3521
3534
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3522
3535
|
const len1 = WASM_VECTOR_LEN;
|
|
3523
|
-
const ret = wasm.
|
|
3536
|
+
const ret = wasm.streamcipher_new_rc2_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3524
3537
|
if (ret[2]) {
|
|
3525
3538
|
throw takeFromExternrefTable0(ret[1]);
|
|
3526
3539
|
}
|
|
@@ -3529,14 +3542,15 @@ export class StreamCipher {
|
|
|
3529
3542
|
/**
|
|
3530
3543
|
* @param {Uint8Array} key
|
|
3531
3544
|
* @param {Uint8Array} iv
|
|
3545
|
+
* @param {number | null} [rounds]
|
|
3532
3546
|
* @returns {StreamCipher}
|
|
3533
3547
|
*/
|
|
3534
|
-
static
|
|
3548
|
+
static new_rc5_cfb(key, iv, rounds) {
|
|
3535
3549
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3536
3550
|
const len0 = WASM_VECTOR_LEN;
|
|
3537
3551
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3538
3552
|
const len1 = WASM_VECTOR_LEN;
|
|
3539
|
-
const ret = wasm.
|
|
3553
|
+
const ret = wasm.streamcipher_new_rc5_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3540
3554
|
if (ret[2]) {
|
|
3541
3555
|
throw takeFromExternrefTable0(ret[1]);
|
|
3542
3556
|
}
|
|
@@ -3545,14 +3559,15 @@ export class StreamCipher {
|
|
|
3545
3559
|
/**
|
|
3546
3560
|
* @param {Uint8Array} key
|
|
3547
3561
|
* @param {Uint8Array} iv
|
|
3562
|
+
* @param {number | null} [rounds]
|
|
3548
3563
|
* @returns {StreamCipher}
|
|
3549
3564
|
*/
|
|
3550
|
-
static
|
|
3565
|
+
static new_rc5_ctr(key, iv, rounds) {
|
|
3551
3566
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3552
3567
|
const len0 = WASM_VECTOR_LEN;
|
|
3553
3568
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3554
3569
|
const len1 = WASM_VECTOR_LEN;
|
|
3555
|
-
const ret = wasm.
|
|
3570
|
+
const ret = wasm.streamcipher_new_rc5_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3556
3571
|
if (ret[2]) {
|
|
3557
3572
|
throw takeFromExternrefTable0(ret[1]);
|
|
3558
3573
|
}
|
|
@@ -3561,14 +3576,15 @@ export class StreamCipher {
|
|
|
3561
3576
|
/**
|
|
3562
3577
|
* @param {Uint8Array} key
|
|
3563
3578
|
* @param {Uint8Array} iv
|
|
3579
|
+
* @param {number | null} [rounds]
|
|
3564
3580
|
* @returns {StreamCipher}
|
|
3565
3581
|
*/
|
|
3566
|
-
static
|
|
3582
|
+
static new_rc5_ofb(key, iv, rounds) {
|
|
3567
3583
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3568
3584
|
const len0 = WASM_VECTOR_LEN;
|
|
3569
3585
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3570
3586
|
const len1 = WASM_VECTOR_LEN;
|
|
3571
|
-
const ret = wasm.
|
|
3587
|
+
const ret = wasm.streamcipher_new_rc5_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3572
3588
|
if (ret[2]) {
|
|
3573
3589
|
throw takeFromExternrefTable0(ret[1]);
|
|
3574
3590
|
}
|
|
@@ -3577,14 +3593,15 @@ export class StreamCipher {
|
|
|
3577
3593
|
/**
|
|
3578
3594
|
* @param {Uint8Array} key
|
|
3579
3595
|
* @param {Uint8Array} iv
|
|
3596
|
+
* @param {number | null} [rounds]
|
|
3580
3597
|
* @returns {StreamCipher}
|
|
3581
3598
|
*/
|
|
3582
|
-
static
|
|
3599
|
+
static new_camellia_cfb(key, iv, rounds) {
|
|
3583
3600
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3584
3601
|
const len0 = WASM_VECTOR_LEN;
|
|
3585
3602
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3586
3603
|
const len1 = WASM_VECTOR_LEN;
|
|
3587
|
-
const ret = wasm.
|
|
3604
|
+
const ret = wasm.streamcipher_new_camellia_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3588
3605
|
if (ret[2]) {
|
|
3589
3606
|
throw takeFromExternrefTable0(ret[1]);
|
|
3590
3607
|
}
|
|
@@ -3593,49 +3610,32 @@ export class StreamCipher {
|
|
|
3593
3610
|
/**
|
|
3594
3611
|
* @param {Uint8Array} key
|
|
3595
3612
|
* @param {Uint8Array} iv
|
|
3613
|
+
* @param {number | null} [rounds]
|
|
3596
3614
|
* @returns {StreamCipher}
|
|
3597
3615
|
*/
|
|
3598
|
-
static
|
|
3616
|
+
static new_camellia_ctr(key, iv, rounds) {
|
|
3599
3617
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3600
3618
|
const len0 = WASM_VECTOR_LEN;
|
|
3601
3619
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3602
3620
|
const len1 = WASM_VECTOR_LEN;
|
|
3603
|
-
const ret = wasm.
|
|
3621
|
+
const ret = wasm.streamcipher_new_camellia_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3604
3622
|
if (ret[2]) {
|
|
3605
3623
|
throw takeFromExternrefTable0(ret[1]);
|
|
3606
3624
|
}
|
|
3607
3625
|
return StreamCipher.__wrap(ret[0]);
|
|
3608
3626
|
}
|
|
3609
|
-
/**
|
|
3610
|
-
* @param {Uint8Array} data
|
|
3611
|
-
*/
|
|
3612
|
-
decrypt(data) {
|
|
3613
|
-
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
3614
|
-
var len0 = WASM_VECTOR_LEN;
|
|
3615
|
-
const ret = wasm.streamcipher_decrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
3616
|
-
if (ret[1]) {
|
|
3617
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
3618
|
-
}
|
|
3619
|
-
}
|
|
3620
|
-
/**
|
|
3621
|
-
* @param {Uint8Array} data
|
|
3622
|
-
*/
|
|
3623
|
-
encrypt(data) {
|
|
3624
|
-
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
3625
|
-
var len0 = WASM_VECTOR_LEN;
|
|
3626
|
-
const ret = wasm.streamcipher_encrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
3627
|
-
if (ret[1]) {
|
|
3628
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
3629
|
-
}
|
|
3630
|
-
}
|
|
3631
3627
|
/**
|
|
3632
3628
|
* @param {Uint8Array} key
|
|
3629
|
+
* @param {Uint8Array} iv
|
|
3630
|
+
* @param {number | null} [rounds]
|
|
3633
3631
|
* @returns {StreamCipher}
|
|
3634
3632
|
*/
|
|
3635
|
-
static
|
|
3633
|
+
static new_camellia_ofb(key, iv, rounds) {
|
|
3636
3634
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3637
3635
|
const len0 = WASM_VECTOR_LEN;
|
|
3638
|
-
const
|
|
3636
|
+
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3637
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3638
|
+
const ret = wasm.streamcipher_new_camellia_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3639
3639
|
if (ret[2]) {
|
|
3640
3640
|
throw takeFromExternrefTable0(ret[1]);
|
|
3641
3641
|
}
|