@cathaysia/crown-wasm 0.26.5 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/crown_wasm.d.ts +263 -171
- package/crown_wasm_bg.js +1627 -670
- package/crown_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/crown_wasm_bg.js
CHANGED
|
@@ -18,6 +18,21 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
18
18
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function addToExternrefTable0(obj) {
|
|
22
|
+
const idx = wasm.__externref_table_alloc();
|
|
23
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
24
|
+
return idx;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function handleError(f, args) {
|
|
28
|
+
try {
|
|
29
|
+
return f.apply(this, args);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
const idx = addToExternrefTable0(e);
|
|
32
|
+
wasm.__wbindgen_exn_store(idx);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
22
37
|
|
|
23
38
|
cachedTextDecoder.decode();
|
|
@@ -49,7 +64,7 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
49
64
|
}
|
|
50
65
|
|
|
51
66
|
function takeFromExternrefTable0(idx) {
|
|
52
|
-
const value = wasm.
|
|
67
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
53
68
|
wasm.__externref_table_dealloc(idx);
|
|
54
69
|
return value;
|
|
55
70
|
}
|
|
@@ -57,6 +72,580 @@ function takeFromExternrefTable0(idx) {
|
|
|
57
72
|
function isLikeNone(x) {
|
|
58
73
|
return x === undefined || x === null;
|
|
59
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* @returns {Uint8Array}
|
|
77
|
+
*/
|
|
78
|
+
export function ed25519_keygen() {
|
|
79
|
+
const ret = wasm.ed25519_keygen();
|
|
80
|
+
if (ret[3]) {
|
|
81
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
82
|
+
}
|
|
83
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
84
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
85
|
+
return v1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @param {Uint8Array} secret
|
|
90
|
+
* @param {Uint8Array} msg
|
|
91
|
+
* @returns {Uint8Array}
|
|
92
|
+
*/
|
|
93
|
+
export function ed25519_sign(secret, msg) {
|
|
94
|
+
const ptr0 = passArray8ToWasm0(secret, wasm.__wbindgen_malloc);
|
|
95
|
+
const len0 = WASM_VECTOR_LEN;
|
|
96
|
+
const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
97
|
+
const len1 = WASM_VECTOR_LEN;
|
|
98
|
+
const ret = wasm.ed25519_sign(ptr0, len0, ptr1, len1);
|
|
99
|
+
if (ret[3]) {
|
|
100
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
101
|
+
}
|
|
102
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
103
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
104
|
+
return v3;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @param {Uint8Array} _public
|
|
109
|
+
* @param {Uint8Array} msg
|
|
110
|
+
* @param {Uint8Array} sig
|
|
111
|
+
* @returns {boolean}
|
|
112
|
+
*/
|
|
113
|
+
export function ed25519_verify(_public, msg, sig) {
|
|
114
|
+
const ptr0 = passArray8ToWasm0(_public, wasm.__wbindgen_malloc);
|
|
115
|
+
const len0 = WASM_VECTOR_LEN;
|
|
116
|
+
const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
117
|
+
const len1 = WASM_VECTOR_LEN;
|
|
118
|
+
const ptr2 = passArray8ToWasm0(sig, wasm.__wbindgen_malloc);
|
|
119
|
+
const len2 = WASM_VECTOR_LEN;
|
|
120
|
+
const ret = wasm.ed25519_verify(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
121
|
+
if (ret[2]) {
|
|
122
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
123
|
+
}
|
|
124
|
+
return ret[0] !== 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Returns `public || private`.
|
|
129
|
+
* @param {number} variant
|
|
130
|
+
* @param {Uint8Array} seed
|
|
131
|
+
* @returns {Uint8Array}
|
|
132
|
+
*/
|
|
133
|
+
export function ml_dsa_keygen(variant, seed) {
|
|
134
|
+
const ptr0 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
|
|
135
|
+
const len0 = WASM_VECTOR_LEN;
|
|
136
|
+
const ret = wasm.ml_dsa_keygen(variant, ptr0, len0);
|
|
137
|
+
if (ret[3]) {
|
|
138
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
139
|
+
}
|
|
140
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
141
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
142
|
+
return v2;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @param {number} variant
|
|
147
|
+
* @param {Uint8Array} _private
|
|
148
|
+
* @param {Uint8Array} msg
|
|
149
|
+
* @param {Uint8Array} ctx
|
|
150
|
+
* @returns {Uint8Array}
|
|
151
|
+
*/
|
|
152
|
+
export function ml_dsa_sign(variant, _private, msg, ctx) {
|
|
153
|
+
const ptr0 = passArray8ToWasm0(_private, wasm.__wbindgen_malloc);
|
|
154
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155
|
+
const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
156
|
+
const len1 = WASM_VECTOR_LEN;
|
|
157
|
+
const ptr2 = passArray8ToWasm0(ctx, wasm.__wbindgen_malloc);
|
|
158
|
+
const len2 = WASM_VECTOR_LEN;
|
|
159
|
+
const ret = wasm.ml_dsa_sign(variant, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
160
|
+
if (ret[3]) {
|
|
161
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
162
|
+
}
|
|
163
|
+
var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
164
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
165
|
+
return v4;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @param {number} variant
|
|
170
|
+
* @param {Uint8Array} _public
|
|
171
|
+
* @param {Uint8Array} msg
|
|
172
|
+
* @param {Uint8Array} ctx
|
|
173
|
+
* @param {Uint8Array} sig
|
|
174
|
+
* @returns {boolean}
|
|
175
|
+
*/
|
|
176
|
+
export function ml_dsa_verify(variant, _public, msg, ctx, sig) {
|
|
177
|
+
const ptr0 = passArray8ToWasm0(_public, wasm.__wbindgen_malloc);
|
|
178
|
+
const len0 = WASM_VECTOR_LEN;
|
|
179
|
+
const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
180
|
+
const len1 = WASM_VECTOR_LEN;
|
|
181
|
+
const ptr2 = passArray8ToWasm0(ctx, wasm.__wbindgen_malloc);
|
|
182
|
+
const len2 = WASM_VECTOR_LEN;
|
|
183
|
+
const ptr3 = passArray8ToWasm0(sig, wasm.__wbindgen_malloc);
|
|
184
|
+
const len3 = WASM_VECTOR_LEN;
|
|
185
|
+
const ret = wasm.ml_dsa_verify(variant, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
186
|
+
if (ret[2]) {
|
|
187
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
188
|
+
}
|
|
189
|
+
return ret[0] !== 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const cachedTextEncoder = new TextEncoder();
|
|
193
|
+
|
|
194
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
195
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
196
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
197
|
+
view.set(buf);
|
|
198
|
+
return {
|
|
199
|
+
read: arg.length,
|
|
200
|
+
written: buf.length
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
206
|
+
|
|
207
|
+
if (realloc === undefined) {
|
|
208
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
209
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
210
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
211
|
+
WASM_VECTOR_LEN = buf.length;
|
|
212
|
+
return ptr;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
let len = arg.length;
|
|
216
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
217
|
+
|
|
218
|
+
const mem = getUint8ArrayMemory0();
|
|
219
|
+
|
|
220
|
+
let offset = 0;
|
|
221
|
+
|
|
222
|
+
for (; offset < len; offset++) {
|
|
223
|
+
const code = arg.charCodeAt(offset);
|
|
224
|
+
if (code > 0x7F) break;
|
|
225
|
+
mem[ptr + offset] = code;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (offset !== len) {
|
|
229
|
+
if (offset !== 0) {
|
|
230
|
+
arg = arg.slice(offset);
|
|
231
|
+
}
|
|
232
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
233
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
234
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
235
|
+
|
|
236
|
+
offset += ret.written;
|
|
237
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
WASM_VECTOR_LEN = offset;
|
|
241
|
+
return ptr;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Returns `public || private`.
|
|
245
|
+
* @param {string} name
|
|
246
|
+
* @param {Uint8Array} seed
|
|
247
|
+
* @returns {Uint8Array}
|
|
248
|
+
*/
|
|
249
|
+
export function slh_dsa_keygen(name, seed) {
|
|
250
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
251
|
+
const len0 = WASM_VECTOR_LEN;
|
|
252
|
+
const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
|
|
253
|
+
const len1 = WASM_VECTOR_LEN;
|
|
254
|
+
const ret = wasm.slh_dsa_keygen(ptr0, len0, ptr1, len1);
|
|
255
|
+
if (ret[3]) {
|
|
256
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
257
|
+
}
|
|
258
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
259
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
260
|
+
return v3;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* @param {string} name
|
|
265
|
+
* @param {Uint8Array} _private
|
|
266
|
+
* @param {Uint8Array} msg
|
|
267
|
+
* @param {Uint8Array} ctx
|
|
268
|
+
* @returns {Uint8Array}
|
|
269
|
+
*/
|
|
270
|
+
export function slh_dsa_sign(name, _private, msg, ctx) {
|
|
271
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
272
|
+
const len0 = WASM_VECTOR_LEN;
|
|
273
|
+
const ptr1 = passArray8ToWasm0(_private, wasm.__wbindgen_malloc);
|
|
274
|
+
const len1 = WASM_VECTOR_LEN;
|
|
275
|
+
const ptr2 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
276
|
+
const len2 = WASM_VECTOR_LEN;
|
|
277
|
+
const ptr3 = passArray8ToWasm0(ctx, wasm.__wbindgen_malloc);
|
|
278
|
+
const len3 = WASM_VECTOR_LEN;
|
|
279
|
+
const ret = wasm.slh_dsa_sign(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
280
|
+
if (ret[3]) {
|
|
281
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
282
|
+
}
|
|
283
|
+
var v5 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
284
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
285
|
+
return v5;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @param {string} name
|
|
290
|
+
* @param {Uint8Array} _public
|
|
291
|
+
* @param {Uint8Array} msg
|
|
292
|
+
* @param {Uint8Array} ctx
|
|
293
|
+
* @param {Uint8Array} sig
|
|
294
|
+
* @returns {boolean}
|
|
295
|
+
*/
|
|
296
|
+
export function slh_dsa_verify(name, _public, msg, ctx, sig) {
|
|
297
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
298
|
+
const len0 = WASM_VECTOR_LEN;
|
|
299
|
+
const ptr1 = passArray8ToWasm0(_public, wasm.__wbindgen_malloc);
|
|
300
|
+
const len1 = WASM_VECTOR_LEN;
|
|
301
|
+
const ptr2 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
302
|
+
const len2 = WASM_VECTOR_LEN;
|
|
303
|
+
const ptr3 = passArray8ToWasm0(ctx, wasm.__wbindgen_malloc);
|
|
304
|
+
const len3 = WASM_VECTOR_LEN;
|
|
305
|
+
const ptr4 = passArray8ToWasm0(sig, wasm.__wbindgen_malloc);
|
|
306
|
+
const len4 = WASM_VECTOR_LEN;
|
|
307
|
+
const ret = wasm.slh_dsa_verify(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
308
|
+
if (ret[2]) {
|
|
309
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
310
|
+
}
|
|
311
|
+
return ret[0] !== 0;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* @param {Uint8Array} key
|
|
316
|
+
* @param {Uint8Array} plaintext
|
|
317
|
+
* @returns {Uint8Array}
|
|
318
|
+
*/
|
|
319
|
+
export function aes_key_wrap(key, plaintext) {
|
|
320
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
321
|
+
const len0 = WASM_VECTOR_LEN;
|
|
322
|
+
const ptr1 = passArray8ToWasm0(plaintext, wasm.__wbindgen_malloc);
|
|
323
|
+
const len1 = WASM_VECTOR_LEN;
|
|
324
|
+
const ret = wasm.aes_key_wrap(ptr0, len0, ptr1, len1);
|
|
325
|
+
if (ret[3]) {
|
|
326
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
327
|
+
}
|
|
328
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
329
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
330
|
+
return v3;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* @param {Uint8Array} key
|
|
335
|
+
* @param {Uint8Array} ciphertext
|
|
336
|
+
* @returns {Uint8Array}
|
|
337
|
+
*/
|
|
338
|
+
export function aes_key_unwrap(key, ciphertext) {
|
|
339
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
340
|
+
const len0 = WASM_VECTOR_LEN;
|
|
341
|
+
const ptr1 = passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
|
|
342
|
+
const len1 = WASM_VECTOR_LEN;
|
|
343
|
+
const ret = wasm.aes_key_unwrap(ptr0, len0, ptr1, len1);
|
|
344
|
+
if (ret[3]) {
|
|
345
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
346
|
+
}
|
|
347
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
348
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
349
|
+
return v3;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* @param {Uint8Array} key
|
|
354
|
+
* @param {Uint8Array} plaintext
|
|
355
|
+
* @returns {Uint8Array}
|
|
356
|
+
*/
|
|
357
|
+
export function aes_key_wrap_padded(key, plaintext) {
|
|
358
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
359
|
+
const len0 = WASM_VECTOR_LEN;
|
|
360
|
+
const ptr1 = passArray8ToWasm0(plaintext, wasm.__wbindgen_malloc);
|
|
361
|
+
const len1 = WASM_VECTOR_LEN;
|
|
362
|
+
const ret = wasm.aes_key_wrap_padded(ptr0, len0, ptr1, len1);
|
|
363
|
+
if (ret[3]) {
|
|
364
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
365
|
+
}
|
|
366
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
367
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
368
|
+
return v3;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* @param {Uint8Array} key
|
|
373
|
+
* @param {Uint8Array} ciphertext
|
|
374
|
+
* @returns {Uint8Array}
|
|
375
|
+
*/
|
|
376
|
+
export function aes_key_unwrap_padded(key, ciphertext) {
|
|
377
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
378
|
+
const len0 = WASM_VECTOR_LEN;
|
|
379
|
+
const ptr1 = passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
|
|
380
|
+
const len1 = WASM_VECTOR_LEN;
|
|
381
|
+
const ret = wasm.aes_key_unwrap_padded(ptr0, len0, ptr1, len1);
|
|
382
|
+
if (ret[3]) {
|
|
383
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
384
|
+
}
|
|
385
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
386
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
387
|
+
return v3;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* @param {Uint8Array} key
|
|
392
|
+
* @param {Uint8Array} tweak
|
|
393
|
+
* @param {string} input
|
|
394
|
+
* @returns {string}
|
|
395
|
+
*/
|
|
396
|
+
export function ff1_encrypt_decimal(key, tweak, input) {
|
|
397
|
+
let deferred5_0;
|
|
398
|
+
let deferred5_1;
|
|
399
|
+
try {
|
|
400
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
401
|
+
const len0 = WASM_VECTOR_LEN;
|
|
402
|
+
const ptr1 = passArray8ToWasm0(tweak, wasm.__wbindgen_malloc);
|
|
403
|
+
const len1 = WASM_VECTOR_LEN;
|
|
404
|
+
const ptr2 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
405
|
+
const len2 = WASM_VECTOR_LEN;
|
|
406
|
+
const ret = wasm.ff1_encrypt_decimal(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
407
|
+
var ptr4 = ret[0];
|
|
408
|
+
var len4 = ret[1];
|
|
409
|
+
if (ret[3]) {
|
|
410
|
+
ptr4 = 0; len4 = 0;
|
|
411
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
412
|
+
}
|
|
413
|
+
deferred5_0 = ptr4;
|
|
414
|
+
deferred5_1 = len4;
|
|
415
|
+
return getStringFromWasm0(ptr4, len4);
|
|
416
|
+
} finally {
|
|
417
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* @param {Uint8Array} key
|
|
423
|
+
* @param {Uint8Array} tweak
|
|
424
|
+
* @param {string} input
|
|
425
|
+
* @returns {string}
|
|
426
|
+
*/
|
|
427
|
+
export function ff1_decrypt_decimal(key, tweak, input) {
|
|
428
|
+
let deferred5_0;
|
|
429
|
+
let deferred5_1;
|
|
430
|
+
try {
|
|
431
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
432
|
+
const len0 = WASM_VECTOR_LEN;
|
|
433
|
+
const ptr1 = passArray8ToWasm0(tweak, wasm.__wbindgen_malloc);
|
|
434
|
+
const len1 = WASM_VECTOR_LEN;
|
|
435
|
+
const ptr2 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
436
|
+
const len2 = WASM_VECTOR_LEN;
|
|
437
|
+
const ret = wasm.ff1_decrypt_decimal(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
438
|
+
var ptr4 = ret[0];
|
|
439
|
+
var len4 = ret[1];
|
|
440
|
+
if (ret[3]) {
|
|
441
|
+
ptr4 = 0; len4 = 0;
|
|
442
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
443
|
+
}
|
|
444
|
+
deferred5_0 = ptr4;
|
|
445
|
+
deferred5_1 = len4;
|
|
446
|
+
return getStringFromWasm0(ptr4, len4);
|
|
447
|
+
} finally {
|
|
448
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* PBKDF2-HMAC-SHA256.
|
|
454
|
+
* @param {Uint8Array} password
|
|
455
|
+
* @param {Uint8Array} salt
|
|
456
|
+
* @param {number} iterations
|
|
457
|
+
* @param {number} length
|
|
458
|
+
* @returns {Uint8Array}
|
|
459
|
+
*/
|
|
460
|
+
export function pbkdf2(password, salt, iterations, length) {
|
|
461
|
+
const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
|
|
462
|
+
const len0 = WASM_VECTOR_LEN;
|
|
463
|
+
const ptr1 = passArray8ToWasm0(salt, wasm.__wbindgen_malloc);
|
|
464
|
+
const len1 = WASM_VECTOR_LEN;
|
|
465
|
+
const ret = wasm.pbkdf2(ptr0, len0, ptr1, len1, iterations, length);
|
|
466
|
+
if (ret[3]) {
|
|
467
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
468
|
+
}
|
|
469
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
470
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
471
|
+
return v3;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* HKDF-Extract + Expand with SHA-256. `info` may be empty.
|
|
476
|
+
* @param {Uint8Array} ikm
|
|
477
|
+
* @param {Uint8Array} salt
|
|
478
|
+
* @param {Uint8Array} info
|
|
479
|
+
* @param {number} length
|
|
480
|
+
* @returns {Uint8Array}
|
|
481
|
+
*/
|
|
482
|
+
export function hkdf(ikm, salt, info, length) {
|
|
483
|
+
const ptr0 = passArray8ToWasm0(ikm, wasm.__wbindgen_malloc);
|
|
484
|
+
const len0 = WASM_VECTOR_LEN;
|
|
485
|
+
const ptr1 = passArray8ToWasm0(salt, wasm.__wbindgen_malloc);
|
|
486
|
+
const len1 = WASM_VECTOR_LEN;
|
|
487
|
+
const ptr2 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);
|
|
488
|
+
const len2 = WASM_VECTOR_LEN;
|
|
489
|
+
const ret = wasm.hkdf(ptr0, len0, ptr1, len1, ptr2, len2, length);
|
|
490
|
+
if (ret[3]) {
|
|
491
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
492
|
+
}
|
|
493
|
+
var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
494
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
495
|
+
return v4;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* TLS 1.2 PRF with SHA-256. `seed` is the label+seed material.
|
|
500
|
+
* @param {Uint8Array} secret
|
|
501
|
+
* @param {Uint8Array} seed
|
|
502
|
+
* @param {number} length
|
|
503
|
+
* @returns {Uint8Array}
|
|
504
|
+
*/
|
|
505
|
+
export function tls1_prf(secret, seed, length) {
|
|
506
|
+
const ptr0 = passArray8ToWasm0(secret, wasm.__wbindgen_malloc);
|
|
507
|
+
const len0 = WASM_VECTOR_LEN;
|
|
508
|
+
const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
|
|
509
|
+
const len1 = WASM_VECTOR_LEN;
|
|
510
|
+
const ret = wasm.tls1_prf(ptr0, len0, ptr1, len1, length);
|
|
511
|
+
if (ret[3]) {
|
|
512
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
513
|
+
}
|
|
514
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
515
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
516
|
+
return v3;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* SSKDF (hash-based) with SHA-256.
|
|
521
|
+
* @param {Uint8Array} secret
|
|
522
|
+
* @param {Uint8Array} info
|
|
523
|
+
* @param {number} length
|
|
524
|
+
* @returns {Uint8Array}
|
|
525
|
+
*/
|
|
526
|
+
export function sskdf(secret, info, length) {
|
|
527
|
+
const ptr0 = passArray8ToWasm0(secret, wasm.__wbindgen_malloc);
|
|
528
|
+
const len0 = WASM_VECTOR_LEN;
|
|
529
|
+
const ptr1 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);
|
|
530
|
+
const len1 = WASM_VECTOR_LEN;
|
|
531
|
+
const ret = wasm.sskdf(ptr0, len0, ptr1, len1, length);
|
|
532
|
+
if (ret[3]) {
|
|
533
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
534
|
+
}
|
|
535
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
536
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
537
|
+
return v3;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* X963KDF with SHA-256.
|
|
542
|
+
* @param {Uint8Array} secret
|
|
543
|
+
* @param {Uint8Array} info
|
|
544
|
+
* @param {number} length
|
|
545
|
+
* @returns {Uint8Array}
|
|
546
|
+
*/
|
|
547
|
+
export function x963_kdf(secret, info, length) {
|
|
548
|
+
const ptr0 = passArray8ToWasm0(secret, wasm.__wbindgen_malloc);
|
|
549
|
+
const len0 = WASM_VECTOR_LEN;
|
|
550
|
+
const ptr1 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);
|
|
551
|
+
const len1 = WASM_VECTOR_LEN;
|
|
552
|
+
const ret = wasm.x963_kdf(ptr0, len0, ptr1, len1, length);
|
|
553
|
+
if (ret[3]) {
|
|
554
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
555
|
+
}
|
|
556
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
557
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
558
|
+
return v3;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* HOTP (RFC 4226).
|
|
563
|
+
* @param {Uint8Array} key
|
|
564
|
+
* @param {number} counter
|
|
565
|
+
* @param {number} digits
|
|
566
|
+
* @returns {number}
|
|
567
|
+
*/
|
|
568
|
+
export function hotp(key, counter, digits) {
|
|
569
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
570
|
+
const len0 = WASM_VECTOR_LEN;
|
|
571
|
+
const ret = wasm.hotp(ptr0, len0, counter, digits);
|
|
572
|
+
return ret >>> 0;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* TOTP (RFC 6238).
|
|
577
|
+
* @param {Uint8Array} key
|
|
578
|
+
* @param {number} time
|
|
579
|
+
* @param {number} step
|
|
580
|
+
* @param {number} digits
|
|
581
|
+
* @param {number} t0
|
|
582
|
+
* @returns {number}
|
|
583
|
+
*/
|
|
584
|
+
export function totp(key, time, step, digits, t0) {
|
|
585
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
586
|
+
const len0 = WASM_VECTOR_LEN;
|
|
587
|
+
const ret = wasm.totp(ptr0, len0, time, step, digits, t0);
|
|
588
|
+
return ret >>> 0;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Returns `public || private`.
|
|
593
|
+
* @param {number} variant
|
|
594
|
+
* @param {Uint8Array} seed
|
|
595
|
+
* @returns {Uint8Array}
|
|
596
|
+
*/
|
|
597
|
+
export function ml_kem_keygen(variant, seed) {
|
|
598
|
+
const ptr0 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
|
|
599
|
+
const len0 = WASM_VECTOR_LEN;
|
|
600
|
+
const ret = wasm.ml_kem_keygen(variant, ptr0, len0);
|
|
601
|
+
if (ret[3]) {
|
|
602
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
603
|
+
}
|
|
604
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
605
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
606
|
+
return v2;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Returns `ciphertext || shared_secret`.
|
|
611
|
+
* @param {number} variant
|
|
612
|
+
* @param {Uint8Array} _public
|
|
613
|
+
* @param {Uint8Array} message
|
|
614
|
+
* @returns {Uint8Array}
|
|
615
|
+
*/
|
|
616
|
+
export function ml_kem_encapsulate(variant, _public, message) {
|
|
617
|
+
const ptr0 = passArray8ToWasm0(_public, wasm.__wbindgen_malloc);
|
|
618
|
+
const len0 = WASM_VECTOR_LEN;
|
|
619
|
+
const ptr1 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
|
|
620
|
+
const len1 = WASM_VECTOR_LEN;
|
|
621
|
+
const ret = wasm.ml_kem_encapsulate(variant, ptr0, len0, ptr1, len1);
|
|
622
|
+
if (ret[3]) {
|
|
623
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
624
|
+
}
|
|
625
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
626
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
627
|
+
return v3;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* @param {number} variant
|
|
632
|
+
* @param {Uint8Array} _private
|
|
633
|
+
* @param {Uint8Array} ciphertext
|
|
634
|
+
* @returns {Uint8Array}
|
|
635
|
+
*/
|
|
636
|
+
export function ml_kem_decapsulate(variant, _private, ciphertext) {
|
|
637
|
+
const ptr0 = passArray8ToWasm0(_private, wasm.__wbindgen_malloc);
|
|
638
|
+
const len0 = WASM_VECTOR_LEN;
|
|
639
|
+
const ptr1 = passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
|
|
640
|
+
const len1 = WASM_VECTOR_LEN;
|
|
641
|
+
const ret = wasm.ml_kem_decapsulate(variant, ptr0, len0, ptr1, len1);
|
|
642
|
+
if (ret[3]) {
|
|
643
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
644
|
+
}
|
|
645
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
646
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
647
|
+
return v3;
|
|
648
|
+
}
|
|
60
649
|
|
|
61
650
|
const AeadCipherFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
62
651
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -83,23 +672,14 @@ export class AeadCipher {
|
|
|
83
672
|
const ptr = this.__destroy_into_raw();
|
|
84
673
|
wasm.__wbg_aeadcipher_free(ptr, 0);
|
|
85
674
|
}
|
|
86
|
-
/**
|
|
87
|
-
* @returns {number}
|
|
88
|
-
*/
|
|
89
|
-
nonce_size() {
|
|
90
|
-
const ret = wasm.aeadcipher_nonce_size(this.__wbg_ptr);
|
|
91
|
-
return ret >>> 0;
|
|
92
|
-
}
|
|
93
675
|
/**
|
|
94
676
|
* @param {Uint8Array} key
|
|
95
|
-
* @param {number} tag_size
|
|
96
|
-
* @param {number} nonce_size
|
|
97
677
|
* @returns {AeadCipher}
|
|
98
678
|
*/
|
|
99
|
-
static
|
|
679
|
+
static new_kasumi_gcm(key) {
|
|
100
680
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
101
681
|
const len0 = WASM_VECTOR_LEN;
|
|
102
|
-
const ret = wasm.
|
|
682
|
+
const ret = wasm.aeadcipher_new_kasumi_gcm(ptr0, len0);
|
|
103
683
|
if (ret[2]) {
|
|
104
684
|
throw takeFromExternrefTable0(ret[1]);
|
|
105
685
|
}
|
|
@@ -111,10 +691,10 @@ export class AeadCipher {
|
|
|
111
691
|
* @param {number} nonce_size
|
|
112
692
|
* @returns {AeadCipher}
|
|
113
693
|
*/
|
|
114
|
-
static
|
|
694
|
+
static new_kasumi_ocb3(key, tag_size, nonce_size) {
|
|
115
695
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
116
696
|
const len0 = WASM_VECTOR_LEN;
|
|
117
|
-
const ret = wasm.
|
|
697
|
+
const ret = wasm.aeadcipher_new_kasumi_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
118
698
|
if (ret[2]) {
|
|
119
699
|
throw takeFromExternrefTable0(ret[1]);
|
|
120
700
|
}
|
|
@@ -122,12 +702,14 @@ export class AeadCipher {
|
|
|
122
702
|
}
|
|
123
703
|
/**
|
|
124
704
|
* @param {Uint8Array} key
|
|
705
|
+
* @param {number} tag_size
|
|
706
|
+
* @param {number} nonce_size
|
|
125
707
|
* @returns {AeadCipher}
|
|
126
708
|
*/
|
|
127
|
-
static
|
|
709
|
+
static new_kasumi_ccm(key, tag_size, nonce_size) {
|
|
128
710
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
129
711
|
const len0 = WASM_VECTOR_LEN;
|
|
130
|
-
const ret = wasm.
|
|
712
|
+
const ret = wasm.aeadcipher_new_kasumi_ccm(ptr0, len0, tag_size, nonce_size);
|
|
131
713
|
if (ret[2]) {
|
|
132
714
|
throw takeFromExternrefTable0(ret[1]);
|
|
133
715
|
}
|
|
@@ -139,10 +721,10 @@ export class AeadCipher {
|
|
|
139
721
|
* @param {number} nonce_size
|
|
140
722
|
* @returns {AeadCipher}
|
|
141
723
|
*/
|
|
142
|
-
static
|
|
724
|
+
static new_kasumi_eax(key, tag_size, nonce_size) {
|
|
143
725
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
144
726
|
const len0 = WASM_VECTOR_LEN;
|
|
145
|
-
const ret = wasm.
|
|
727
|
+
const ret = wasm.aeadcipher_new_kasumi_eax(ptr0, len0, tag_size, nonce_size);
|
|
146
728
|
if (ret[2]) {
|
|
147
729
|
throw takeFromExternrefTable0(ret[1]);
|
|
148
730
|
}
|
|
@@ -150,14 +732,12 @@ export class AeadCipher {
|
|
|
150
732
|
}
|
|
151
733
|
/**
|
|
152
734
|
* @param {Uint8Array} key
|
|
153
|
-
* @param {number} tag_size
|
|
154
|
-
* @param {number} nonce_size
|
|
155
735
|
* @returns {AeadCipher}
|
|
156
736
|
*/
|
|
157
|
-
static
|
|
737
|
+
static new_kseed_gcm(key) {
|
|
158
738
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
159
739
|
const len0 = WASM_VECTOR_LEN;
|
|
160
|
-
const ret = wasm.
|
|
740
|
+
const ret = wasm.aeadcipher_new_kseed_gcm(ptr0, len0);
|
|
161
741
|
if (ret[2]) {
|
|
162
742
|
throw takeFromExternrefTable0(ret[1]);
|
|
163
743
|
}
|
|
@@ -165,12 +745,14 @@ export class AeadCipher {
|
|
|
165
745
|
}
|
|
166
746
|
/**
|
|
167
747
|
* @param {Uint8Array} key
|
|
748
|
+
* @param {number} tag_size
|
|
749
|
+
* @param {number} nonce_size
|
|
168
750
|
* @returns {AeadCipher}
|
|
169
751
|
*/
|
|
170
|
-
static
|
|
752
|
+
static new_kseed_ocb3(key, tag_size, nonce_size) {
|
|
171
753
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
172
754
|
const len0 = WASM_VECTOR_LEN;
|
|
173
|
-
const ret = wasm.
|
|
755
|
+
const ret = wasm.aeadcipher_new_kseed_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
174
756
|
if (ret[2]) {
|
|
175
757
|
throw takeFromExternrefTable0(ret[1]);
|
|
176
758
|
}
|
|
@@ -180,13 +762,12 @@ export class AeadCipher {
|
|
|
180
762
|
* @param {Uint8Array} key
|
|
181
763
|
* @param {number} tag_size
|
|
182
764
|
* @param {number} nonce_size
|
|
183
|
-
* @param {number | null} [rounds]
|
|
184
765
|
* @returns {AeadCipher}
|
|
185
766
|
*/
|
|
186
|
-
static
|
|
767
|
+
static new_kseed_ccm(key, tag_size, nonce_size) {
|
|
187
768
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
188
769
|
const len0 = WASM_VECTOR_LEN;
|
|
189
|
-
const ret = wasm.
|
|
770
|
+
const ret = wasm.aeadcipher_new_kseed_ccm(ptr0, len0, tag_size, nonce_size);
|
|
190
771
|
if (ret[2]) {
|
|
191
772
|
throw takeFromExternrefTable0(ret[1]);
|
|
192
773
|
}
|
|
@@ -196,13 +777,12 @@ export class AeadCipher {
|
|
|
196
777
|
* @param {Uint8Array} key
|
|
197
778
|
* @param {number} tag_size
|
|
198
779
|
* @param {number} nonce_size
|
|
199
|
-
* @param {number | null} [rounds]
|
|
200
780
|
* @returns {AeadCipher}
|
|
201
781
|
*/
|
|
202
|
-
static
|
|
782
|
+
static new_kseed_eax(key, tag_size, nonce_size) {
|
|
203
783
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
204
784
|
const len0 = WASM_VECTOR_LEN;
|
|
205
|
-
const ret = wasm.
|
|
785
|
+
const ret = wasm.aeadcipher_new_kseed_eax(ptr0, len0, tag_size, nonce_size);
|
|
206
786
|
if (ret[2]) {
|
|
207
787
|
throw takeFromExternrefTable0(ret[1]);
|
|
208
788
|
}
|
|
@@ -210,13 +790,12 @@ export class AeadCipher {
|
|
|
210
790
|
}
|
|
211
791
|
/**
|
|
212
792
|
* @param {Uint8Array} key
|
|
213
|
-
* @param {number | null} [rounds]
|
|
214
793
|
* @returns {AeadCipher}
|
|
215
794
|
*/
|
|
216
|
-
static
|
|
795
|
+
static new_anubis_gcm(key) {
|
|
217
796
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
218
797
|
const len0 = WASM_VECTOR_LEN;
|
|
219
|
-
const ret = wasm.
|
|
798
|
+
const ret = wasm.aeadcipher_new_anubis_gcm(ptr0, len0);
|
|
220
799
|
if (ret[2]) {
|
|
221
800
|
throw takeFromExternrefTable0(ret[1]);
|
|
222
801
|
}
|
|
@@ -226,13 +805,12 @@ export class AeadCipher {
|
|
|
226
805
|
* @param {Uint8Array} key
|
|
227
806
|
* @param {number} tag_size
|
|
228
807
|
* @param {number} nonce_size
|
|
229
|
-
* @param {number | null} [rounds]
|
|
230
808
|
* @returns {AeadCipher}
|
|
231
809
|
*/
|
|
232
|
-
static
|
|
810
|
+
static new_anubis_ocb3(key, tag_size, nonce_size) {
|
|
233
811
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
234
812
|
const len0 = WASM_VECTOR_LEN;
|
|
235
|
-
const ret = wasm.
|
|
813
|
+
const ret = wasm.aeadcipher_new_anubis_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
236
814
|
if (ret[2]) {
|
|
237
815
|
throw takeFromExternrefTable0(ret[1]);
|
|
238
816
|
}
|
|
@@ -245,10 +823,10 @@ export class AeadCipher {
|
|
|
245
823
|
* @param {number | null} [rounds]
|
|
246
824
|
* @returns {AeadCipher}
|
|
247
825
|
*/
|
|
248
|
-
static
|
|
826
|
+
static new_camellia_eax(key, tag_size, nonce_size, rounds) {
|
|
249
827
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
250
828
|
const len0 = WASM_VECTOR_LEN;
|
|
251
|
-
const ret = wasm.
|
|
829
|
+
const ret = wasm.aeadcipher_new_camellia_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
252
830
|
if (ret[2]) {
|
|
253
831
|
throw takeFromExternrefTable0(ret[1]);
|
|
254
832
|
}
|
|
@@ -259,10 +837,10 @@ export class AeadCipher {
|
|
|
259
837
|
* @param {number | null} [rounds]
|
|
260
838
|
* @returns {AeadCipher}
|
|
261
839
|
*/
|
|
262
|
-
static
|
|
840
|
+
static new_multi2_gcm(key, rounds) {
|
|
263
841
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
264
842
|
const len0 = WASM_VECTOR_LEN;
|
|
265
|
-
const ret = wasm.
|
|
843
|
+
const ret = wasm.aeadcipher_new_multi2_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
266
844
|
if (ret[2]) {
|
|
267
845
|
throw takeFromExternrefTable0(ret[1]);
|
|
268
846
|
}
|
|
@@ -272,12 +850,13 @@ export class AeadCipher {
|
|
|
272
850
|
* @param {Uint8Array} key
|
|
273
851
|
* @param {number} tag_size
|
|
274
852
|
* @param {number} nonce_size
|
|
853
|
+
* @param {number | null} [rounds]
|
|
275
854
|
* @returns {AeadCipher}
|
|
276
855
|
*/
|
|
277
|
-
static
|
|
856
|
+
static new_multi2_ccm(key, tag_size, nonce_size, rounds) {
|
|
278
857
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
279
858
|
const len0 = WASM_VECTOR_LEN;
|
|
280
|
-
const ret = wasm.
|
|
859
|
+
const ret = wasm.aeadcipher_new_multi2_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
281
860
|
if (ret[2]) {
|
|
282
861
|
throw takeFromExternrefTable0(ret[1]);
|
|
283
862
|
}
|
|
@@ -287,12 +866,13 @@ export class AeadCipher {
|
|
|
287
866
|
* @param {Uint8Array} key
|
|
288
867
|
* @param {number} tag_size
|
|
289
868
|
* @param {number} nonce_size
|
|
869
|
+
* @param {number | null} [rounds]
|
|
290
870
|
* @returns {AeadCipher}
|
|
291
871
|
*/
|
|
292
|
-
static
|
|
872
|
+
static new_multi2_eax(key, tag_size, nonce_size, rounds) {
|
|
293
873
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
294
874
|
const len0 = WASM_VECTOR_LEN;
|
|
295
|
-
const ret = wasm.
|
|
875
|
+
const ret = wasm.aeadcipher_new_multi2_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
296
876
|
if (ret[2]) {
|
|
297
877
|
throw takeFromExternrefTable0(ret[1]);
|
|
298
878
|
}
|
|
@@ -302,10 +882,10 @@ export class AeadCipher {
|
|
|
302
882
|
* @param {Uint8Array} key
|
|
303
883
|
* @returns {AeadCipher}
|
|
304
884
|
*/
|
|
305
|
-
static
|
|
885
|
+
static new_chacha20_poly1305(key) {
|
|
306
886
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
307
887
|
const len0 = WASM_VECTOR_LEN;
|
|
308
|
-
const ret = wasm.
|
|
888
|
+
const ret = wasm.aeadcipher_new_chacha20_poly1305(ptr0, len0);
|
|
309
889
|
if (ret[2]) {
|
|
310
890
|
throw takeFromExternrefTable0(ret[1]);
|
|
311
891
|
}
|
|
@@ -313,14 +893,12 @@ export class AeadCipher {
|
|
|
313
893
|
}
|
|
314
894
|
/**
|
|
315
895
|
* @param {Uint8Array} key
|
|
316
|
-
* @param {number} tag_size
|
|
317
|
-
* @param {number} nonce_size
|
|
318
896
|
* @returns {AeadCipher}
|
|
319
897
|
*/
|
|
320
|
-
static
|
|
898
|
+
static new_xchacha20_poly1305(key) {
|
|
321
899
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
322
900
|
const len0 = WASM_VECTOR_LEN;
|
|
323
|
-
const ret = wasm.
|
|
901
|
+
const ret = wasm.aeadcipher_new_xchacha20_poly1305(ptr0, len0);
|
|
324
902
|
if (ret[2]) {
|
|
325
903
|
throw takeFromExternrefTable0(ret[1]);
|
|
326
904
|
}
|
|
@@ -328,14 +906,12 @@ export class AeadCipher {
|
|
|
328
906
|
}
|
|
329
907
|
/**
|
|
330
908
|
* @param {Uint8Array} key
|
|
331
|
-
* @param {number} tag_size
|
|
332
|
-
* @param {number} nonce_size
|
|
333
909
|
* @returns {AeadCipher}
|
|
334
910
|
*/
|
|
335
|
-
static
|
|
911
|
+
static new_aes_gcm_siv(key) {
|
|
336
912
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
337
913
|
const len0 = WASM_VECTOR_LEN;
|
|
338
|
-
const ret = wasm.
|
|
914
|
+
const ret = wasm.aeadcipher_new_aes_gcm_siv(ptr0, len0);
|
|
339
915
|
if (ret[2]) {
|
|
340
916
|
throw takeFromExternrefTable0(ret[1]);
|
|
341
917
|
}
|
|
@@ -345,10 +921,10 @@ export class AeadCipher {
|
|
|
345
921
|
* @param {Uint8Array} key
|
|
346
922
|
* @returns {AeadCipher}
|
|
347
923
|
*/
|
|
348
|
-
static
|
|
924
|
+
static new_ascon_aead128(key) {
|
|
349
925
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
350
926
|
const len0 = WASM_VECTOR_LEN;
|
|
351
|
-
const ret = wasm.
|
|
927
|
+
const ret = wasm.aeadcipher_new_ascon_aead128(ptr0, len0);
|
|
352
928
|
if (ret[2]) {
|
|
353
929
|
throw takeFromExternrefTable0(ret[1]);
|
|
354
930
|
}
|
|
@@ -356,29 +932,82 @@ export class AeadCipher {
|
|
|
356
932
|
}
|
|
357
933
|
/**
|
|
358
934
|
* @param {Uint8Array} key
|
|
359
|
-
* @param {number} tag_size
|
|
360
|
-
* @param {number} nonce_size
|
|
361
935
|
* @returns {AeadCipher}
|
|
362
936
|
*/
|
|
363
|
-
static
|
|
937
|
+
static new_aes_siv(key) {
|
|
364
938
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
365
939
|
const len0 = WASM_VECTOR_LEN;
|
|
366
|
-
const ret = wasm.
|
|
940
|
+
const ret = wasm.aeadcipher_new_aes_siv(ptr0, len0);
|
|
367
941
|
if (ret[2]) {
|
|
368
942
|
throw takeFromExternrefTable0(ret[1]);
|
|
369
943
|
}
|
|
370
944
|
return AeadCipher.__wrap(ret[0]);
|
|
371
945
|
}
|
|
946
|
+
/**
|
|
947
|
+
* @returns {number}
|
|
948
|
+
*/
|
|
949
|
+
nonce_size() {
|
|
950
|
+
const ret = wasm.aeadcipher_nonce_size(this.__wbg_ptr);
|
|
951
|
+
return ret >>> 0;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* @param {Uint8Array} data
|
|
955
|
+
* @param {Uint8Array} tag
|
|
956
|
+
* @param {Uint8Array} nonce
|
|
957
|
+
* @param {Uint8Array} aad
|
|
958
|
+
*/
|
|
959
|
+
open_in_place_separate_tag(data, tag, nonce, aad) {
|
|
960
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
961
|
+
var len0 = WASM_VECTOR_LEN;
|
|
962
|
+
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
|
|
963
|
+
const len1 = WASM_VECTOR_LEN;
|
|
964
|
+
const ptr2 = passArray8ToWasm0(nonce, wasm.__wbindgen_malloc);
|
|
965
|
+
const len2 = WASM_VECTOR_LEN;
|
|
966
|
+
const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
|
|
967
|
+
const len3 = WASM_VECTOR_LEN;
|
|
968
|
+
const ret = wasm.aeadcipher_open_in_place_separate_tag(this.__wbg_ptr, ptr0, len0, data, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
969
|
+
if (ret[1]) {
|
|
970
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* @param {Uint8Array} data
|
|
975
|
+
* @param {Uint8Array} nonce
|
|
976
|
+
* @param {Uint8Array} aad
|
|
977
|
+
* @returns {Uint8Array}
|
|
978
|
+
*/
|
|
979
|
+
seal_in_place_separate_tag(data, nonce, aad) {
|
|
980
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
981
|
+
var len0 = WASM_VECTOR_LEN;
|
|
982
|
+
const ptr1 = passArray8ToWasm0(nonce, wasm.__wbindgen_malloc);
|
|
983
|
+
const len1 = WASM_VECTOR_LEN;
|
|
984
|
+
const ptr2 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
|
|
985
|
+
const len2 = WASM_VECTOR_LEN;
|
|
986
|
+
const ret = wasm.aeadcipher_seal_in_place_separate_tag(this.__wbg_ptr, ptr0, len0, data, ptr1, len1, ptr2, len2);
|
|
987
|
+
if (ret[3]) {
|
|
988
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
989
|
+
}
|
|
990
|
+
var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
991
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
992
|
+
return v4;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* @returns {number}
|
|
996
|
+
*/
|
|
997
|
+
tag_size() {
|
|
998
|
+
const ret = wasm.aeadcipher_tag_size(this.__wbg_ptr);
|
|
999
|
+
return ret >>> 0;
|
|
1000
|
+
}
|
|
372
1001
|
/**
|
|
373
1002
|
* @param {Uint8Array} key
|
|
374
1003
|
* @param {number} tag_size
|
|
375
1004
|
* @param {number} nonce_size
|
|
376
1005
|
* @returns {AeadCipher}
|
|
377
1006
|
*/
|
|
378
|
-
static
|
|
1007
|
+
static new_anubis_ccm(key, tag_size, nonce_size) {
|
|
379
1008
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
380
1009
|
const len0 = WASM_VECTOR_LEN;
|
|
381
|
-
const ret = wasm.
|
|
1010
|
+
const ret = wasm.aeadcipher_new_anubis_ccm(ptr0, len0, tag_size, nonce_size);
|
|
382
1011
|
if (ret[2]) {
|
|
383
1012
|
throw takeFromExternrefTable0(ret[1]);
|
|
384
1013
|
}
|
|
@@ -386,12 +1015,14 @@ export class AeadCipher {
|
|
|
386
1015
|
}
|
|
387
1016
|
/**
|
|
388
1017
|
* @param {Uint8Array} key
|
|
1018
|
+
* @param {number} tag_size
|
|
1019
|
+
* @param {number} nonce_size
|
|
389
1020
|
* @returns {AeadCipher}
|
|
390
1021
|
*/
|
|
391
|
-
static
|
|
1022
|
+
static new_anubis_eax(key, tag_size, nonce_size) {
|
|
392
1023
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
393
1024
|
const len0 = WASM_VECTOR_LEN;
|
|
394
|
-
const ret = wasm.
|
|
1025
|
+
const ret = wasm.aeadcipher_new_anubis_eax(ptr0, len0, tag_size, nonce_size);
|
|
395
1026
|
if (ret[2]) {
|
|
396
1027
|
throw takeFromExternrefTable0(ret[1]);
|
|
397
1028
|
}
|
|
@@ -399,14 +1030,12 @@ export class AeadCipher {
|
|
|
399
1030
|
}
|
|
400
1031
|
/**
|
|
401
1032
|
* @param {Uint8Array} key
|
|
402
|
-
* @param {number} tag_size
|
|
403
|
-
* @param {number} nonce_size
|
|
404
1033
|
* @returns {AeadCipher}
|
|
405
1034
|
*/
|
|
406
|
-
static
|
|
1035
|
+
static new_noekeon_gcm(key) {
|
|
407
1036
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
408
1037
|
const len0 = WASM_VECTOR_LEN;
|
|
409
|
-
const ret = wasm.
|
|
1038
|
+
const ret = wasm.aeadcipher_new_noekeon_gcm(ptr0, len0);
|
|
410
1039
|
if (ret[2]) {
|
|
411
1040
|
throw takeFromExternrefTable0(ret[1]);
|
|
412
1041
|
}
|
|
@@ -418,10 +1047,10 @@ export class AeadCipher {
|
|
|
418
1047
|
* @param {number} nonce_size
|
|
419
1048
|
* @returns {AeadCipher}
|
|
420
1049
|
*/
|
|
421
|
-
static
|
|
1050
|
+
static new_noekeon_ocb3(key, tag_size, nonce_size) {
|
|
422
1051
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
423
1052
|
const len0 = WASM_VECTOR_LEN;
|
|
424
|
-
const ret = wasm.
|
|
1053
|
+
const ret = wasm.aeadcipher_new_noekeon_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
425
1054
|
if (ret[2]) {
|
|
426
1055
|
throw takeFromExternrefTable0(ret[1]);
|
|
427
1056
|
}
|
|
@@ -433,10 +1062,10 @@ export class AeadCipher {
|
|
|
433
1062
|
* @param {number} nonce_size
|
|
434
1063
|
* @returns {AeadCipher}
|
|
435
1064
|
*/
|
|
436
|
-
static
|
|
1065
|
+
static new_noekeon_ccm(key, tag_size, nonce_size) {
|
|
437
1066
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
438
1067
|
const len0 = WASM_VECTOR_LEN;
|
|
439
|
-
const ret = wasm.
|
|
1068
|
+
const ret = wasm.aeadcipher_new_noekeon_ccm(ptr0, len0, tag_size, nonce_size);
|
|
440
1069
|
if (ret[2]) {
|
|
441
1070
|
throw takeFromExternrefTable0(ret[1]);
|
|
442
1071
|
}
|
|
@@ -444,12 +1073,27 @@ export class AeadCipher {
|
|
|
444
1073
|
}
|
|
445
1074
|
/**
|
|
446
1075
|
* @param {Uint8Array} key
|
|
1076
|
+
* @param {number} tag_size
|
|
1077
|
+
* @param {number} nonce_size
|
|
447
1078
|
* @returns {AeadCipher}
|
|
448
1079
|
*/
|
|
449
|
-
static
|
|
1080
|
+
static new_noekeon_eax(key, tag_size, nonce_size) {
|
|
450
1081
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
451
1082
|
const len0 = WASM_VECTOR_LEN;
|
|
452
|
-
const ret = wasm.
|
|
1083
|
+
const ret = wasm.aeadcipher_new_noekeon_eax(ptr0, len0, tag_size, nonce_size);
|
|
1084
|
+
if (ret[2]) {
|
|
1085
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1086
|
+
}
|
|
1087
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* @param {Uint8Array} key
|
|
1091
|
+
* @returns {AeadCipher}
|
|
1092
|
+
*/
|
|
1093
|
+
static new_khazad_gcm(key) {
|
|
1094
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1095
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1096
|
+
const ret = wasm.aeadcipher_new_khazad_gcm(ptr0, len0);
|
|
453
1097
|
if (ret[2]) {
|
|
454
1098
|
throw takeFromExternrefTable0(ret[1]);
|
|
455
1099
|
}
|
|
@@ -461,10 +1105,10 @@ export class AeadCipher {
|
|
|
461
1105
|
* @param {number} nonce_size
|
|
462
1106
|
* @returns {AeadCipher}
|
|
463
1107
|
*/
|
|
464
|
-
static
|
|
1108
|
+
static new_khazad_ocb3(key, tag_size, nonce_size) {
|
|
465
1109
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
466
1110
|
const len0 = WASM_VECTOR_LEN;
|
|
467
|
-
const ret = wasm.
|
|
1111
|
+
const ret = wasm.aeadcipher_new_khazad_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
468
1112
|
if (ret[2]) {
|
|
469
1113
|
throw takeFromExternrefTable0(ret[1]);
|
|
470
1114
|
}
|
|
@@ -476,10 +1120,10 @@ export class AeadCipher {
|
|
|
476
1120
|
* @param {number} nonce_size
|
|
477
1121
|
* @returns {AeadCipher}
|
|
478
1122
|
*/
|
|
479
|
-
static
|
|
1123
|
+
static new_khazad_ccm(key, tag_size, nonce_size) {
|
|
480
1124
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
481
1125
|
const len0 = WASM_VECTOR_LEN;
|
|
482
|
-
const ret = wasm.
|
|
1126
|
+
const ret = wasm.aeadcipher_new_khazad_ccm(ptr0, len0, tag_size, nonce_size);
|
|
483
1127
|
if (ret[2]) {
|
|
484
1128
|
throw takeFromExternrefTable0(ret[1]);
|
|
485
1129
|
}
|
|
@@ -491,10 +1135,10 @@ export class AeadCipher {
|
|
|
491
1135
|
* @param {number} nonce_size
|
|
492
1136
|
* @returns {AeadCipher}
|
|
493
1137
|
*/
|
|
494
|
-
static
|
|
1138
|
+
static new_khazad_eax(key, tag_size, nonce_size) {
|
|
495
1139
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
496
1140
|
const len0 = WASM_VECTOR_LEN;
|
|
497
|
-
const ret = wasm.
|
|
1141
|
+
const ret = wasm.aeadcipher_new_khazad_eax(ptr0, len0, tag_size, nonce_size);
|
|
498
1142
|
if (ret[2]) {
|
|
499
1143
|
throw takeFromExternrefTable0(ret[1]);
|
|
500
1144
|
}
|
|
@@ -504,10 +1148,10 @@ export class AeadCipher {
|
|
|
504
1148
|
* @param {Uint8Array} key
|
|
505
1149
|
* @returns {AeadCipher}
|
|
506
1150
|
*/
|
|
507
|
-
static
|
|
1151
|
+
static new_serpent_gcm(key) {
|
|
508
1152
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
509
1153
|
const len0 = WASM_VECTOR_LEN;
|
|
510
|
-
const ret = wasm.
|
|
1154
|
+
const ret = wasm.aeadcipher_new_serpent_gcm(ptr0, len0);
|
|
511
1155
|
if (ret[2]) {
|
|
512
1156
|
throw takeFromExternrefTable0(ret[1]);
|
|
513
1157
|
}
|
|
@@ -519,10 +1163,10 @@ export class AeadCipher {
|
|
|
519
1163
|
* @param {number} nonce_size
|
|
520
1164
|
* @returns {AeadCipher}
|
|
521
1165
|
*/
|
|
522
|
-
static
|
|
1166
|
+
static new_serpent_ocb3(key, tag_size, nonce_size) {
|
|
523
1167
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
524
1168
|
const len0 = WASM_VECTOR_LEN;
|
|
525
|
-
const ret = wasm.
|
|
1169
|
+
const ret = wasm.aeadcipher_new_serpent_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
526
1170
|
if (ret[2]) {
|
|
527
1171
|
throw takeFromExternrefTable0(ret[1]);
|
|
528
1172
|
}
|
|
@@ -534,10 +1178,10 @@ export class AeadCipher {
|
|
|
534
1178
|
* @param {number} nonce_size
|
|
535
1179
|
* @returns {AeadCipher}
|
|
536
1180
|
*/
|
|
537
|
-
static
|
|
1181
|
+
static new_serpent_ccm(key, tag_size, nonce_size) {
|
|
538
1182
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
539
1183
|
const len0 = WASM_VECTOR_LEN;
|
|
540
|
-
const ret = wasm.
|
|
1184
|
+
const ret = wasm.aeadcipher_new_serpent_ccm(ptr0, len0, tag_size, nonce_size);
|
|
541
1185
|
if (ret[2]) {
|
|
542
1186
|
throw takeFromExternrefTable0(ret[1]);
|
|
543
1187
|
}
|
|
@@ -549,10 +1193,10 @@ export class AeadCipher {
|
|
|
549
1193
|
* @param {number} nonce_size
|
|
550
1194
|
* @returns {AeadCipher}
|
|
551
1195
|
*/
|
|
552
|
-
static
|
|
1196
|
+
static new_serpent_eax(key, tag_size, nonce_size) {
|
|
553
1197
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
554
1198
|
const len0 = WASM_VECTOR_LEN;
|
|
555
|
-
const ret = wasm.
|
|
1199
|
+
const ret = wasm.aeadcipher_new_serpent_eax(ptr0, len0, tag_size, nonce_size);
|
|
556
1200
|
if (ret[2]) {
|
|
557
1201
|
throw takeFromExternrefTable0(ret[1]);
|
|
558
1202
|
}
|
|
@@ -560,14 +1204,12 @@ export class AeadCipher {
|
|
|
560
1204
|
}
|
|
561
1205
|
/**
|
|
562
1206
|
* @param {Uint8Array} key
|
|
563
|
-
* @param {number} tag_size
|
|
564
|
-
* @param {number} nonce_size
|
|
565
1207
|
* @returns {AeadCipher}
|
|
566
1208
|
*/
|
|
567
|
-
static
|
|
1209
|
+
static new_idea_gcm(key) {
|
|
568
1210
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
569
1211
|
const len0 = WASM_VECTOR_LEN;
|
|
570
|
-
const ret = wasm.
|
|
1212
|
+
const ret = wasm.aeadcipher_new_idea_gcm(ptr0, len0);
|
|
571
1213
|
if (ret[2]) {
|
|
572
1214
|
throw takeFromExternrefTable0(ret[1]);
|
|
573
1215
|
}
|
|
@@ -579,10 +1221,10 @@ export class AeadCipher {
|
|
|
579
1221
|
* @param {number} nonce_size
|
|
580
1222
|
* @returns {AeadCipher}
|
|
581
1223
|
*/
|
|
582
|
-
static
|
|
1224
|
+
static new_idea_ocb3(key, tag_size, nonce_size) {
|
|
583
1225
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
584
1226
|
const len0 = WASM_VECTOR_LEN;
|
|
585
|
-
const ret = wasm.
|
|
1227
|
+
const ret = wasm.aeadcipher_new_idea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
586
1228
|
if (ret[2]) {
|
|
587
1229
|
throw takeFromExternrefTable0(ret[1]);
|
|
588
1230
|
}
|
|
@@ -590,12 +1232,14 @@ export class AeadCipher {
|
|
|
590
1232
|
}
|
|
591
1233
|
/**
|
|
592
1234
|
* @param {Uint8Array} key
|
|
1235
|
+
* @param {number} tag_size
|
|
1236
|
+
* @param {number} nonce_size
|
|
593
1237
|
* @returns {AeadCipher}
|
|
594
1238
|
*/
|
|
595
|
-
static
|
|
1239
|
+
static new_idea_ccm(key, tag_size, nonce_size) {
|
|
596
1240
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
597
1241
|
const len0 = WASM_VECTOR_LEN;
|
|
598
|
-
const ret = wasm.
|
|
1242
|
+
const ret = wasm.aeadcipher_new_idea_ccm(ptr0, len0, tag_size, nonce_size);
|
|
599
1243
|
if (ret[2]) {
|
|
600
1244
|
throw takeFromExternrefTable0(ret[1]);
|
|
601
1245
|
}
|
|
@@ -607,10 +1251,10 @@ export class AeadCipher {
|
|
|
607
1251
|
* @param {number} nonce_size
|
|
608
1252
|
* @returns {AeadCipher}
|
|
609
1253
|
*/
|
|
610
|
-
static
|
|
1254
|
+
static new_idea_eax(key, tag_size, nonce_size) {
|
|
611
1255
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
612
1256
|
const len0 = WASM_VECTOR_LEN;
|
|
613
|
-
const ret = wasm.
|
|
1257
|
+
const ret = wasm.aeadcipher_new_idea_eax(ptr0, len0, tag_size, nonce_size);
|
|
614
1258
|
if (ret[2]) {
|
|
615
1259
|
throw takeFromExternrefTable0(ret[1]);
|
|
616
1260
|
}
|
|
@@ -618,14 +1262,13 @@ export class AeadCipher {
|
|
|
618
1262
|
}
|
|
619
1263
|
/**
|
|
620
1264
|
* @param {Uint8Array} key
|
|
621
|
-
* @param {number}
|
|
622
|
-
* @param {number} nonce_size
|
|
1265
|
+
* @param {number | null} [rounds]
|
|
623
1266
|
* @returns {AeadCipher}
|
|
624
1267
|
*/
|
|
625
|
-
static
|
|
1268
|
+
static new_rc2_gcm(key, rounds) {
|
|
626
1269
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
627
1270
|
const len0 = WASM_VECTOR_LEN;
|
|
628
|
-
const ret = wasm.
|
|
1271
|
+
const ret = wasm.aeadcipher_new_rc2_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
629
1272
|
if (ret[2]) {
|
|
630
1273
|
throw takeFromExternrefTable0(ret[1]);
|
|
631
1274
|
}
|
|
@@ -635,12 +1278,13 @@ export class AeadCipher {
|
|
|
635
1278
|
* @param {Uint8Array} key
|
|
636
1279
|
* @param {number} tag_size
|
|
637
1280
|
* @param {number} nonce_size
|
|
1281
|
+
* @param {number | null} [rounds]
|
|
638
1282
|
* @returns {AeadCipher}
|
|
639
1283
|
*/
|
|
640
|
-
static
|
|
1284
|
+
static new_rc2_ccm(key, tag_size, nonce_size, rounds) {
|
|
641
1285
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
642
1286
|
const len0 = WASM_VECTOR_LEN;
|
|
643
|
-
const ret = wasm.
|
|
1287
|
+
const ret = wasm.aeadcipher_new_rc2_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
644
1288
|
if (ret[2]) {
|
|
645
1289
|
throw takeFromExternrefTable0(ret[1]);
|
|
646
1290
|
}
|
|
@@ -648,12 +1292,15 @@ export class AeadCipher {
|
|
|
648
1292
|
}
|
|
649
1293
|
/**
|
|
650
1294
|
* @param {Uint8Array} key
|
|
1295
|
+
* @param {number} tag_size
|
|
1296
|
+
* @param {number} nonce_size
|
|
1297
|
+
* @param {number | null} [rounds]
|
|
651
1298
|
* @returns {AeadCipher}
|
|
652
1299
|
*/
|
|
653
|
-
static
|
|
1300
|
+
static new_rc2_eax(key, tag_size, nonce_size, rounds) {
|
|
654
1301
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
655
1302
|
const len0 = WASM_VECTOR_LEN;
|
|
656
|
-
const ret = wasm.
|
|
1303
|
+
const ret = wasm.aeadcipher_new_rc2_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
657
1304
|
if (ret[2]) {
|
|
658
1305
|
throw takeFromExternrefTable0(ret[1]);
|
|
659
1306
|
}
|
|
@@ -661,14 +1308,13 @@ export class AeadCipher {
|
|
|
661
1308
|
}
|
|
662
1309
|
/**
|
|
663
1310
|
* @param {Uint8Array} key
|
|
664
|
-
* @param {number}
|
|
665
|
-
* @param {number} nonce_size
|
|
1311
|
+
* @param {number | null} [rounds]
|
|
666
1312
|
* @returns {AeadCipher}
|
|
667
1313
|
*/
|
|
668
|
-
static
|
|
1314
|
+
static new_rc5_gcm(key, rounds) {
|
|
669
1315
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
670
1316
|
const len0 = WASM_VECTOR_LEN;
|
|
671
|
-
const ret = wasm.
|
|
1317
|
+
const ret = wasm.aeadcipher_new_rc5_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
672
1318
|
if (ret[2]) {
|
|
673
1319
|
throw takeFromExternrefTable0(ret[1]);
|
|
674
1320
|
}
|
|
@@ -678,12 +1324,13 @@ export class AeadCipher {
|
|
|
678
1324
|
* @param {Uint8Array} key
|
|
679
1325
|
* @param {number} tag_size
|
|
680
1326
|
* @param {number} nonce_size
|
|
1327
|
+
* @param {number | null} [rounds]
|
|
681
1328
|
* @returns {AeadCipher}
|
|
682
1329
|
*/
|
|
683
|
-
static
|
|
1330
|
+
static new_rc5_ccm(key, tag_size, nonce_size, rounds) {
|
|
684
1331
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
685
1332
|
const len0 = WASM_VECTOR_LEN;
|
|
686
|
-
const ret = wasm.
|
|
1333
|
+
const ret = wasm.aeadcipher_new_rc5_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
687
1334
|
if (ret[2]) {
|
|
688
1335
|
throw takeFromExternrefTable0(ret[1]);
|
|
689
1336
|
}
|
|
@@ -693,12 +1340,13 @@ export class AeadCipher {
|
|
|
693
1340
|
* @param {Uint8Array} key
|
|
694
1341
|
* @param {number} tag_size
|
|
695
1342
|
* @param {number} nonce_size
|
|
1343
|
+
* @param {number | null} [rounds]
|
|
696
1344
|
* @returns {AeadCipher}
|
|
697
1345
|
*/
|
|
698
|
-
static
|
|
1346
|
+
static new_rc5_eax(key, tag_size, nonce_size, rounds) {
|
|
699
1347
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
700
1348
|
const len0 = WASM_VECTOR_LEN;
|
|
701
|
-
const ret = wasm.
|
|
1349
|
+
const ret = wasm.aeadcipher_new_rc5_eax(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
702
1350
|
if (ret[2]) {
|
|
703
1351
|
throw takeFromExternrefTable0(ret[1]);
|
|
704
1352
|
}
|
|
@@ -706,12 +1354,13 @@ export class AeadCipher {
|
|
|
706
1354
|
}
|
|
707
1355
|
/**
|
|
708
1356
|
* @param {Uint8Array} key
|
|
1357
|
+
* @param {number | null} [rounds]
|
|
709
1358
|
* @returns {AeadCipher}
|
|
710
1359
|
*/
|
|
711
|
-
static
|
|
1360
|
+
static new_camellia_gcm(key, rounds) {
|
|
712
1361
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
713
1362
|
const len0 = WASM_VECTOR_LEN;
|
|
714
|
-
const ret = wasm.
|
|
1363
|
+
const ret = wasm.aeadcipher_new_camellia_gcm(ptr0, len0, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
715
1364
|
if (ret[2]) {
|
|
716
1365
|
throw takeFromExternrefTable0(ret[1]);
|
|
717
1366
|
}
|
|
@@ -721,12 +1370,13 @@ export class AeadCipher {
|
|
|
721
1370
|
* @param {Uint8Array} key
|
|
722
1371
|
* @param {number} tag_size
|
|
723
1372
|
* @param {number} nonce_size
|
|
1373
|
+
* @param {number | null} [rounds]
|
|
724
1374
|
* @returns {AeadCipher}
|
|
725
1375
|
*/
|
|
726
|
-
static
|
|
1376
|
+
static new_camellia_ccm(key, tag_size, nonce_size, rounds) {
|
|
727
1377
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
728
1378
|
const len0 = WASM_VECTOR_LEN;
|
|
729
|
-
const ret = wasm.
|
|
1379
|
+
const ret = wasm.aeadcipher_new_camellia_ccm(ptr0, len0, tag_size, nonce_size, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
730
1380
|
if (ret[2]) {
|
|
731
1381
|
throw takeFromExternrefTable0(ret[1]);
|
|
732
1382
|
}
|
|
@@ -738,10 +1388,10 @@ export class AeadCipher {
|
|
|
738
1388
|
* @param {number} nonce_size
|
|
739
1389
|
* @returns {AeadCipher}
|
|
740
1390
|
*/
|
|
741
|
-
static
|
|
1391
|
+
static new_tripledes_ccm(key, tag_size, nonce_size) {
|
|
742
1392
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
743
1393
|
const len0 = WASM_VECTOR_LEN;
|
|
744
|
-
const ret = wasm.
|
|
1394
|
+
const ret = wasm.aeadcipher_new_tripledes_ccm(ptr0, len0, tag_size, nonce_size);
|
|
745
1395
|
if (ret[2]) {
|
|
746
1396
|
throw takeFromExternrefTable0(ret[1]);
|
|
747
1397
|
}
|
|
@@ -753,10 +1403,10 @@ export class AeadCipher {
|
|
|
753
1403
|
* @param {number} nonce_size
|
|
754
1404
|
* @returns {AeadCipher}
|
|
755
1405
|
*/
|
|
756
|
-
static
|
|
1406
|
+
static new_tripledes_eax(key, tag_size, nonce_size) {
|
|
757
1407
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
758
1408
|
const len0 = WASM_VECTOR_LEN;
|
|
759
|
-
const ret = wasm.
|
|
1409
|
+
const ret = wasm.aeadcipher_new_tripledes_eax(ptr0, len0, tag_size, nonce_size);
|
|
760
1410
|
if (ret[2]) {
|
|
761
1411
|
throw takeFromExternrefTable0(ret[1]);
|
|
762
1412
|
}
|
|
@@ -766,10 +1416,10 @@ export class AeadCipher {
|
|
|
766
1416
|
* @param {Uint8Array} key
|
|
767
1417
|
* @returns {AeadCipher}
|
|
768
1418
|
*/
|
|
769
|
-
static
|
|
1419
|
+
static new_tea_gcm(key) {
|
|
770
1420
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
771
1421
|
const len0 = WASM_VECTOR_LEN;
|
|
772
|
-
const ret = wasm.
|
|
1422
|
+
const ret = wasm.aeadcipher_new_tea_gcm(ptr0, len0);
|
|
773
1423
|
if (ret[2]) {
|
|
774
1424
|
throw takeFromExternrefTable0(ret[1]);
|
|
775
1425
|
}
|
|
@@ -781,10 +1431,10 @@ export class AeadCipher {
|
|
|
781
1431
|
* @param {number} nonce_size
|
|
782
1432
|
* @returns {AeadCipher}
|
|
783
1433
|
*/
|
|
784
|
-
static
|
|
1434
|
+
static new_tea_ocb3(key, tag_size, nonce_size) {
|
|
785
1435
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
786
1436
|
const len0 = WASM_VECTOR_LEN;
|
|
787
|
-
const ret = wasm.
|
|
1437
|
+
const ret = wasm.aeadcipher_new_tea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
788
1438
|
if (ret[2]) {
|
|
789
1439
|
throw takeFromExternrefTable0(ret[1]);
|
|
790
1440
|
}
|
|
@@ -796,10 +1446,10 @@ export class AeadCipher {
|
|
|
796
1446
|
* @param {number} nonce_size
|
|
797
1447
|
* @returns {AeadCipher}
|
|
798
1448
|
*/
|
|
799
|
-
static
|
|
1449
|
+
static new_tea_ccm(key, tag_size, nonce_size) {
|
|
800
1450
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
801
1451
|
const len0 = WASM_VECTOR_LEN;
|
|
802
|
-
const ret = wasm.
|
|
1452
|
+
const ret = wasm.aeadcipher_new_tea_ccm(ptr0, len0, tag_size, nonce_size);
|
|
803
1453
|
if (ret[2]) {
|
|
804
1454
|
throw takeFromExternrefTable0(ret[1]);
|
|
805
1455
|
}
|
|
@@ -811,10 +1461,10 @@ export class AeadCipher {
|
|
|
811
1461
|
* @param {number} nonce_size
|
|
812
1462
|
* @returns {AeadCipher}
|
|
813
1463
|
*/
|
|
814
|
-
static
|
|
1464
|
+
static new_tea_eax(key, tag_size, nonce_size) {
|
|
815
1465
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
816
1466
|
const len0 = WASM_VECTOR_LEN;
|
|
817
|
-
const ret = wasm.
|
|
1467
|
+
const ret = wasm.aeadcipher_new_tea_eax(ptr0, len0, tag_size, nonce_size);
|
|
818
1468
|
if (ret[2]) {
|
|
819
1469
|
throw takeFromExternrefTable0(ret[1]);
|
|
820
1470
|
}
|
|
@@ -824,10 +1474,10 @@ export class AeadCipher {
|
|
|
824
1474
|
* @param {Uint8Array} key
|
|
825
1475
|
* @returns {AeadCipher}
|
|
826
1476
|
*/
|
|
827
|
-
static
|
|
1477
|
+
static new_twofish_gcm(key) {
|
|
828
1478
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
829
1479
|
const len0 = WASM_VECTOR_LEN;
|
|
830
|
-
const ret = wasm.
|
|
1480
|
+
const ret = wasm.aeadcipher_new_twofish_gcm(ptr0, len0);
|
|
831
1481
|
if (ret[2]) {
|
|
832
1482
|
throw takeFromExternrefTable0(ret[1]);
|
|
833
1483
|
}
|
|
@@ -839,10 +1489,10 @@ export class AeadCipher {
|
|
|
839
1489
|
* @param {number} nonce_size
|
|
840
1490
|
* @returns {AeadCipher}
|
|
841
1491
|
*/
|
|
842
|
-
static
|
|
1492
|
+
static new_twofish_ocb3(key, tag_size, nonce_size) {
|
|
843
1493
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
844
1494
|
const len0 = WASM_VECTOR_LEN;
|
|
845
|
-
const ret = wasm.
|
|
1495
|
+
const ret = wasm.aeadcipher_new_twofish_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
846
1496
|
if (ret[2]) {
|
|
847
1497
|
throw takeFromExternrefTable0(ret[1]);
|
|
848
1498
|
}
|
|
@@ -854,10 +1504,10 @@ export class AeadCipher {
|
|
|
854
1504
|
* @param {number} nonce_size
|
|
855
1505
|
* @returns {AeadCipher}
|
|
856
1506
|
*/
|
|
857
|
-
static
|
|
1507
|
+
static new_twofish_ccm(key, tag_size, nonce_size) {
|
|
858
1508
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
859
1509
|
const len0 = WASM_VECTOR_LEN;
|
|
860
|
-
const ret = wasm.
|
|
1510
|
+
const ret = wasm.aeadcipher_new_twofish_ccm(ptr0, len0, tag_size, nonce_size);
|
|
861
1511
|
if (ret[2]) {
|
|
862
1512
|
throw takeFromExternrefTable0(ret[1]);
|
|
863
1513
|
}
|
|
@@ -865,12 +1515,14 @@ export class AeadCipher {
|
|
|
865
1515
|
}
|
|
866
1516
|
/**
|
|
867
1517
|
* @param {Uint8Array} key
|
|
1518
|
+
* @param {number} tag_size
|
|
1519
|
+
* @param {number} nonce_size
|
|
868
1520
|
* @returns {AeadCipher}
|
|
869
1521
|
*/
|
|
870
|
-
static
|
|
1522
|
+
static new_twofish_eax(key, tag_size, nonce_size) {
|
|
871
1523
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
872
1524
|
const len0 = WASM_VECTOR_LEN;
|
|
873
|
-
const ret = wasm.
|
|
1525
|
+
const ret = wasm.aeadcipher_new_twofish_eax(ptr0, len0, tag_size, nonce_size);
|
|
874
1526
|
if (ret[2]) {
|
|
875
1527
|
throw takeFromExternrefTable0(ret[1]);
|
|
876
1528
|
}
|
|
@@ -878,14 +1530,12 @@ export class AeadCipher {
|
|
|
878
1530
|
}
|
|
879
1531
|
/**
|
|
880
1532
|
* @param {Uint8Array} key
|
|
881
|
-
* @param {number} tag_size
|
|
882
|
-
* @param {number} nonce_size
|
|
883
1533
|
* @returns {AeadCipher}
|
|
884
1534
|
*/
|
|
885
|
-
static
|
|
1535
|
+
static new_xtea_gcm(key) {
|
|
886
1536
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
887
1537
|
const len0 = WASM_VECTOR_LEN;
|
|
888
|
-
const ret = wasm.
|
|
1538
|
+
const ret = wasm.aeadcipher_new_xtea_gcm(ptr0, len0);
|
|
889
1539
|
if (ret[2]) {
|
|
890
1540
|
throw takeFromExternrefTable0(ret[1]);
|
|
891
1541
|
}
|
|
@@ -895,13 +1545,12 @@ export class AeadCipher {
|
|
|
895
1545
|
* @param {Uint8Array} key
|
|
896
1546
|
* @param {number} tag_size
|
|
897
1547
|
* @param {number} nonce_size
|
|
898
|
-
* @param {number | null} [rounds]
|
|
899
1548
|
* @returns {AeadCipher}
|
|
900
1549
|
*/
|
|
901
|
-
static
|
|
1550
|
+
static new_xtea_ocb3(key, tag_size, nonce_size) {
|
|
902
1551
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
903
1552
|
const len0 = WASM_VECTOR_LEN;
|
|
904
|
-
const ret = wasm.
|
|
1553
|
+
const ret = wasm.aeadcipher_new_xtea_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
905
1554
|
if (ret[2]) {
|
|
906
1555
|
throw takeFromExternrefTable0(ret[1]);
|
|
907
1556
|
}
|
|
@@ -911,13 +1560,12 @@ export class AeadCipher {
|
|
|
911
1560
|
* @param {Uint8Array} key
|
|
912
1561
|
* @param {number} tag_size
|
|
913
1562
|
* @param {number} nonce_size
|
|
914
|
-
* @param {number | null} [rounds]
|
|
915
1563
|
* @returns {AeadCipher}
|
|
916
1564
|
*/
|
|
917
|
-
static
|
|
1565
|
+
static new_xtea_ccm(key, tag_size, nonce_size) {
|
|
918
1566
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
919
1567
|
const len0 = WASM_VECTOR_LEN;
|
|
920
|
-
const ret = wasm.
|
|
1568
|
+
const ret = wasm.aeadcipher_new_xtea_ccm(ptr0, len0, tag_size, nonce_size);
|
|
921
1569
|
if (ret[2]) {
|
|
922
1570
|
throw takeFromExternrefTable0(ret[1]);
|
|
923
1571
|
}
|
|
@@ -925,13 +1573,14 @@ export class AeadCipher {
|
|
|
925
1573
|
}
|
|
926
1574
|
/**
|
|
927
1575
|
* @param {Uint8Array} key
|
|
928
|
-
* @param {number
|
|
1576
|
+
* @param {number} tag_size
|
|
1577
|
+
* @param {number} nonce_size
|
|
929
1578
|
* @returns {AeadCipher}
|
|
930
1579
|
*/
|
|
931
|
-
static
|
|
1580
|
+
static new_xtea_eax(key, tag_size, nonce_size) {
|
|
932
1581
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
933
1582
|
const len0 = WASM_VECTOR_LEN;
|
|
934
|
-
const ret = wasm.
|
|
1583
|
+
const ret = wasm.aeadcipher_new_xtea_eax(ptr0, len0, tag_size, nonce_size);
|
|
935
1584
|
if (ret[2]) {
|
|
936
1585
|
throw takeFromExternrefTable0(ret[1]);
|
|
937
1586
|
}
|
|
@@ -939,14 +1588,12 @@ export class AeadCipher {
|
|
|
939
1588
|
}
|
|
940
1589
|
/**
|
|
941
1590
|
* @param {Uint8Array} key
|
|
942
|
-
* @param {number} tag_size
|
|
943
|
-
* @param {number} nonce_size
|
|
944
1591
|
* @returns {AeadCipher}
|
|
945
1592
|
*/
|
|
946
|
-
static
|
|
1593
|
+
static new_rc6_gcm(key) {
|
|
947
1594
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
948
1595
|
const len0 = WASM_VECTOR_LEN;
|
|
949
|
-
const ret = wasm.
|
|
1596
|
+
const ret = wasm.aeadcipher_new_rc6_gcm(ptr0, len0);
|
|
950
1597
|
if (ret[2]) {
|
|
951
1598
|
throw takeFromExternrefTable0(ret[1]);
|
|
952
1599
|
}
|
|
@@ -958,10 +1605,10 @@ export class AeadCipher {
|
|
|
958
1605
|
* @param {number} nonce_size
|
|
959
1606
|
* @returns {AeadCipher}
|
|
960
1607
|
*/
|
|
961
|
-
static
|
|
1608
|
+
static new_rc6_ocb3(key, tag_size, nonce_size) {
|
|
962
1609
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
963
1610
|
const len0 = WASM_VECTOR_LEN;
|
|
964
|
-
const ret = wasm.
|
|
1611
|
+
const ret = wasm.aeadcipher_new_rc6_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
965
1612
|
if (ret[2]) {
|
|
966
1613
|
throw takeFromExternrefTable0(ret[1]);
|
|
967
1614
|
}
|
|
@@ -973,10 +1620,10 @@ export class AeadCipher {
|
|
|
973
1620
|
* @param {number} nonce_size
|
|
974
1621
|
* @returns {AeadCipher}
|
|
975
1622
|
*/
|
|
976
|
-
static
|
|
1623
|
+
static new_rc6_ccm(key, tag_size, nonce_size) {
|
|
977
1624
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
978
1625
|
const len0 = WASM_VECTOR_LEN;
|
|
979
|
-
const ret = wasm.
|
|
1626
|
+
const ret = wasm.aeadcipher_new_rc6_ccm(ptr0, len0, tag_size, nonce_size);
|
|
980
1627
|
if (ret[2]) {
|
|
981
1628
|
throw takeFromExternrefTable0(ret[1]);
|
|
982
1629
|
}
|
|
@@ -988,10 +1635,10 @@ export class AeadCipher {
|
|
|
988
1635
|
* @param {number} nonce_size
|
|
989
1636
|
* @returns {AeadCipher}
|
|
990
1637
|
*/
|
|
991
|
-
static
|
|
1638
|
+
static new_rc6_eax(key, tag_size, nonce_size) {
|
|
992
1639
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
993
1640
|
const len0 = WASM_VECTOR_LEN;
|
|
994
|
-
const ret = wasm.
|
|
1641
|
+
const ret = wasm.aeadcipher_new_rc6_eax(ptr0, len0, tag_size, nonce_size);
|
|
995
1642
|
if (ret[2]) {
|
|
996
1643
|
throw takeFromExternrefTable0(ret[1]);
|
|
997
1644
|
}
|
|
@@ -999,14 +1646,12 @@ export class AeadCipher {
|
|
|
999
1646
|
}
|
|
1000
1647
|
/**
|
|
1001
1648
|
* @param {Uint8Array} key
|
|
1002
|
-
* @param {number} tag_size
|
|
1003
|
-
* @param {number} nonce_size
|
|
1004
1649
|
* @returns {AeadCipher}
|
|
1005
1650
|
*/
|
|
1006
|
-
static
|
|
1651
|
+
static new_sm4_gcm(key) {
|
|
1007
1652
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1008
1653
|
const len0 = WASM_VECTOR_LEN;
|
|
1009
|
-
const ret = wasm.
|
|
1654
|
+
const ret = wasm.aeadcipher_new_sm4_gcm(ptr0, len0);
|
|
1010
1655
|
if (ret[2]) {
|
|
1011
1656
|
throw takeFromExternrefTable0(ret[1]);
|
|
1012
1657
|
}
|
|
@@ -1014,12 +1659,14 @@ export class AeadCipher {
|
|
|
1014
1659
|
}
|
|
1015
1660
|
/**
|
|
1016
1661
|
* @param {Uint8Array} key
|
|
1662
|
+
* @param {number} tag_size
|
|
1663
|
+
* @param {number} nonce_size
|
|
1017
1664
|
* @returns {AeadCipher}
|
|
1018
1665
|
*/
|
|
1019
|
-
static
|
|
1666
|
+
static new_sm4_ocb3(key, tag_size, nonce_size) {
|
|
1020
1667
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1021
1668
|
const len0 = WASM_VECTOR_LEN;
|
|
1022
|
-
const ret = wasm.
|
|
1669
|
+
const ret = wasm.aeadcipher_new_sm4_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1023
1670
|
if (ret[2]) {
|
|
1024
1671
|
throw takeFromExternrefTable0(ret[1]);
|
|
1025
1672
|
}
|
|
@@ -1031,10 +1678,10 @@ export class AeadCipher {
|
|
|
1031
1678
|
* @param {number} nonce_size
|
|
1032
1679
|
* @returns {AeadCipher}
|
|
1033
1680
|
*/
|
|
1034
|
-
static
|
|
1681
|
+
static new_sm4_ccm(key, tag_size, nonce_size) {
|
|
1035
1682
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1036
1683
|
const len0 = WASM_VECTOR_LEN;
|
|
1037
|
-
const ret = wasm.
|
|
1684
|
+
const ret = wasm.aeadcipher_new_sm4_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1038
1685
|
if (ret[2]) {
|
|
1039
1686
|
throw takeFromExternrefTable0(ret[1]);
|
|
1040
1687
|
}
|
|
@@ -1046,10 +1693,10 @@ export class AeadCipher {
|
|
|
1046
1693
|
* @param {number} nonce_size
|
|
1047
1694
|
* @returns {AeadCipher}
|
|
1048
1695
|
*/
|
|
1049
|
-
static
|
|
1696
|
+
static new_sm4_eax(key, tag_size, nonce_size) {
|
|
1050
1697
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1051
1698
|
const len0 = WASM_VECTOR_LEN;
|
|
1052
|
-
const ret = wasm.
|
|
1699
|
+
const ret = wasm.aeadcipher_new_sm4_eax(ptr0, len0, tag_size, nonce_size);
|
|
1053
1700
|
if (ret[2]) {
|
|
1054
1701
|
throw takeFromExternrefTable0(ret[1]);
|
|
1055
1702
|
}
|
|
@@ -1059,10 +1706,10 @@ export class AeadCipher {
|
|
|
1059
1706
|
* @param {Uint8Array} key
|
|
1060
1707
|
* @returns {AeadCipher}
|
|
1061
1708
|
*/
|
|
1062
|
-
static
|
|
1709
|
+
static new_skipjack_gcm(key) {
|
|
1063
1710
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1064
1711
|
const len0 = WASM_VECTOR_LEN;
|
|
1065
|
-
const ret = wasm.
|
|
1712
|
+
const ret = wasm.aeadcipher_new_skipjack_gcm(ptr0, len0);
|
|
1066
1713
|
if (ret[2]) {
|
|
1067
1714
|
throw takeFromExternrefTable0(ret[1]);
|
|
1068
1715
|
}
|
|
@@ -1074,10 +1721,10 @@ export class AeadCipher {
|
|
|
1074
1721
|
* @param {number} nonce_size
|
|
1075
1722
|
* @returns {AeadCipher}
|
|
1076
1723
|
*/
|
|
1077
|
-
static
|
|
1724
|
+
static new_skipjack_ocb3(key, tag_size, nonce_size) {
|
|
1078
1725
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1079
1726
|
const len0 = WASM_VECTOR_LEN;
|
|
1080
|
-
const ret = wasm.
|
|
1727
|
+
const ret = wasm.aeadcipher_new_skipjack_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1081
1728
|
if (ret[2]) {
|
|
1082
1729
|
throw takeFromExternrefTable0(ret[1]);
|
|
1083
1730
|
}
|
|
@@ -1089,10 +1736,10 @@ export class AeadCipher {
|
|
|
1089
1736
|
* @param {number} nonce_size
|
|
1090
1737
|
* @returns {AeadCipher}
|
|
1091
1738
|
*/
|
|
1092
|
-
static
|
|
1739
|
+
static new_skipjack_ccm(key, tag_size, nonce_size) {
|
|
1093
1740
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1094
1741
|
const len0 = WASM_VECTOR_LEN;
|
|
1095
|
-
const ret = wasm.
|
|
1742
|
+
const ret = wasm.aeadcipher_new_skipjack_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1096
1743
|
if (ret[2]) {
|
|
1097
1744
|
throw takeFromExternrefTable0(ret[1]);
|
|
1098
1745
|
}
|
|
@@ -1100,12 +1747,14 @@ export class AeadCipher {
|
|
|
1100
1747
|
}
|
|
1101
1748
|
/**
|
|
1102
1749
|
* @param {Uint8Array} key
|
|
1750
|
+
* @param {number} tag_size
|
|
1751
|
+
* @param {number} nonce_size
|
|
1103
1752
|
* @returns {AeadCipher}
|
|
1104
1753
|
*/
|
|
1105
|
-
static
|
|
1754
|
+
static new_skipjack_eax(key, tag_size, nonce_size) {
|
|
1106
1755
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1107
1756
|
const len0 = WASM_VECTOR_LEN;
|
|
1108
|
-
const ret = wasm.
|
|
1757
|
+
const ret = wasm.aeadcipher_new_skipjack_eax(ptr0, len0, tag_size, nonce_size);
|
|
1109
1758
|
if (ret[2]) {
|
|
1110
1759
|
throw takeFromExternrefTable0(ret[1]);
|
|
1111
1760
|
}
|
|
@@ -1113,14 +1762,12 @@ export class AeadCipher {
|
|
|
1113
1762
|
}
|
|
1114
1763
|
/**
|
|
1115
1764
|
* @param {Uint8Array} key
|
|
1116
|
-
* @param {number} tag_size
|
|
1117
|
-
* @param {number} nonce_size
|
|
1118
1765
|
* @returns {AeadCipher}
|
|
1119
1766
|
*/
|
|
1120
|
-
static
|
|
1767
|
+
static new_aes_gcm(key) {
|
|
1121
1768
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1122
1769
|
const len0 = WASM_VECTOR_LEN;
|
|
1123
|
-
const ret = wasm.
|
|
1770
|
+
const ret = wasm.aeadcipher_new_aes_gcm(ptr0, len0);
|
|
1124
1771
|
if (ret[2]) {
|
|
1125
1772
|
throw takeFromExternrefTable0(ret[1]);
|
|
1126
1773
|
}
|
|
@@ -1132,10 +1779,10 @@ export class AeadCipher {
|
|
|
1132
1779
|
* @param {number} nonce_size
|
|
1133
1780
|
* @returns {AeadCipher}
|
|
1134
1781
|
*/
|
|
1135
|
-
static
|
|
1782
|
+
static new_aes_ocb3(key, tag_size, nonce_size) {
|
|
1136
1783
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1137
1784
|
const len0 = WASM_VECTOR_LEN;
|
|
1138
|
-
const ret = wasm.
|
|
1785
|
+
const ret = wasm.aeadcipher_new_aes_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1139
1786
|
if (ret[2]) {
|
|
1140
1787
|
throw takeFromExternrefTable0(ret[1]);
|
|
1141
1788
|
}
|
|
@@ -1143,12 +1790,14 @@ export class AeadCipher {
|
|
|
1143
1790
|
}
|
|
1144
1791
|
/**
|
|
1145
1792
|
* @param {Uint8Array} key
|
|
1793
|
+
* @param {number} tag_size
|
|
1794
|
+
* @param {number} nonce_size
|
|
1146
1795
|
* @returns {AeadCipher}
|
|
1147
1796
|
*/
|
|
1148
|
-
static
|
|
1797
|
+
static new_aes_ccm(key, tag_size, nonce_size) {
|
|
1149
1798
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1150
1799
|
const len0 = WASM_VECTOR_LEN;
|
|
1151
|
-
const ret = wasm.
|
|
1800
|
+
const ret = wasm.aeadcipher_new_aes_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1152
1801
|
if (ret[2]) {
|
|
1153
1802
|
throw takeFromExternrefTable0(ret[1]);
|
|
1154
1803
|
}
|
|
@@ -1158,13 +1807,12 @@ export class AeadCipher {
|
|
|
1158
1807
|
* @param {Uint8Array} key
|
|
1159
1808
|
* @param {number} tag_size
|
|
1160
1809
|
* @param {number} nonce_size
|
|
1161
|
-
* @param {number | null} [rounds]
|
|
1162
1810
|
* @returns {AeadCipher}
|
|
1163
1811
|
*/
|
|
1164
|
-
static
|
|
1812
|
+
static new_aes_eax(key, tag_size, nonce_size) {
|
|
1165
1813
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1166
1814
|
const len0 = WASM_VECTOR_LEN;
|
|
1167
|
-
const ret = wasm.
|
|
1815
|
+
const ret = wasm.aeadcipher_new_aes_eax(ptr0, len0, tag_size, nonce_size);
|
|
1168
1816
|
if (ret[2]) {
|
|
1169
1817
|
throw takeFromExternrefTable0(ret[1]);
|
|
1170
1818
|
}
|
|
@@ -1172,15 +1820,12 @@ export class AeadCipher {
|
|
|
1172
1820
|
}
|
|
1173
1821
|
/**
|
|
1174
1822
|
* @param {Uint8Array} key
|
|
1175
|
-
* @param {number} tag_size
|
|
1176
|
-
* @param {number} nonce_size
|
|
1177
|
-
* @param {number | null} [rounds]
|
|
1178
1823
|
* @returns {AeadCipher}
|
|
1179
1824
|
*/
|
|
1180
|
-
static
|
|
1825
|
+
static new_aria_gcm(key) {
|
|
1181
1826
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1182
1827
|
const len0 = WASM_VECTOR_LEN;
|
|
1183
|
-
const ret = wasm.
|
|
1828
|
+
const ret = wasm.aeadcipher_new_aria_gcm(ptr0, len0);
|
|
1184
1829
|
if (ret[2]) {
|
|
1185
1830
|
throw takeFromExternrefTable0(ret[1]);
|
|
1186
1831
|
}
|
|
@@ -1188,13 +1833,14 @@ export class AeadCipher {
|
|
|
1188
1833
|
}
|
|
1189
1834
|
/**
|
|
1190
1835
|
* @param {Uint8Array} key
|
|
1191
|
-
* @param {number
|
|
1836
|
+
* @param {number} tag_size
|
|
1837
|
+
* @param {number} nonce_size
|
|
1192
1838
|
* @returns {AeadCipher}
|
|
1193
1839
|
*/
|
|
1194
|
-
static
|
|
1840
|
+
static new_aria_ocb3(key, tag_size, nonce_size) {
|
|
1195
1841
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1196
1842
|
const len0 = WASM_VECTOR_LEN;
|
|
1197
|
-
const ret = wasm.
|
|
1843
|
+
const ret = wasm.aeadcipher_new_aria_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1198
1844
|
if (ret[2]) {
|
|
1199
1845
|
throw takeFromExternrefTable0(ret[1]);
|
|
1200
1846
|
}
|
|
@@ -1206,10 +1852,10 @@ export class AeadCipher {
|
|
|
1206
1852
|
* @param {number} nonce_size
|
|
1207
1853
|
* @returns {AeadCipher}
|
|
1208
1854
|
*/
|
|
1209
|
-
static
|
|
1855
|
+
static new_aria_ccm(key, tag_size, nonce_size) {
|
|
1210
1856
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1211
1857
|
const len0 = WASM_VECTOR_LEN;
|
|
1212
|
-
const ret = wasm.
|
|
1858
|
+
const ret = wasm.aeadcipher_new_aria_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1213
1859
|
if (ret[2]) {
|
|
1214
1860
|
throw takeFromExternrefTable0(ret[1]);
|
|
1215
1861
|
}
|
|
@@ -1221,10 +1867,10 @@ export class AeadCipher {
|
|
|
1221
1867
|
* @param {number} nonce_size
|
|
1222
1868
|
* @returns {AeadCipher}
|
|
1223
1869
|
*/
|
|
1224
|
-
static
|
|
1870
|
+
static new_aria_eax(key, tag_size, nonce_size) {
|
|
1225
1871
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1226
1872
|
const len0 = WASM_VECTOR_LEN;
|
|
1227
|
-
const ret = wasm.
|
|
1873
|
+
const ret = wasm.aeadcipher_new_aria_eax(ptr0, len0, tag_size, nonce_size);
|
|
1228
1874
|
if (ret[2]) {
|
|
1229
1875
|
throw takeFromExternrefTable0(ret[1]);
|
|
1230
1876
|
}
|
|
@@ -1232,14 +1878,12 @@ export class AeadCipher {
|
|
|
1232
1878
|
}
|
|
1233
1879
|
/**
|
|
1234
1880
|
* @param {Uint8Array} key
|
|
1235
|
-
* @param {number} tag_size
|
|
1236
|
-
* @param {number} nonce_size
|
|
1237
1881
|
* @returns {AeadCipher}
|
|
1238
1882
|
*/
|
|
1239
|
-
static
|
|
1883
|
+
static new_blowfish_gcm(key) {
|
|
1240
1884
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1241
1885
|
const len0 = WASM_VECTOR_LEN;
|
|
1242
|
-
const ret = wasm.
|
|
1886
|
+
const ret = wasm.aeadcipher_new_blowfish_gcm(ptr0, len0);
|
|
1243
1887
|
if (ret[2]) {
|
|
1244
1888
|
throw takeFromExternrefTable0(ret[1]);
|
|
1245
1889
|
}
|
|
@@ -1251,10 +1895,10 @@ export class AeadCipher {
|
|
|
1251
1895
|
* @param {number} nonce_size
|
|
1252
1896
|
* @returns {AeadCipher}
|
|
1253
1897
|
*/
|
|
1254
|
-
static
|
|
1898
|
+
static new_blowfish_ocb3(key, tag_size, nonce_size) {
|
|
1255
1899
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1256
1900
|
const len0 = WASM_VECTOR_LEN;
|
|
1257
|
-
const ret = wasm.
|
|
1901
|
+
const ret = wasm.aeadcipher_new_blowfish_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1258
1902
|
if (ret[2]) {
|
|
1259
1903
|
throw takeFromExternrefTable0(ret[1]);
|
|
1260
1904
|
}
|
|
@@ -1262,12 +1906,14 @@ export class AeadCipher {
|
|
|
1262
1906
|
}
|
|
1263
1907
|
/**
|
|
1264
1908
|
* @param {Uint8Array} key
|
|
1909
|
+
* @param {number} tag_size
|
|
1910
|
+
* @param {number} nonce_size
|
|
1265
1911
|
* @returns {AeadCipher}
|
|
1266
1912
|
*/
|
|
1267
|
-
static
|
|
1913
|
+
static new_blowfish_ccm(key, tag_size, nonce_size) {
|
|
1268
1914
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1269
1915
|
const len0 = WASM_VECTOR_LEN;
|
|
1270
|
-
const ret = wasm.
|
|
1916
|
+
const ret = wasm.aeadcipher_new_blowfish_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1271
1917
|
if (ret[2]) {
|
|
1272
1918
|
throw takeFromExternrefTable0(ret[1]);
|
|
1273
1919
|
}
|
|
@@ -1279,10 +1925,10 @@ export class AeadCipher {
|
|
|
1279
1925
|
* @param {number} nonce_size
|
|
1280
1926
|
* @returns {AeadCipher}
|
|
1281
1927
|
*/
|
|
1282
|
-
static
|
|
1928
|
+
static new_blowfish_eax(key, tag_size, nonce_size) {
|
|
1283
1929
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1284
1930
|
const len0 = WASM_VECTOR_LEN;
|
|
1285
|
-
const ret = wasm.
|
|
1931
|
+
const ret = wasm.aeadcipher_new_blowfish_eax(ptr0, len0, tag_size, nonce_size);
|
|
1286
1932
|
if (ret[2]) {
|
|
1287
1933
|
throw takeFromExternrefTable0(ret[1]);
|
|
1288
1934
|
}
|
|
@@ -1290,14 +1936,12 @@ export class AeadCipher {
|
|
|
1290
1936
|
}
|
|
1291
1937
|
/**
|
|
1292
1938
|
* @param {Uint8Array} key
|
|
1293
|
-
* @param {number} tag_size
|
|
1294
|
-
* @param {number} nonce_size
|
|
1295
1939
|
* @returns {AeadCipher}
|
|
1296
1940
|
*/
|
|
1297
|
-
static
|
|
1941
|
+
static new_cast5_gcm(key) {
|
|
1298
1942
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1299
1943
|
const len0 = WASM_VECTOR_LEN;
|
|
1300
|
-
const ret = wasm.
|
|
1944
|
+
const ret = wasm.aeadcipher_new_cast5_gcm(ptr0, len0);
|
|
1301
1945
|
if (ret[2]) {
|
|
1302
1946
|
throw takeFromExternrefTable0(ret[1]);
|
|
1303
1947
|
}
|
|
@@ -1309,10 +1953,10 @@ export class AeadCipher {
|
|
|
1309
1953
|
* @param {number} nonce_size
|
|
1310
1954
|
* @returns {AeadCipher}
|
|
1311
1955
|
*/
|
|
1312
|
-
static
|
|
1956
|
+
static new_cast5_ocb3(key, tag_size, nonce_size) {
|
|
1313
1957
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1314
1958
|
const len0 = WASM_VECTOR_LEN;
|
|
1315
|
-
const ret = wasm.
|
|
1959
|
+
const ret = wasm.aeadcipher_new_cast5_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1316
1960
|
if (ret[2]) {
|
|
1317
1961
|
throw takeFromExternrefTable0(ret[1]);
|
|
1318
1962
|
}
|
|
@@ -1324,10 +1968,10 @@ export class AeadCipher {
|
|
|
1324
1968
|
* @param {number} nonce_size
|
|
1325
1969
|
* @returns {AeadCipher}
|
|
1326
1970
|
*/
|
|
1327
|
-
static
|
|
1971
|
+
static new_cast5_ccm(key, tag_size, nonce_size) {
|
|
1328
1972
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1329
1973
|
const len0 = WASM_VECTOR_LEN;
|
|
1330
|
-
const ret = wasm.
|
|
1974
|
+
const ret = wasm.aeadcipher_new_cast5_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1331
1975
|
if (ret[2]) {
|
|
1332
1976
|
throw takeFromExternrefTable0(ret[1]);
|
|
1333
1977
|
}
|
|
@@ -1339,10 +1983,10 @@ export class AeadCipher {
|
|
|
1339
1983
|
* @param {number} nonce_size
|
|
1340
1984
|
* @returns {AeadCipher}
|
|
1341
1985
|
*/
|
|
1342
|
-
static
|
|
1986
|
+
static new_cast5_eax(key, tag_size, nonce_size) {
|
|
1343
1987
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1344
1988
|
const len0 = WASM_VECTOR_LEN;
|
|
1345
|
-
const ret = wasm.
|
|
1989
|
+
const ret = wasm.aeadcipher_new_cast5_eax(ptr0, len0, tag_size, nonce_size);
|
|
1346
1990
|
if (ret[2]) {
|
|
1347
1991
|
throw takeFromExternrefTable0(ret[1]);
|
|
1348
1992
|
}
|
|
@@ -1352,10 +1996,10 @@ export class AeadCipher {
|
|
|
1352
1996
|
* @param {Uint8Array} key
|
|
1353
1997
|
* @returns {AeadCipher}
|
|
1354
1998
|
*/
|
|
1355
|
-
static
|
|
1999
|
+
static new_des_gcm(key) {
|
|
1356
2000
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1357
2001
|
const len0 = WASM_VECTOR_LEN;
|
|
1358
|
-
const ret = wasm.
|
|
2002
|
+
const ret = wasm.aeadcipher_new_des_gcm(ptr0, len0);
|
|
1359
2003
|
if (ret[2]) {
|
|
1360
2004
|
throw takeFromExternrefTable0(ret[1]);
|
|
1361
2005
|
}
|
|
@@ -1367,10 +2011,10 @@ export class AeadCipher {
|
|
|
1367
2011
|
* @param {number} nonce_size
|
|
1368
2012
|
* @returns {AeadCipher}
|
|
1369
2013
|
*/
|
|
1370
|
-
static
|
|
2014
|
+
static new_des_ocb3(key, tag_size, nonce_size) {
|
|
1371
2015
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1372
2016
|
const len0 = WASM_VECTOR_LEN;
|
|
1373
|
-
const ret = wasm.
|
|
2017
|
+
const ret = wasm.aeadcipher_new_des_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
1374
2018
|
if (ret[2]) {
|
|
1375
2019
|
throw takeFromExternrefTable0(ret[1]);
|
|
1376
2020
|
}
|
|
@@ -1378,12 +2022,14 @@ export class AeadCipher {
|
|
|
1378
2022
|
}
|
|
1379
2023
|
/**
|
|
1380
2024
|
* @param {Uint8Array} key
|
|
2025
|
+
* @param {number} tag_size
|
|
2026
|
+
* @param {number} nonce_size
|
|
1381
2027
|
* @returns {AeadCipher}
|
|
1382
2028
|
*/
|
|
1383
|
-
static
|
|
2029
|
+
static new_des_ccm(key, tag_size, nonce_size) {
|
|
1384
2030
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1385
2031
|
const len0 = WASM_VECTOR_LEN;
|
|
1386
|
-
const ret = wasm.
|
|
2032
|
+
const ret = wasm.aeadcipher_new_des_ccm(ptr0, len0, tag_size, nonce_size);
|
|
1387
2033
|
if (ret[2]) {
|
|
1388
2034
|
throw takeFromExternrefTable0(ret[1]);
|
|
1389
2035
|
}
|
|
@@ -1391,64 +2037,46 @@ export class AeadCipher {
|
|
|
1391
2037
|
}
|
|
1392
2038
|
/**
|
|
1393
2039
|
* @param {Uint8Array} key
|
|
2040
|
+
* @param {number} tag_size
|
|
2041
|
+
* @param {number} nonce_size
|
|
1394
2042
|
* @returns {AeadCipher}
|
|
1395
2043
|
*/
|
|
1396
|
-
static
|
|
2044
|
+
static new_des_eax(key, tag_size, nonce_size) {
|
|
1397
2045
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1398
2046
|
const len0 = WASM_VECTOR_LEN;
|
|
1399
|
-
const ret = wasm.
|
|
2047
|
+
const ret = wasm.aeadcipher_new_des_eax(ptr0, len0, tag_size, nonce_size);
|
|
1400
2048
|
if (ret[2]) {
|
|
1401
2049
|
throw takeFromExternrefTable0(ret[1]);
|
|
1402
2050
|
}
|
|
1403
2051
|
return AeadCipher.__wrap(ret[0]);
|
|
1404
2052
|
}
|
|
1405
2053
|
/**
|
|
1406
|
-
* @param {Uint8Array}
|
|
1407
|
-
* @
|
|
1408
|
-
* @param {Uint8Array} nonce
|
|
1409
|
-
* @param {Uint8Array} aad
|
|
2054
|
+
* @param {Uint8Array} key
|
|
2055
|
+
* @returns {AeadCipher}
|
|
1410
2056
|
*/
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1416
|
-
|
|
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]);
|
|
2057
|
+
static new_tripledes_gcm(key) {
|
|
2058
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2059
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2060
|
+
const ret = wasm.aeadcipher_new_tripledes_gcm(ptr0, len0);
|
|
2061
|
+
if (ret[2]) {
|
|
2062
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1423
2063
|
}
|
|
2064
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1424
2065
|
}
|
|
1425
2066
|
/**
|
|
1426
|
-
* @param {Uint8Array}
|
|
1427
|
-
* @param {
|
|
1428
|
-
* @param {
|
|
1429
|
-
* @returns {
|
|
2067
|
+
* @param {Uint8Array} key
|
|
2068
|
+
* @param {number} tag_size
|
|
2069
|
+
* @param {number} nonce_size
|
|
2070
|
+
* @returns {AeadCipher}
|
|
1430
2071
|
*/
|
|
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]);
|
|
2072
|
+
static new_tripledes_ocb3(key, tag_size, nonce_size) {
|
|
2073
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2074
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2075
|
+
const ret = wasm.aeadcipher_new_tripledes_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
2076
|
+
if (ret[2]) {
|
|
2077
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1441
2078
|
}
|
|
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;
|
|
2079
|
+
return AeadCipher.__wrap(ret[0]);
|
|
1452
2080
|
}
|
|
1453
2081
|
}
|
|
1454
2082
|
if (Symbol.dispose) AeadCipher.prototype[Symbol.dispose] = AeadCipher.prototype.free;
|
|
@@ -1481,14 +2109,15 @@ export class BlockCipher {
|
|
|
1481
2109
|
/**
|
|
1482
2110
|
* @param {Uint8Array} key
|
|
1483
2111
|
* @param {Uint8Array} iv
|
|
2112
|
+
* @param {number | null} [rounds]
|
|
1484
2113
|
* @returns {BlockCipher}
|
|
1485
2114
|
*/
|
|
1486
|
-
static
|
|
2115
|
+
static new_camellia_cbc(key, iv, rounds) {
|
|
1487
2116
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1488
2117
|
const len0 = WASM_VECTOR_LEN;
|
|
1489
2118
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1490
2119
|
const len1 = WASM_VECTOR_LEN;
|
|
1491
|
-
const ret = wasm.
|
|
2120
|
+
const ret = wasm.blockcipher_new_camellia_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1492
2121
|
if (ret[2]) {
|
|
1493
2122
|
throw takeFromExternrefTable0(ret[1]);
|
|
1494
2123
|
}
|
|
@@ -1497,31 +2126,58 @@ export class BlockCipher {
|
|
|
1497
2126
|
/**
|
|
1498
2127
|
* @param {Uint8Array} key
|
|
1499
2128
|
* @param {Uint8Array} iv
|
|
2129
|
+
* @param {number | null} [rounds]
|
|
1500
2130
|
* @returns {BlockCipher}
|
|
1501
2131
|
*/
|
|
1502
|
-
static
|
|
2132
|
+
static new_multi2_cbc(key, iv, rounds) {
|
|
1503
2133
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1504
2134
|
const len0 = WASM_VECTOR_LEN;
|
|
1505
2135
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1506
2136
|
const len1 = WASM_VECTOR_LEN;
|
|
1507
|
-
const ret = wasm.
|
|
2137
|
+
const ret = wasm.blockcipher_new_multi2_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1508
2138
|
if (ret[2]) {
|
|
1509
2139
|
throw takeFromExternrefTable0(ret[1]);
|
|
1510
2140
|
}
|
|
1511
2141
|
return BlockCipher.__wrap(ret[0]);
|
|
1512
2142
|
}
|
|
2143
|
+
/**
|
|
2144
|
+
* @param {Uint8Array} data
|
|
2145
|
+
* @returns {number}
|
|
2146
|
+
*/
|
|
2147
|
+
decrypt(data) {
|
|
2148
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2149
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2150
|
+
const ret = wasm.blockcipher_decrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
2151
|
+
if (ret[2]) {
|
|
2152
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2153
|
+
}
|
|
2154
|
+
return ret[0] >>> 0;
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* @param {Uint8Array} data
|
|
2158
|
+
* @param {number} pos
|
|
2159
|
+
* @returns {number}
|
|
2160
|
+
*/
|
|
2161
|
+
encrypt(data, pos) {
|
|
2162
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2163
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2164
|
+
const ret = wasm.blockcipher_encrypt(this.__wbg_ptr, ptr0, len0, data, pos);
|
|
2165
|
+
if (ret[2]) {
|
|
2166
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2167
|
+
}
|
|
2168
|
+
return ret[0] >>> 0;
|
|
2169
|
+
}
|
|
1513
2170
|
/**
|
|
1514
2171
|
* @param {Uint8Array} key
|
|
1515
2172
|
* @param {Uint8Array} iv
|
|
1516
|
-
* @param {number | null} [rounds]
|
|
1517
2173
|
* @returns {BlockCipher}
|
|
1518
2174
|
*/
|
|
1519
|
-
static
|
|
2175
|
+
static new_aes_cbc(key, iv) {
|
|
1520
2176
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1521
2177
|
const len0 = WASM_VECTOR_LEN;
|
|
1522
2178
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1523
2179
|
const len1 = WASM_VECTOR_LEN;
|
|
1524
|
-
const ret = wasm.
|
|
2180
|
+
const ret = wasm.blockcipher_new_aes_cbc(ptr0, len0, ptr1, len1);
|
|
1525
2181
|
if (ret[2]) {
|
|
1526
2182
|
throw takeFromExternrefTable0(ret[1]);
|
|
1527
2183
|
}
|
|
@@ -1530,15 +2186,14 @@ export class BlockCipher {
|
|
|
1530
2186
|
/**
|
|
1531
2187
|
* @param {Uint8Array} key
|
|
1532
2188
|
* @param {Uint8Array} iv
|
|
1533
|
-
* @param {number | null} [rounds]
|
|
1534
2189
|
* @returns {BlockCipher}
|
|
1535
2190
|
*/
|
|
1536
|
-
static
|
|
2191
|
+
static new_aria_cbc(key, iv) {
|
|
1537
2192
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1538
2193
|
const len0 = WASM_VECTOR_LEN;
|
|
1539
2194
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1540
2195
|
const len1 = WASM_VECTOR_LEN;
|
|
1541
|
-
const ret = wasm.
|
|
2196
|
+
const ret = wasm.blockcipher_new_aria_cbc(ptr0, len0, ptr1, len1);
|
|
1542
2197
|
if (ret[2]) {
|
|
1543
2198
|
throw takeFromExternrefTable0(ret[1]);
|
|
1544
2199
|
}
|
|
@@ -1549,12 +2204,12 @@ export class BlockCipher {
|
|
|
1549
2204
|
* @param {Uint8Array} iv
|
|
1550
2205
|
* @returns {BlockCipher}
|
|
1551
2206
|
*/
|
|
1552
|
-
static
|
|
2207
|
+
static new_blowfish_cbc(key, iv) {
|
|
1553
2208
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1554
2209
|
const len0 = WASM_VECTOR_LEN;
|
|
1555
2210
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1556
2211
|
const len1 = WASM_VECTOR_LEN;
|
|
1557
|
-
const ret = wasm.
|
|
2212
|
+
const ret = wasm.blockcipher_new_blowfish_cbc(ptr0, len0, ptr1, len1);
|
|
1558
2213
|
if (ret[2]) {
|
|
1559
2214
|
throw takeFromExternrefTable0(ret[1]);
|
|
1560
2215
|
}
|
|
@@ -1565,12 +2220,12 @@ export class BlockCipher {
|
|
|
1565
2220
|
* @param {Uint8Array} iv
|
|
1566
2221
|
* @returns {BlockCipher}
|
|
1567
2222
|
*/
|
|
1568
|
-
static
|
|
2223
|
+
static new_cast5_cbc(key, iv) {
|
|
1569
2224
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1570
2225
|
const len0 = WASM_VECTOR_LEN;
|
|
1571
2226
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1572
2227
|
const len1 = WASM_VECTOR_LEN;
|
|
1573
|
-
const ret = wasm.
|
|
2228
|
+
const ret = wasm.blockcipher_new_cast5_cbc(ptr0, len0, ptr1, len1);
|
|
1574
2229
|
if (ret[2]) {
|
|
1575
2230
|
throw takeFromExternrefTable0(ret[1]);
|
|
1576
2231
|
}
|
|
@@ -1581,12 +2236,12 @@ export class BlockCipher {
|
|
|
1581
2236
|
* @param {Uint8Array} iv
|
|
1582
2237
|
* @returns {BlockCipher}
|
|
1583
2238
|
*/
|
|
1584
|
-
static
|
|
2239
|
+
static new_des_cbc(key, iv) {
|
|
1585
2240
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1586
2241
|
const len0 = WASM_VECTOR_LEN;
|
|
1587
2242
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1588
2243
|
const len1 = WASM_VECTOR_LEN;
|
|
1589
|
-
const ret = wasm.
|
|
2244
|
+
const ret = wasm.blockcipher_new_des_cbc(ptr0, len0, ptr1, len1);
|
|
1590
2245
|
if (ret[2]) {
|
|
1591
2246
|
throw takeFromExternrefTable0(ret[1]);
|
|
1592
2247
|
}
|
|
@@ -1597,12 +2252,12 @@ export class BlockCipher {
|
|
|
1597
2252
|
* @param {Uint8Array} iv
|
|
1598
2253
|
* @returns {BlockCipher}
|
|
1599
2254
|
*/
|
|
1600
|
-
static
|
|
2255
|
+
static new_tripledes_cbc(key, iv) {
|
|
1601
2256
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1602
2257
|
const len0 = WASM_VECTOR_LEN;
|
|
1603
2258
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1604
2259
|
const len1 = WASM_VECTOR_LEN;
|
|
1605
|
-
const ret = wasm.
|
|
2260
|
+
const ret = wasm.blockcipher_new_tripledes_cbc(ptr0, len0, ptr1, len1);
|
|
1606
2261
|
if (ret[2]) {
|
|
1607
2262
|
throw takeFromExternrefTable0(ret[1]);
|
|
1608
2263
|
}
|
|
@@ -1613,12 +2268,12 @@ export class BlockCipher {
|
|
|
1613
2268
|
* @param {Uint8Array} iv
|
|
1614
2269
|
* @returns {BlockCipher}
|
|
1615
2270
|
*/
|
|
1616
|
-
static
|
|
2271
|
+
static new_tea_cbc(key, iv) {
|
|
1617
2272
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1618
2273
|
const len0 = WASM_VECTOR_LEN;
|
|
1619
2274
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1620
2275
|
const len1 = WASM_VECTOR_LEN;
|
|
1621
|
-
const ret = wasm.
|
|
2276
|
+
const ret = wasm.blockcipher_new_tea_cbc(ptr0, len0, ptr1, len1);
|
|
1622
2277
|
if (ret[2]) {
|
|
1623
2278
|
throw takeFromExternrefTable0(ret[1]);
|
|
1624
2279
|
}
|
|
@@ -1629,12 +2284,12 @@ export class BlockCipher {
|
|
|
1629
2284
|
* @param {Uint8Array} iv
|
|
1630
2285
|
* @returns {BlockCipher}
|
|
1631
2286
|
*/
|
|
1632
|
-
static
|
|
2287
|
+
static new_twofish_cbc(key, iv) {
|
|
1633
2288
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1634
2289
|
const len0 = WASM_VECTOR_LEN;
|
|
1635
2290
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1636
2291
|
const len1 = WASM_VECTOR_LEN;
|
|
1637
|
-
const ret = wasm.
|
|
2292
|
+
const ret = wasm.blockcipher_new_twofish_cbc(ptr0, len0, ptr1, len1);
|
|
1638
2293
|
if (ret[2]) {
|
|
1639
2294
|
throw takeFromExternrefTable0(ret[1]);
|
|
1640
2295
|
}
|
|
@@ -1645,12 +2300,12 @@ export class BlockCipher {
|
|
|
1645
2300
|
* @param {Uint8Array} iv
|
|
1646
2301
|
* @returns {BlockCipher}
|
|
1647
2302
|
*/
|
|
1648
|
-
static
|
|
2303
|
+
static new_xtea_cbc(key, iv) {
|
|
1649
2304
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1650
2305
|
const len0 = WASM_VECTOR_LEN;
|
|
1651
2306
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1652
2307
|
const len1 = WASM_VECTOR_LEN;
|
|
1653
|
-
const ret = wasm.
|
|
2308
|
+
const ret = wasm.blockcipher_new_xtea_cbc(ptr0, len0, ptr1, len1);
|
|
1654
2309
|
if (ret[2]) {
|
|
1655
2310
|
throw takeFromExternrefTable0(ret[1]);
|
|
1656
2311
|
}
|
|
@@ -1661,12 +2316,12 @@ export class BlockCipher {
|
|
|
1661
2316
|
* @param {Uint8Array} iv
|
|
1662
2317
|
* @returns {BlockCipher}
|
|
1663
2318
|
*/
|
|
1664
|
-
static
|
|
2319
|
+
static new_idea_cbc(key, iv) {
|
|
1665
2320
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1666
2321
|
const len0 = WASM_VECTOR_LEN;
|
|
1667
2322
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1668
2323
|
const len1 = WASM_VECTOR_LEN;
|
|
1669
|
-
const ret = wasm.
|
|
2324
|
+
const ret = wasm.blockcipher_new_idea_cbc(ptr0, len0, ptr1, len1);
|
|
1670
2325
|
if (ret[2]) {
|
|
1671
2326
|
throw takeFromExternrefTable0(ret[1]);
|
|
1672
2327
|
}
|
|
@@ -1677,12 +2332,12 @@ export class BlockCipher {
|
|
|
1677
2332
|
* @param {Uint8Array} iv
|
|
1678
2333
|
* @returns {BlockCipher}
|
|
1679
2334
|
*/
|
|
1680
|
-
static
|
|
2335
|
+
static new_rc6_cbc(key, iv) {
|
|
1681
2336
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1682
2337
|
const len0 = WASM_VECTOR_LEN;
|
|
1683
2338
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1684
2339
|
const len1 = WASM_VECTOR_LEN;
|
|
1685
|
-
const ret = wasm.
|
|
2340
|
+
const ret = wasm.blockcipher_new_rc6_cbc(ptr0, len0, ptr1, len1);
|
|
1686
2341
|
if (ret[2]) {
|
|
1687
2342
|
throw takeFromExternrefTable0(ret[1]);
|
|
1688
2343
|
}
|
|
@@ -1693,12 +2348,12 @@ export class BlockCipher {
|
|
|
1693
2348
|
* @param {Uint8Array} iv
|
|
1694
2349
|
* @returns {BlockCipher}
|
|
1695
2350
|
*/
|
|
1696
|
-
static
|
|
2351
|
+
static new_sm4_cbc(key, iv) {
|
|
1697
2352
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1698
2353
|
const len0 = WASM_VECTOR_LEN;
|
|
1699
2354
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1700
2355
|
const len1 = WASM_VECTOR_LEN;
|
|
1701
|
-
const ret = wasm.
|
|
2356
|
+
const ret = wasm.blockcipher_new_sm4_cbc(ptr0, len0, ptr1, len1);
|
|
1702
2357
|
if (ret[2]) {
|
|
1703
2358
|
throw takeFromExternrefTable0(ret[1]);
|
|
1704
2359
|
}
|
|
@@ -1709,12 +2364,12 @@ export class BlockCipher {
|
|
|
1709
2364
|
* @param {Uint8Array} iv
|
|
1710
2365
|
* @returns {BlockCipher}
|
|
1711
2366
|
*/
|
|
1712
|
-
static
|
|
2367
|
+
static new_skipjack_cbc(key, iv) {
|
|
1713
2368
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1714
2369
|
const len0 = WASM_VECTOR_LEN;
|
|
1715
2370
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1716
2371
|
const len1 = WASM_VECTOR_LEN;
|
|
1717
|
-
const ret = wasm.
|
|
2372
|
+
const ret = wasm.blockcipher_new_skipjack_cbc(ptr0, len0, ptr1, len1);
|
|
1718
2373
|
if (ret[2]) {
|
|
1719
2374
|
throw takeFromExternrefTable0(ret[1]);
|
|
1720
2375
|
}
|
|
@@ -1723,15 +2378,14 @@ export class BlockCipher {
|
|
|
1723
2378
|
/**
|
|
1724
2379
|
* @param {Uint8Array} key
|
|
1725
2380
|
* @param {Uint8Array} iv
|
|
1726
|
-
* @param {number | null} [rounds]
|
|
1727
2381
|
* @returns {BlockCipher}
|
|
1728
2382
|
*/
|
|
1729
|
-
static
|
|
2383
|
+
static new_kasumi_cbc(key, iv) {
|
|
1730
2384
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1731
2385
|
const len0 = WASM_VECTOR_LEN;
|
|
1732
2386
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1733
2387
|
const len1 = WASM_VECTOR_LEN;
|
|
1734
|
-
const ret = wasm.
|
|
2388
|
+
const ret = wasm.blockcipher_new_kasumi_cbc(ptr0, len0, ptr1, len1);
|
|
1735
2389
|
if (ret[2]) {
|
|
1736
2390
|
throw takeFromExternrefTable0(ret[1]);
|
|
1737
2391
|
}
|
|
@@ -1742,12 +2396,12 @@ export class BlockCipher {
|
|
|
1742
2396
|
* @param {Uint8Array} iv
|
|
1743
2397
|
* @returns {BlockCipher}
|
|
1744
2398
|
*/
|
|
1745
|
-
static
|
|
2399
|
+
static new_kseed_cbc(key, iv) {
|
|
1746
2400
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1747
2401
|
const len0 = WASM_VECTOR_LEN;
|
|
1748
2402
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1749
2403
|
const len1 = WASM_VECTOR_LEN;
|
|
1750
|
-
const ret = wasm.
|
|
2404
|
+
const ret = wasm.blockcipher_new_kseed_cbc(ptr0, len0, ptr1, len1);
|
|
1751
2405
|
if (ret[2]) {
|
|
1752
2406
|
throw takeFromExternrefTable0(ret[1]);
|
|
1753
2407
|
}
|
|
@@ -1758,12 +2412,12 @@ export class BlockCipher {
|
|
|
1758
2412
|
* @param {Uint8Array} iv
|
|
1759
2413
|
* @returns {BlockCipher}
|
|
1760
2414
|
*/
|
|
1761
|
-
static
|
|
2415
|
+
static new_anubis_cbc(key, iv) {
|
|
1762
2416
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1763
2417
|
const len0 = WASM_VECTOR_LEN;
|
|
1764
2418
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1765
2419
|
const len1 = WASM_VECTOR_LEN;
|
|
1766
|
-
const ret = wasm.
|
|
2420
|
+
const ret = wasm.blockcipher_new_anubis_cbc(ptr0, len0, ptr1, len1);
|
|
1767
2421
|
if (ret[2]) {
|
|
1768
2422
|
throw takeFromExternrefTable0(ret[1]);
|
|
1769
2423
|
}
|
|
@@ -1774,12 +2428,12 @@ export class BlockCipher {
|
|
|
1774
2428
|
* @param {Uint8Array} iv
|
|
1775
2429
|
* @returns {BlockCipher}
|
|
1776
2430
|
*/
|
|
1777
|
-
static
|
|
2431
|
+
static new_noekeon_cbc(key, iv) {
|
|
1778
2432
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1779
2433
|
const len0 = WASM_VECTOR_LEN;
|
|
1780
2434
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1781
2435
|
const len1 = WASM_VECTOR_LEN;
|
|
1782
|
-
const ret = wasm.
|
|
2436
|
+
const ret = wasm.blockcipher_new_noekeon_cbc(ptr0, len0, ptr1, len1);
|
|
1783
2437
|
if (ret[2]) {
|
|
1784
2438
|
throw takeFromExternrefTable0(ret[1]);
|
|
1785
2439
|
}
|
|
@@ -1790,12 +2444,12 @@ export class BlockCipher {
|
|
|
1790
2444
|
* @param {Uint8Array} iv
|
|
1791
2445
|
* @returns {BlockCipher}
|
|
1792
2446
|
*/
|
|
1793
|
-
static
|
|
2447
|
+
static new_khazad_cbc(key, iv) {
|
|
1794
2448
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1795
2449
|
const len0 = WASM_VECTOR_LEN;
|
|
1796
2450
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1797
2451
|
const len1 = WASM_VECTOR_LEN;
|
|
1798
|
-
const ret = wasm.
|
|
2452
|
+
const ret = wasm.blockcipher_new_khazad_cbc(ptr0, len0, ptr1, len1);
|
|
1799
2453
|
if (ret[2]) {
|
|
1800
2454
|
throw takeFromExternrefTable0(ret[1]);
|
|
1801
2455
|
}
|
|
@@ -1804,15 +2458,14 @@ export class BlockCipher {
|
|
|
1804
2458
|
/**
|
|
1805
2459
|
* @param {Uint8Array} key
|
|
1806
2460
|
* @param {Uint8Array} iv
|
|
1807
|
-
* @param {number | null} [rounds]
|
|
1808
2461
|
* @returns {BlockCipher}
|
|
1809
2462
|
*/
|
|
1810
|
-
static
|
|
2463
|
+
static new_serpent_cbc(key, iv) {
|
|
1811
2464
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1812
2465
|
const len0 = WASM_VECTOR_LEN;
|
|
1813
2466
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1814
2467
|
const len1 = WASM_VECTOR_LEN;
|
|
1815
|
-
const ret = wasm.
|
|
2468
|
+
const ret = wasm.blockcipher_new_serpent_cbc(ptr0, len0, ptr1, len1);
|
|
1816
2469
|
if (ret[2]) {
|
|
1817
2470
|
throw takeFromExternrefTable0(ret[1]);
|
|
1818
2471
|
}
|
|
@@ -1823,12 +2476,12 @@ export class BlockCipher {
|
|
|
1823
2476
|
* @param {Uint8Array} iv
|
|
1824
2477
|
* @returns {BlockCipher}
|
|
1825
2478
|
*/
|
|
1826
|
-
static
|
|
2479
|
+
static new_desx_cbc(key, iv) {
|
|
1827
2480
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1828
2481
|
const len0 = WASM_VECTOR_LEN;
|
|
1829
2482
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1830
2483
|
const len1 = WASM_VECTOR_LEN;
|
|
1831
|
-
const ret = wasm.
|
|
2484
|
+
const ret = wasm.blockcipher_new_desx_cbc(ptr0, len0, ptr1, len1);
|
|
1832
2485
|
if (ret[2]) {
|
|
1833
2486
|
throw takeFromExternrefTable0(ret[1]);
|
|
1834
2487
|
}
|
|
@@ -1837,45 +2490,36 @@ export class BlockCipher {
|
|
|
1837
2490
|
/**
|
|
1838
2491
|
* @param {Uint8Array} key
|
|
1839
2492
|
* @param {Uint8Array} iv
|
|
2493
|
+
* @param {number | null} [rounds]
|
|
1840
2494
|
* @returns {BlockCipher}
|
|
1841
2495
|
*/
|
|
1842
|
-
static
|
|
2496
|
+
static new_rc2_cbc(key, iv, rounds) {
|
|
1843
2497
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1844
2498
|
const len0 = WASM_VECTOR_LEN;
|
|
1845
2499
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
1846
2500
|
const len1 = WASM_VECTOR_LEN;
|
|
1847
|
-
const ret = wasm.
|
|
2501
|
+
const ret = wasm.blockcipher_new_rc2_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1848
2502
|
if (ret[2]) {
|
|
1849
2503
|
throw takeFromExternrefTable0(ret[1]);
|
|
1850
2504
|
}
|
|
1851
2505
|
return BlockCipher.__wrap(ret[0]);
|
|
1852
2506
|
}
|
|
1853
2507
|
/**
|
|
1854
|
-
* @param {Uint8Array}
|
|
1855
|
-
* @
|
|
1856
|
-
|
|
1857
|
-
|
|
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}
|
|
2508
|
+
* @param {Uint8Array} key
|
|
2509
|
+
* @param {Uint8Array} iv
|
|
2510
|
+
* @param {number | null} [rounds]
|
|
2511
|
+
* @returns {BlockCipher}
|
|
1870
2512
|
*/
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
const
|
|
2513
|
+
static new_rc5_cbc(key, iv, rounds) {
|
|
2514
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2515
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2516
|
+
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2517
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2518
|
+
const ret = wasm.blockcipher_new_rc5_cbc(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
1875
2519
|
if (ret[2]) {
|
|
1876
2520
|
throw takeFromExternrefTable0(ret[1]);
|
|
1877
2521
|
}
|
|
1878
|
-
return ret[0]
|
|
2522
|
+
return BlockCipher.__wrap(ret[0]);
|
|
1879
2523
|
}
|
|
1880
2524
|
}
|
|
1881
2525
|
if (Symbol.dispose) BlockCipher.prototype[Symbol.dispose] = BlockCipher.prototype.free;
|
|
@@ -1905,6 +2549,20 @@ export class Hash {
|
|
|
1905
2549
|
const ptr = this.__destroy_into_raw();
|
|
1906
2550
|
wasm.__wbg_hash_free(ptr, 0);
|
|
1907
2551
|
}
|
|
2552
|
+
/**
|
|
2553
|
+
* @param {Uint8Array | null | undefined} key
|
|
2554
|
+
* @param {number} output_len
|
|
2555
|
+
* @returns {Hash}
|
|
2556
|
+
*/
|
|
2557
|
+
static new_blake2b(key, output_len) {
|
|
2558
|
+
var ptr0 = isLikeNone(key) ? 0 : passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2559
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2560
|
+
const ret = wasm.hash_new_blake2b(ptr0, len0, output_len);
|
|
2561
|
+
if (ret[2]) {
|
|
2562
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2563
|
+
}
|
|
2564
|
+
return Hash.__wrap(ret[0]);
|
|
2565
|
+
}
|
|
1908
2566
|
/**
|
|
1909
2567
|
* @returns {number}
|
|
1910
2568
|
*/
|
|
@@ -1912,6 +2570,149 @@ export class Hash {
|
|
|
1912
2570
|
const ret = wasm.hash_block_size(this.__wbg_ptr);
|
|
1913
2571
|
return ret >>> 0;
|
|
1914
2572
|
}
|
|
2573
|
+
/**
|
|
2574
|
+
* @returns {Uint8Array}
|
|
2575
|
+
*/
|
|
2576
|
+
sum() {
|
|
2577
|
+
const ret = wasm.hash_sum(this.__wbg_ptr);
|
|
2578
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2579
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2580
|
+
return v1;
|
|
2581
|
+
}
|
|
2582
|
+
/**
|
|
2583
|
+
* @param {Uint8Array} buf
|
|
2584
|
+
* @returns {number}
|
|
2585
|
+
*/
|
|
2586
|
+
read(buf) {
|
|
2587
|
+
var ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
|
|
2588
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2589
|
+
const ret = wasm.hash_read(this.__wbg_ptr, ptr0, len0, buf);
|
|
2590
|
+
if (ret[2]) {
|
|
2591
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2592
|
+
}
|
|
2593
|
+
return ret[0] >>> 0;
|
|
2594
|
+
}
|
|
2595
|
+
/**
|
|
2596
|
+
* @returns {number}
|
|
2597
|
+
*/
|
|
2598
|
+
size() {
|
|
2599
|
+
const ret = wasm.hash_size(this.__wbg_ptr);
|
|
2600
|
+
return ret >>> 0;
|
|
2601
|
+
}
|
|
2602
|
+
flush() {
|
|
2603
|
+
const ret = wasm.hash_flush(this.__wbg_ptr);
|
|
2604
|
+
if (ret[1]) {
|
|
2605
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
reset() {
|
|
2609
|
+
wasm.hash_reset(this.__wbg_ptr);
|
|
2610
|
+
}
|
|
2611
|
+
/**
|
|
2612
|
+
* @param {Uint8Array} data
|
|
2613
|
+
* @returns {number}
|
|
2614
|
+
*/
|
|
2615
|
+
write(data) {
|
|
2616
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2617
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2618
|
+
const ret = wasm.hash_write(this.__wbg_ptr, ptr0, len0);
|
|
2619
|
+
if (ret[2]) {
|
|
2620
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2621
|
+
}
|
|
2622
|
+
return ret[0] >>> 0;
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* @param {Uint8Array} key
|
|
2626
|
+
* @returns {Hash}
|
|
2627
|
+
*/
|
|
2628
|
+
static new_md2_hmac(key) {
|
|
2629
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2630
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2631
|
+
const ret = wasm.hash_new_md2_hmac(ptr0, len0);
|
|
2632
|
+
if (ret[2]) {
|
|
2633
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2634
|
+
}
|
|
2635
|
+
return Hash.__wrap(ret[0]);
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* @returns {Hash}
|
|
2639
|
+
*/
|
|
2640
|
+
static new_md2() {
|
|
2641
|
+
const ret = wasm.hash_new_md2();
|
|
2642
|
+
if (ret[2]) {
|
|
2643
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2644
|
+
}
|
|
2645
|
+
return Hash.__wrap(ret[0]);
|
|
2646
|
+
}
|
|
2647
|
+
/**
|
|
2648
|
+
* @param {Uint8Array} key
|
|
2649
|
+
* @returns {Hash}
|
|
2650
|
+
*/
|
|
2651
|
+
static new_md4_hmac(key) {
|
|
2652
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2653
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2654
|
+
const ret = wasm.hash_new_md4_hmac(ptr0, len0);
|
|
2655
|
+
if (ret[2]) {
|
|
2656
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2657
|
+
}
|
|
2658
|
+
return Hash.__wrap(ret[0]);
|
|
2659
|
+
}
|
|
2660
|
+
/**
|
|
2661
|
+
* @returns {Hash}
|
|
2662
|
+
*/
|
|
2663
|
+
static new_md4() {
|
|
2664
|
+
const ret = wasm.hash_new_md4();
|
|
2665
|
+
if (ret[2]) {
|
|
2666
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2667
|
+
}
|
|
2668
|
+
return Hash.__wrap(ret[0]);
|
|
2669
|
+
}
|
|
2670
|
+
/**
|
|
2671
|
+
* @param {Uint8Array} key
|
|
2672
|
+
* @returns {Hash}
|
|
2673
|
+
*/
|
|
2674
|
+
static new_md5_hmac(key) {
|
|
2675
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2676
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2677
|
+
const ret = wasm.hash_new_md5_hmac(ptr0, len0);
|
|
2678
|
+
if (ret[2]) {
|
|
2679
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2680
|
+
}
|
|
2681
|
+
return Hash.__wrap(ret[0]);
|
|
2682
|
+
}
|
|
2683
|
+
/**
|
|
2684
|
+
* @returns {Hash}
|
|
2685
|
+
*/
|
|
2686
|
+
static new_md5() {
|
|
2687
|
+
const ret = wasm.hash_new_md5();
|
|
2688
|
+
if (ret[2]) {
|
|
2689
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2690
|
+
}
|
|
2691
|
+
return Hash.__wrap(ret[0]);
|
|
2692
|
+
}
|
|
2693
|
+
/**
|
|
2694
|
+
* @param {Uint8Array} key
|
|
2695
|
+
* @returns {Hash}
|
|
2696
|
+
*/
|
|
2697
|
+
static new_sha1_hmac(key) {
|
|
2698
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2699
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2700
|
+
const ret = wasm.hash_new_sha1_hmac(ptr0, len0);
|
|
2701
|
+
if (ret[2]) {
|
|
2702
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2703
|
+
}
|
|
2704
|
+
return Hash.__wrap(ret[0]);
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* @returns {Hash}
|
|
2708
|
+
*/
|
|
2709
|
+
static new_sha1() {
|
|
2710
|
+
const ret = wasm.hash_new_sha1();
|
|
2711
|
+
if (ret[2]) {
|
|
2712
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2713
|
+
}
|
|
2714
|
+
return Hash.__wrap(ret[0]);
|
|
2715
|
+
}
|
|
1915
2716
|
/**
|
|
1916
2717
|
* @returns {Hash}
|
|
1917
2718
|
*/
|
|
@@ -1922,6 +2723,19 @@ export class Hash {
|
|
|
1922
2723
|
}
|
|
1923
2724
|
return Hash.__wrap(ret[0]);
|
|
1924
2725
|
}
|
|
2726
|
+
/**
|
|
2727
|
+
* @param {Uint8Array} key
|
|
2728
|
+
* @returns {Hash}
|
|
2729
|
+
*/
|
|
2730
|
+
static new_sha224_hmac(key) {
|
|
2731
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2732
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2733
|
+
const ret = wasm.hash_new_sha224_hmac(ptr0, len0);
|
|
2734
|
+
if (ret[2]) {
|
|
2735
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2736
|
+
}
|
|
2737
|
+
return Hash.__wrap(ret[0]);
|
|
2738
|
+
}
|
|
1925
2739
|
/**
|
|
1926
2740
|
* @returns {Hash}
|
|
1927
2741
|
*/
|
|
@@ -1932,6 +2746,19 @@ export class Hash {
|
|
|
1932
2746
|
}
|
|
1933
2747
|
return Hash.__wrap(ret[0]);
|
|
1934
2748
|
}
|
|
2749
|
+
/**
|
|
2750
|
+
* @param {Uint8Array} key
|
|
2751
|
+
* @returns {Hash}
|
|
2752
|
+
*/
|
|
2753
|
+
static new_sha256_hmac(key) {
|
|
2754
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2755
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2756
|
+
const ret = wasm.hash_new_sha256_hmac(ptr0, len0);
|
|
2757
|
+
if (ret[2]) {
|
|
2758
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2759
|
+
}
|
|
2760
|
+
return Hash.__wrap(ret[0]);
|
|
2761
|
+
}
|
|
1935
2762
|
/**
|
|
1936
2763
|
* @returns {Hash}
|
|
1937
2764
|
*/
|
|
@@ -1942,6 +2769,19 @@ export class Hash {
|
|
|
1942
2769
|
}
|
|
1943
2770
|
return Hash.__wrap(ret[0]);
|
|
1944
2771
|
}
|
|
2772
|
+
/**
|
|
2773
|
+
* @param {Uint8Array} key
|
|
2774
|
+
* @returns {Hash}
|
|
2775
|
+
*/
|
|
2776
|
+
static new_sha384_hmac(key) {
|
|
2777
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2778
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2779
|
+
const ret = wasm.hash_new_sha384_hmac(ptr0, len0);
|
|
2780
|
+
if (ret[2]) {
|
|
2781
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2782
|
+
}
|
|
2783
|
+
return Hash.__wrap(ret[0]);
|
|
2784
|
+
}
|
|
1945
2785
|
/**
|
|
1946
2786
|
* @returns {Hash}
|
|
1947
2787
|
*/
|
|
@@ -1953,28 +2793,23 @@ export class Hash {
|
|
|
1953
2793
|
return Hash.__wrap(ret[0]);
|
|
1954
2794
|
}
|
|
1955
2795
|
/**
|
|
1956
|
-
* @param {Uint8Array
|
|
1957
|
-
* @param {number} output_len
|
|
2796
|
+
* @param {Uint8Array} key
|
|
1958
2797
|
* @returns {Hash}
|
|
1959
2798
|
*/
|
|
1960
|
-
static
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
const ret = wasm.
|
|
2799
|
+
static new_sha512_hmac(key) {
|
|
2800
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2801
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2802
|
+
const ret = wasm.hash_new_sha512_hmac(ptr0, len0);
|
|
1964
2803
|
if (ret[2]) {
|
|
1965
2804
|
throw takeFromExternrefTable0(ret[1]);
|
|
1966
2805
|
}
|
|
1967
2806
|
return Hash.__wrap(ret[0]);
|
|
1968
2807
|
}
|
|
1969
2808
|
/**
|
|
1970
|
-
* @param {Uint8Array | null | undefined} key
|
|
1971
|
-
* @param {number} output_len
|
|
1972
2809
|
* @returns {Hash}
|
|
1973
2810
|
*/
|
|
1974
|
-
static
|
|
1975
|
-
|
|
1976
|
-
var len0 = WASM_VECTOR_LEN;
|
|
1977
|
-
const ret = wasm.hash_new_blake2s(ptr0, len0, output_len);
|
|
2811
|
+
static new_sha512_224() {
|
|
2812
|
+
const ret = wasm.hash_new_sha512_224();
|
|
1978
2813
|
if (ret[2]) {
|
|
1979
2814
|
throw takeFromExternrefTable0(ret[1]);
|
|
1980
2815
|
}
|
|
@@ -1984,23 +2819,20 @@ export class Hash {
|
|
|
1984
2819
|
* @param {Uint8Array} key
|
|
1985
2820
|
* @returns {Hash}
|
|
1986
2821
|
*/
|
|
1987
|
-
static
|
|
2822
|
+
static new_sha512_224_hmac(key) {
|
|
1988
2823
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1989
2824
|
const len0 = WASM_VECTOR_LEN;
|
|
1990
|
-
const ret = wasm.
|
|
2825
|
+
const ret = wasm.hash_new_sha512_224_hmac(ptr0, len0);
|
|
1991
2826
|
if (ret[2]) {
|
|
1992
2827
|
throw takeFromExternrefTable0(ret[1]);
|
|
1993
2828
|
}
|
|
1994
2829
|
return Hash.__wrap(ret[0]);
|
|
1995
2830
|
}
|
|
1996
2831
|
/**
|
|
1997
|
-
* @param {Uint8Array} key
|
|
1998
2832
|
* @returns {Hash}
|
|
1999
2833
|
*/
|
|
2000
|
-
static
|
|
2001
|
-
const
|
|
2002
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2003
|
-
const ret = wasm.hash_new_md4_hmac(ptr0, len0);
|
|
2834
|
+
static new_sha512_256() {
|
|
2835
|
+
const ret = wasm.hash_new_sha512_256();
|
|
2004
2836
|
if (ret[2]) {
|
|
2005
2837
|
throw takeFromExternrefTable0(ret[1]);
|
|
2006
2838
|
}
|
|
@@ -2010,10 +2842,10 @@ export class Hash {
|
|
|
2010
2842
|
* @param {Uint8Array} key
|
|
2011
2843
|
* @returns {Hash}
|
|
2012
2844
|
*/
|
|
2013
|
-
static
|
|
2845
|
+
static new_sha512_256_hmac(key) {
|
|
2014
2846
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2015
2847
|
const len0 = WASM_VECTOR_LEN;
|
|
2016
|
-
const ret = wasm.
|
|
2848
|
+
const ret = wasm.hash_new_sha512_256_hmac(ptr0, len0);
|
|
2017
2849
|
if (ret[2]) {
|
|
2018
2850
|
throw takeFromExternrefTable0(ret[1]);
|
|
2019
2851
|
}
|
|
@@ -2029,6 +2861,19 @@ export class Hash {
|
|
|
2029
2861
|
}
|
|
2030
2862
|
return Hash.__wrap(ret[0]);
|
|
2031
2863
|
}
|
|
2864
|
+
/**
|
|
2865
|
+
* @param {Uint8Array} key
|
|
2866
|
+
* @returns {Hash}
|
|
2867
|
+
*/
|
|
2868
|
+
static new_sha3_224_hmac(key) {
|
|
2869
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2870
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2871
|
+
const ret = wasm.hash_new_sha3_224_hmac(ptr0, len0);
|
|
2872
|
+
if (ret[2]) {
|
|
2873
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2874
|
+
}
|
|
2875
|
+
return Hash.__wrap(ret[0]);
|
|
2876
|
+
}
|
|
2032
2877
|
/**
|
|
2033
2878
|
* @returns {Hash}
|
|
2034
2879
|
*/
|
|
@@ -2039,6 +2884,19 @@ export class Hash {
|
|
|
2039
2884
|
}
|
|
2040
2885
|
return Hash.__wrap(ret[0]);
|
|
2041
2886
|
}
|
|
2887
|
+
/**
|
|
2888
|
+
* @param {Uint8Array} key
|
|
2889
|
+
* @returns {Hash}
|
|
2890
|
+
*/
|
|
2891
|
+
static new_sha3_256_hmac(key) {
|
|
2892
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2893
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2894
|
+
const ret = wasm.hash_new_sha3_256_hmac(ptr0, len0);
|
|
2895
|
+
if (ret[2]) {
|
|
2896
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2897
|
+
}
|
|
2898
|
+
return Hash.__wrap(ret[0]);
|
|
2899
|
+
}
|
|
2042
2900
|
/**
|
|
2043
2901
|
* @returns {Hash}
|
|
2044
2902
|
*/
|
|
@@ -2049,6 +2907,19 @@ export class Hash {
|
|
|
2049
2907
|
}
|
|
2050
2908
|
return Hash.__wrap(ret[0]);
|
|
2051
2909
|
}
|
|
2910
|
+
/**
|
|
2911
|
+
* @param {Uint8Array} key
|
|
2912
|
+
* @returns {Hash}
|
|
2913
|
+
*/
|
|
2914
|
+
static new_sha3_384_hmac(key) {
|
|
2915
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2916
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2917
|
+
const ret = wasm.hash_new_sha3_384_hmac(ptr0, len0);
|
|
2918
|
+
if (ret[2]) {
|
|
2919
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2920
|
+
}
|
|
2921
|
+
return Hash.__wrap(ret[0]);
|
|
2922
|
+
}
|
|
2052
2923
|
/**
|
|
2053
2924
|
* @returns {Hash}
|
|
2054
2925
|
*/
|
|
@@ -2059,6 +2930,19 @@ export class Hash {
|
|
|
2059
2930
|
}
|
|
2060
2931
|
return Hash.__wrap(ret[0]);
|
|
2061
2932
|
}
|
|
2933
|
+
/**
|
|
2934
|
+
* @param {Uint8Array} key
|
|
2935
|
+
* @returns {Hash}
|
|
2936
|
+
*/
|
|
2937
|
+
static new_sha3_512_hmac(key) {
|
|
2938
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2939
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2940
|
+
const ret = wasm.hash_new_sha3_512_hmac(ptr0, len0);
|
|
2941
|
+
if (ret[2]) {
|
|
2942
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2943
|
+
}
|
|
2944
|
+
return Hash.__wrap(ret[0]);
|
|
2945
|
+
}
|
|
2062
2946
|
/**
|
|
2063
2947
|
* @returns {Hash}
|
|
2064
2948
|
*/
|
|
@@ -2069,6 +2953,19 @@ export class Hash {
|
|
|
2069
2953
|
}
|
|
2070
2954
|
return Hash.__wrap(ret[0]);
|
|
2071
2955
|
}
|
|
2956
|
+
/**
|
|
2957
|
+
* @param {Uint8Array} key
|
|
2958
|
+
* @returns {Hash}
|
|
2959
|
+
*/
|
|
2960
|
+
static new_shake128_hmac(key) {
|
|
2961
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2962
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2963
|
+
const ret = wasm.hash_new_shake128_hmac(ptr0, len0);
|
|
2964
|
+
if (ret[2]) {
|
|
2965
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2966
|
+
}
|
|
2967
|
+
return Hash.__wrap(ret[0]);
|
|
2968
|
+
}
|
|
2072
2969
|
/**
|
|
2073
2970
|
* @returns {Hash}
|
|
2074
2971
|
*/
|
|
@@ -2083,10 +2980,10 @@ export class Hash {
|
|
|
2083
2980
|
* @param {Uint8Array} key
|
|
2084
2981
|
* @returns {Hash}
|
|
2085
2982
|
*/
|
|
2086
|
-
static
|
|
2983
|
+
static new_shake256_hmac(key) {
|
|
2087
2984
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2088
2985
|
const len0 = WASM_VECTOR_LEN;
|
|
2089
|
-
const ret = wasm.
|
|
2986
|
+
const ret = wasm.hash_new_shake256_hmac(ptr0, len0);
|
|
2090
2987
|
if (ret[2]) {
|
|
2091
2988
|
throw takeFromExternrefTable0(ret[1]);
|
|
2092
2989
|
}
|
|
@@ -2096,10 +2993,10 @@ export class Hash {
|
|
|
2096
2993
|
* @param {Uint8Array} key
|
|
2097
2994
|
* @returns {Hash}
|
|
2098
2995
|
*/
|
|
2099
|
-
static
|
|
2996
|
+
static new_sm3_hmac(key) {
|
|
2100
2997
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2101
2998
|
const len0 = WASM_VECTOR_LEN;
|
|
2102
|
-
const ret = wasm.
|
|
2999
|
+
const ret = wasm.hash_new_sm3_hmac(ptr0, len0);
|
|
2103
3000
|
if (ret[2]) {
|
|
2104
3001
|
throw takeFromExternrefTable0(ret[1]);
|
|
2105
3002
|
}
|
|
@@ -2108,8 +3005,8 @@ export class Hash {
|
|
|
2108
3005
|
/**
|
|
2109
3006
|
* @returns {Hash}
|
|
2110
3007
|
*/
|
|
2111
|
-
static
|
|
2112
|
-
const ret = wasm.
|
|
3008
|
+
static new_sm3() {
|
|
3009
|
+
const ret = wasm.hash_new_sm3();
|
|
2113
3010
|
if (ret[2]) {
|
|
2114
3011
|
throw takeFromExternrefTable0(ret[1]);
|
|
2115
3012
|
}
|
|
@@ -2118,8 +3015,8 @@ export class Hash {
|
|
|
2118
3015
|
/**
|
|
2119
3016
|
* @returns {Hash}
|
|
2120
3017
|
*/
|
|
2121
|
-
static
|
|
2122
|
-
const ret = wasm.
|
|
3018
|
+
static new_md5_sha1() {
|
|
3019
|
+
const ret = wasm.hash_new_md5_sha1();
|
|
2123
3020
|
if (ret[2]) {
|
|
2124
3021
|
throw takeFromExternrefTable0(ret[1]);
|
|
2125
3022
|
}
|
|
@@ -2129,23 +3026,20 @@ export class Hash {
|
|
|
2129
3026
|
* @param {Uint8Array} key
|
|
2130
3027
|
* @returns {Hash}
|
|
2131
3028
|
*/
|
|
2132
|
-
static
|
|
3029
|
+
static new_md5_sha1_hmac(key) {
|
|
2133
3030
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2134
3031
|
const len0 = WASM_VECTOR_LEN;
|
|
2135
|
-
const ret = wasm.
|
|
3032
|
+
const ret = wasm.hash_new_md5_sha1_hmac(ptr0, len0);
|
|
2136
3033
|
if (ret[2]) {
|
|
2137
3034
|
throw takeFromExternrefTable0(ret[1]);
|
|
2138
3035
|
}
|
|
2139
3036
|
return Hash.__wrap(ret[0]);
|
|
2140
3037
|
}
|
|
2141
3038
|
/**
|
|
2142
|
-
* @param {Uint8Array} key
|
|
2143
3039
|
* @returns {Hash}
|
|
2144
3040
|
*/
|
|
2145
|
-
static
|
|
2146
|
-
const
|
|
2147
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2148
|
-
const ret = wasm.hash_new_sha256_hmac(ptr0, len0);
|
|
3041
|
+
static new_ripemd160() {
|
|
3042
|
+
const ret = wasm.hash_new_ripemd160();
|
|
2149
3043
|
if (ret[2]) {
|
|
2150
3044
|
throw takeFromExternrefTable0(ret[1]);
|
|
2151
3045
|
}
|
|
@@ -2155,10 +3049,10 @@ export class Hash {
|
|
|
2155
3049
|
* @param {Uint8Array} key
|
|
2156
3050
|
* @returns {Hash}
|
|
2157
3051
|
*/
|
|
2158
|
-
static
|
|
3052
|
+
static new_ripemd160_hmac(key) {
|
|
2159
3053
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2160
3054
|
const len0 = WASM_VECTOR_LEN;
|
|
2161
|
-
const ret = wasm.
|
|
3055
|
+
const ret = wasm.hash_new_ripemd160_hmac(ptr0, len0);
|
|
2162
3056
|
if (ret[2]) {
|
|
2163
3057
|
throw takeFromExternrefTable0(ret[1]);
|
|
2164
3058
|
}
|
|
@@ -2168,36 +3062,30 @@ export class Hash {
|
|
|
2168
3062
|
* @param {Uint8Array} key
|
|
2169
3063
|
* @returns {Hash}
|
|
2170
3064
|
*/
|
|
2171
|
-
static
|
|
3065
|
+
static new_mdc2_hmac(key) {
|
|
2172
3066
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2173
3067
|
const len0 = WASM_VECTOR_LEN;
|
|
2174
|
-
const ret = wasm.
|
|
3068
|
+
const ret = wasm.hash_new_mdc2_hmac(ptr0, len0);
|
|
2175
3069
|
if (ret[2]) {
|
|
2176
3070
|
throw takeFromExternrefTable0(ret[1]);
|
|
2177
3071
|
}
|
|
2178
3072
|
return Hash.__wrap(ret[0]);
|
|
2179
3073
|
}
|
|
2180
3074
|
/**
|
|
2181
|
-
* @param {Uint8Array} key
|
|
2182
3075
|
* @returns {Hash}
|
|
2183
3076
|
*/
|
|
2184
|
-
static
|
|
2185
|
-
const
|
|
2186
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2187
|
-
const ret = wasm.hash_new_sha3_224_hmac(ptr0, len0);
|
|
3077
|
+
static new_mdc2() {
|
|
3078
|
+
const ret = wasm.hash_new_mdc2();
|
|
2188
3079
|
if (ret[2]) {
|
|
2189
3080
|
throw takeFromExternrefTable0(ret[1]);
|
|
2190
3081
|
}
|
|
2191
3082
|
return Hash.__wrap(ret[0]);
|
|
2192
3083
|
}
|
|
2193
3084
|
/**
|
|
2194
|
-
* @param {Uint8Array} key
|
|
2195
3085
|
* @returns {Hash}
|
|
2196
3086
|
*/
|
|
2197
|
-
static
|
|
2198
|
-
const
|
|
2199
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2200
|
-
const ret = wasm.hash_new_sha3_256_hmac(ptr0, len0);
|
|
3087
|
+
static new_whirlpool() {
|
|
3088
|
+
const ret = wasm.hash_new_whirlpool();
|
|
2201
3089
|
if (ret[2]) {
|
|
2202
3090
|
throw takeFromExternrefTable0(ret[1]);
|
|
2203
3091
|
}
|
|
@@ -2207,183 +3095,153 @@ export class Hash {
|
|
|
2207
3095
|
* @param {Uint8Array} key
|
|
2208
3096
|
* @returns {Hash}
|
|
2209
3097
|
*/
|
|
2210
|
-
static
|
|
3098
|
+
static new_whirlpool_hmac(key) {
|
|
2211
3099
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2212
3100
|
const len0 = WASM_VECTOR_LEN;
|
|
2213
|
-
const ret = wasm.
|
|
3101
|
+
const ret = wasm.hash_new_whirlpool_hmac(ptr0, len0);
|
|
2214
3102
|
if (ret[2]) {
|
|
2215
3103
|
throw takeFromExternrefTable0(ret[1]);
|
|
2216
3104
|
}
|
|
2217
3105
|
return Hash.__wrap(ret[0]);
|
|
2218
3106
|
}
|
|
2219
3107
|
/**
|
|
2220
|
-
* @param {Uint8Array} key
|
|
3108
|
+
* @param {Uint8Array | null | undefined} key
|
|
3109
|
+
* @param {number} output_len
|
|
2221
3110
|
* @returns {Hash}
|
|
2222
3111
|
*/
|
|
2223
|
-
static
|
|
3112
|
+
static new_blake2s(key, output_len) {
|
|
3113
|
+
var ptr0 = isLikeNone(key) ? 0 : passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3114
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3115
|
+
const ret = wasm.hash_new_blake2s(ptr0, len0, output_len);
|
|
3116
|
+
if (ret[2]) {
|
|
3117
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3118
|
+
}
|
|
3119
|
+
return Hash.__wrap(ret[0]);
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
if (Symbol.dispose) Hash.prototype[Symbol.dispose] = Hash.prototype.free;
|
|
3123
|
+
|
|
3124
|
+
const MacFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3125
|
+
? { register: () => {}, unregister: () => {} }
|
|
3126
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_mac_free(ptr >>> 0, 1));
|
|
3127
|
+
|
|
3128
|
+
export class Mac {
|
|
3129
|
+
|
|
3130
|
+
static __wrap(ptr) {
|
|
3131
|
+
ptr = ptr >>> 0;
|
|
3132
|
+
const obj = Object.create(Mac.prototype);
|
|
3133
|
+
obj.__wbg_ptr = ptr;
|
|
3134
|
+
MacFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3135
|
+
return obj;
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
__destroy_into_raw() {
|
|
3139
|
+
const ptr = this.__wbg_ptr;
|
|
3140
|
+
this.__wbg_ptr = 0;
|
|
3141
|
+
MacFinalization.unregister(this);
|
|
3142
|
+
return ptr;
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
free() {
|
|
3146
|
+
const ptr = this.__destroy_into_raw();
|
|
3147
|
+
wasm.__wbg_mac_free(ptr, 0);
|
|
3148
|
+
}
|
|
3149
|
+
/**
|
|
3150
|
+
* @param {Uint8Array} key
|
|
3151
|
+
* @param {Uint8Array} custom
|
|
3152
|
+
* @param {number} output_len
|
|
3153
|
+
* @returns {Mac}
|
|
3154
|
+
*/
|
|
3155
|
+
static new_kmac128(key, custom, output_len) {
|
|
2224
3156
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2225
3157
|
const len0 = WASM_VECTOR_LEN;
|
|
2226
|
-
const
|
|
3158
|
+
const ptr1 = passArray8ToWasm0(custom, wasm.__wbindgen_malloc);
|
|
3159
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3160
|
+
const ret = wasm.mac_new_kmac128(ptr0, len0, ptr1, len1, output_len);
|
|
2227
3161
|
if (ret[2]) {
|
|
2228
3162
|
throw takeFromExternrefTable0(ret[1]);
|
|
2229
3163
|
}
|
|
2230
|
-
return
|
|
3164
|
+
return Mac.__wrap(ret[0]);
|
|
2231
3165
|
}
|
|
2232
3166
|
/**
|
|
2233
3167
|
* @param {Uint8Array} key
|
|
2234
|
-
* @
|
|
3168
|
+
* @param {Uint8Array} custom
|
|
3169
|
+
* @param {number} output_len
|
|
3170
|
+
* @returns {Mac}
|
|
2235
3171
|
*/
|
|
2236
|
-
static
|
|
3172
|
+
static new_kmac256(key, custom, output_len) {
|
|
2237
3173
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2238
3174
|
const len0 = WASM_VECTOR_LEN;
|
|
2239
|
-
const
|
|
3175
|
+
const ptr1 = passArray8ToWasm0(custom, wasm.__wbindgen_malloc);
|
|
3176
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3177
|
+
const ret = wasm.mac_new_kmac256(ptr0, len0, ptr1, len1, output_len);
|
|
2240
3178
|
if (ret[2]) {
|
|
2241
3179
|
throw takeFromExternrefTable0(ret[1]);
|
|
2242
3180
|
}
|
|
2243
|
-
return
|
|
3181
|
+
return Mac.__wrap(ret[0]);
|
|
2244
3182
|
}
|
|
2245
3183
|
/**
|
|
2246
3184
|
* @param {Uint8Array} key
|
|
2247
|
-
* @
|
|
3185
|
+
* @param {number} output_len
|
|
3186
|
+
* @returns {Mac}
|
|
2248
3187
|
*/
|
|
2249
|
-
static
|
|
3188
|
+
static new_siphash(key, output_len) {
|
|
2250
3189
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2251
3190
|
const len0 = WASM_VECTOR_LEN;
|
|
2252
|
-
const ret = wasm.
|
|
3191
|
+
const ret = wasm.mac_new_siphash(ptr0, len0, output_len);
|
|
2253
3192
|
if (ret[2]) {
|
|
2254
3193
|
throw takeFromExternrefTable0(ret[1]);
|
|
2255
3194
|
}
|
|
2256
|
-
return
|
|
3195
|
+
return Mac.__wrap(ret[0]);
|
|
2257
3196
|
}
|
|
2258
3197
|
/**
|
|
2259
3198
|
* @param {Uint8Array} key
|
|
2260
|
-
* @returns {
|
|
3199
|
+
* @returns {Mac}
|
|
2261
3200
|
*/
|
|
2262
|
-
static
|
|
3201
|
+
static new_cmac_aes(key) {
|
|
2263
3202
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2264
3203
|
const len0 = WASM_VECTOR_LEN;
|
|
2265
|
-
const ret = wasm.
|
|
3204
|
+
const ret = wasm.mac_new_cmac_aes(ptr0, len0);
|
|
2266
3205
|
if (ret[2]) {
|
|
2267
3206
|
throw takeFromExternrefTable0(ret[1]);
|
|
2268
3207
|
}
|
|
2269
|
-
return
|
|
3208
|
+
return Mac.__wrap(ret[0]);
|
|
2270
3209
|
}
|
|
2271
3210
|
/**
|
|
2272
3211
|
* @param {Uint8Array} key
|
|
2273
|
-
* @
|
|
3212
|
+
* @param {Uint8Array} iv
|
|
3213
|
+
* @returns {Mac}
|
|
2274
3214
|
*/
|
|
2275
|
-
static
|
|
3215
|
+
static new_gmac_aes(key, iv) {
|
|
2276
3216
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2277
3217
|
const len0 = WASM_VECTOR_LEN;
|
|
2278
|
-
const
|
|
3218
|
+
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3219
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3220
|
+
const ret = wasm.mac_new_gmac_aes(ptr0, len0, ptr1, len1);
|
|
2279
3221
|
if (ret[2]) {
|
|
2280
3222
|
throw takeFromExternrefTable0(ret[1]);
|
|
2281
3223
|
}
|
|
2282
|
-
return
|
|
3224
|
+
return Mac.__wrap(ret[0]);
|
|
2283
3225
|
}
|
|
2284
3226
|
/**
|
|
2285
3227
|
* @returns {Uint8Array}
|
|
2286
3228
|
*/
|
|
2287
3229
|
sum() {
|
|
2288
|
-
const ret = wasm.
|
|
3230
|
+
const ret = wasm.mac_sum(this.__wbg_ptr);
|
|
2289
3231
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2290
3232
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2291
3233
|
return v1;
|
|
2292
3234
|
}
|
|
2293
|
-
/**
|
|
2294
|
-
* @param {Uint8Array} buf
|
|
2295
|
-
* @returns {number}
|
|
2296
|
-
*/
|
|
2297
|
-
read(buf) {
|
|
2298
|
-
var ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
|
|
2299
|
-
var len0 = WASM_VECTOR_LEN;
|
|
2300
|
-
const ret = wasm.hash_read(this.__wbg_ptr, ptr0, len0, buf);
|
|
2301
|
-
if (ret[2]) {
|
|
2302
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2303
|
-
}
|
|
2304
|
-
return ret[0] >>> 0;
|
|
2305
|
-
}
|
|
2306
|
-
/**
|
|
2307
|
-
* @returns {number}
|
|
2308
|
-
*/
|
|
2309
|
-
size() {
|
|
2310
|
-
const ret = wasm.hash_size(this.__wbg_ptr);
|
|
2311
|
-
return ret >>> 0;
|
|
2312
|
-
}
|
|
2313
|
-
flush() {
|
|
2314
|
-
const ret = wasm.hash_flush(this.__wbg_ptr);
|
|
2315
|
-
if (ret[1]) {
|
|
2316
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
2317
|
-
}
|
|
2318
|
-
}
|
|
2319
|
-
reset() {
|
|
2320
|
-
wasm.hash_reset(this.__wbg_ptr);
|
|
2321
|
-
}
|
|
2322
3235
|
/**
|
|
2323
3236
|
* @param {Uint8Array} data
|
|
2324
|
-
* @returns {number}
|
|
2325
3237
|
*/
|
|
2326
3238
|
write(data) {
|
|
2327
3239
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2328
3240
|
const len0 = WASM_VECTOR_LEN;
|
|
2329
|
-
|
|
2330
|
-
if (ret[2]) {
|
|
2331
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2332
|
-
}
|
|
2333
|
-
return ret[0] >>> 0;
|
|
2334
|
-
}
|
|
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]);
|
|
3241
|
+
wasm.mac_write(this.__wbg_ptr, ptr0, len0);
|
|
2384
3242
|
}
|
|
2385
3243
|
}
|
|
2386
|
-
if (Symbol.dispose)
|
|
3244
|
+
if (Symbol.dispose) Mac.prototype[Symbol.dispose] = Mac.prototype.free;
|
|
2387
3245
|
|
|
2388
3246
|
const StreamCipherFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2389
3247
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2413,14 +3271,15 @@ export class StreamCipher {
|
|
|
2413
3271
|
/**
|
|
2414
3272
|
* @param {Uint8Array} key
|
|
2415
3273
|
* @param {Uint8Array} iv
|
|
3274
|
+
* @param {number | null} [rounds]
|
|
2416
3275
|
* @returns {StreamCipher}
|
|
2417
3276
|
*/
|
|
2418
|
-
static
|
|
3277
|
+
static new_multi2_cfb(key, iv, rounds) {
|
|
2419
3278
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2420
3279
|
const len0 = WASM_VECTOR_LEN;
|
|
2421
3280
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2422
3281
|
const len1 = WASM_VECTOR_LEN;
|
|
2423
|
-
const ret = wasm.
|
|
3282
|
+
const ret = wasm.streamcipher_new_multi2_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2424
3283
|
if (ret[2]) {
|
|
2425
3284
|
throw takeFromExternrefTable0(ret[1]);
|
|
2426
3285
|
}
|
|
@@ -2429,14 +3288,15 @@ export class StreamCipher {
|
|
|
2429
3288
|
/**
|
|
2430
3289
|
* @param {Uint8Array} key
|
|
2431
3290
|
* @param {Uint8Array} iv
|
|
3291
|
+
* @param {number | null} [rounds]
|
|
2432
3292
|
* @returns {StreamCipher}
|
|
2433
3293
|
*/
|
|
2434
|
-
static
|
|
3294
|
+
static new_multi2_ctr(key, iv, rounds) {
|
|
2435
3295
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2436
3296
|
const len0 = WASM_VECTOR_LEN;
|
|
2437
3297
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2438
3298
|
const len1 = WASM_VECTOR_LEN;
|
|
2439
|
-
const ret = wasm.
|
|
3299
|
+
const ret = wasm.streamcipher_new_multi2_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
2440
3300
|
if (ret[2]) {
|
|
2441
3301
|
throw takeFromExternrefTable0(ret[1]);
|
|
2442
3302
|
}
|
|
@@ -2445,14 +3305,28 @@ export class StreamCipher {
|
|
|
2445
3305
|
/**
|
|
2446
3306
|
* @param {Uint8Array} key
|
|
2447
3307
|
* @param {Uint8Array} iv
|
|
3308
|
+
* @param {number | null} [rounds]
|
|
2448
3309
|
* @returns {StreamCipher}
|
|
2449
3310
|
*/
|
|
2450
|
-
static
|
|
3311
|
+
static new_multi2_ofb(key, iv, rounds) {
|
|
2451
3312
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2452
3313
|
const len0 = WASM_VECTOR_LEN;
|
|
2453
3314
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2454
3315
|
const len1 = WASM_VECTOR_LEN;
|
|
2455
|
-
const ret = wasm.
|
|
3316
|
+
const ret = wasm.streamcipher_new_multi2_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3317
|
+
if (ret[2]) {
|
|
3318
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3319
|
+
}
|
|
3320
|
+
return StreamCipher.__wrap(ret[0]);
|
|
3321
|
+
}
|
|
3322
|
+
/**
|
|
3323
|
+
* @param {Uint8Array} key
|
|
3324
|
+
* @returns {StreamCipher}
|
|
3325
|
+
*/
|
|
3326
|
+
static new_rc4(key) {
|
|
3327
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3328
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3329
|
+
const ret = wasm.streamcipher_new_rc4(ptr0, len0);
|
|
2456
3330
|
if (ret[2]) {
|
|
2457
3331
|
throw takeFromExternrefTable0(ret[1]);
|
|
2458
3332
|
}
|
|
@@ -2463,12 +3337,12 @@ export class StreamCipher {
|
|
|
2463
3337
|
* @param {Uint8Array} iv
|
|
2464
3338
|
* @returns {StreamCipher}
|
|
2465
3339
|
*/
|
|
2466
|
-
static
|
|
3340
|
+
static new_salsa20(key, iv) {
|
|
2467
3341
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2468
3342
|
const len0 = WASM_VECTOR_LEN;
|
|
2469
3343
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2470
3344
|
const len1 = WASM_VECTOR_LEN;
|
|
2471
|
-
const ret = wasm.
|
|
3345
|
+
const ret = wasm.streamcipher_new_salsa20(ptr0, len0, ptr1, len1);
|
|
2472
3346
|
if (ret[2]) {
|
|
2473
3347
|
throw takeFromExternrefTable0(ret[1]);
|
|
2474
3348
|
}
|
|
@@ -2479,12 +3353,12 @@ export class StreamCipher {
|
|
|
2479
3353
|
* @param {Uint8Array} iv
|
|
2480
3354
|
* @returns {StreamCipher}
|
|
2481
3355
|
*/
|
|
2482
|
-
static
|
|
3356
|
+
static new_chacha20(key, iv) {
|
|
2483
3357
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2484
3358
|
const len0 = WASM_VECTOR_LEN;
|
|
2485
3359
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2486
3360
|
const len1 = WASM_VECTOR_LEN;
|
|
2487
|
-
const ret = wasm.
|
|
3361
|
+
const ret = wasm.streamcipher_new_chacha20(ptr0, len0, ptr1, len1);
|
|
2488
3362
|
if (ret[2]) {
|
|
2489
3363
|
throw takeFromExternrefTable0(ret[1]);
|
|
2490
3364
|
}
|
|
@@ -2495,12 +3369,12 @@ export class StreamCipher {
|
|
|
2495
3369
|
* @param {Uint8Array} iv
|
|
2496
3370
|
* @returns {StreamCipher}
|
|
2497
3371
|
*/
|
|
2498
|
-
static
|
|
3372
|
+
static new_rabbit(key, iv) {
|
|
2499
3373
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2500
3374
|
const len0 = WASM_VECTOR_LEN;
|
|
2501
3375
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2502
3376
|
const len1 = WASM_VECTOR_LEN;
|
|
2503
|
-
const ret = wasm.
|
|
3377
|
+
const ret = wasm.streamcipher_new_rabbit(ptr0, len0, ptr1, len1);
|
|
2504
3378
|
if (ret[2]) {
|
|
2505
3379
|
throw takeFromExternrefTable0(ret[1]);
|
|
2506
3380
|
}
|
|
@@ -2511,12 +3385,12 @@ export class StreamCipher {
|
|
|
2511
3385
|
* @param {Uint8Array} iv
|
|
2512
3386
|
* @returns {StreamCipher}
|
|
2513
3387
|
*/
|
|
2514
|
-
static
|
|
3388
|
+
static new_sosemanuk(key, iv) {
|
|
2515
3389
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2516
3390
|
const len0 = WASM_VECTOR_LEN;
|
|
2517
3391
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2518
3392
|
const len1 = WASM_VECTOR_LEN;
|
|
2519
|
-
const ret = wasm.
|
|
3393
|
+
const ret = wasm.streamcipher_new_sosemanuk(ptr0, len0, ptr1, len1);
|
|
2520
3394
|
if (ret[2]) {
|
|
2521
3395
|
throw takeFromExternrefTable0(ret[1]);
|
|
2522
3396
|
}
|
|
@@ -2525,32 +3399,52 @@ export class StreamCipher {
|
|
|
2525
3399
|
/**
|
|
2526
3400
|
* @param {Uint8Array} key
|
|
2527
3401
|
* @param {Uint8Array} iv
|
|
2528
|
-
* @param {number | null} [rounds]
|
|
2529
3402
|
* @returns {StreamCipher}
|
|
2530
3403
|
*/
|
|
2531
|
-
static
|
|
3404
|
+
static new_sober128(key, iv) {
|
|
2532
3405
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2533
3406
|
const len0 = WASM_VECTOR_LEN;
|
|
2534
3407
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2535
3408
|
const len1 = WASM_VECTOR_LEN;
|
|
2536
|
-
const ret = wasm.
|
|
3409
|
+
const ret = wasm.streamcipher_new_sober128(ptr0, len0, ptr1, len1);
|
|
2537
3410
|
if (ret[2]) {
|
|
2538
3411
|
throw takeFromExternrefTable0(ret[1]);
|
|
2539
3412
|
}
|
|
2540
3413
|
return StreamCipher.__wrap(ret[0]);
|
|
2541
3414
|
}
|
|
3415
|
+
/**
|
|
3416
|
+
* @param {Uint8Array} data
|
|
3417
|
+
*/
|
|
3418
|
+
decrypt(data) {
|
|
3419
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
3420
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3421
|
+
const ret = wasm.streamcipher_decrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
3422
|
+
if (ret[1]) {
|
|
3423
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
/**
|
|
3427
|
+
* @param {Uint8Array} data
|
|
3428
|
+
*/
|
|
3429
|
+
encrypt(data) {
|
|
3430
|
+
var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
3431
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3432
|
+
const ret = wasm.streamcipher_encrypt(this.__wbg_ptr, ptr0, len0, data);
|
|
3433
|
+
if (ret[1]) {
|
|
3434
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
2542
3437
|
/**
|
|
2543
3438
|
* @param {Uint8Array} key
|
|
2544
3439
|
* @param {Uint8Array} iv
|
|
2545
|
-
* @param {number | null} [rounds]
|
|
2546
3440
|
* @returns {StreamCipher}
|
|
2547
3441
|
*/
|
|
2548
|
-
static
|
|
3442
|
+
static new_aes_cfb(key, iv) {
|
|
2549
3443
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2550
3444
|
const len0 = WASM_VECTOR_LEN;
|
|
2551
3445
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2552
3446
|
const len1 = WASM_VECTOR_LEN;
|
|
2553
|
-
const ret = wasm.
|
|
3447
|
+
const ret = wasm.streamcipher_new_aes_cfb(ptr0, len0, ptr1, len1);
|
|
2554
3448
|
if (ret[2]) {
|
|
2555
3449
|
throw takeFromExternrefTable0(ret[1]);
|
|
2556
3450
|
}
|
|
@@ -2559,15 +3453,14 @@ export class StreamCipher {
|
|
|
2559
3453
|
/**
|
|
2560
3454
|
* @param {Uint8Array} key
|
|
2561
3455
|
* @param {Uint8Array} iv
|
|
2562
|
-
* @param {number | null} [rounds]
|
|
2563
3456
|
* @returns {StreamCipher}
|
|
2564
3457
|
*/
|
|
2565
|
-
static
|
|
3458
|
+
static new_aes_ctr(key, iv) {
|
|
2566
3459
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2567
3460
|
const len0 = WASM_VECTOR_LEN;
|
|
2568
3461
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2569
3462
|
const len1 = WASM_VECTOR_LEN;
|
|
2570
|
-
const ret = wasm.
|
|
3463
|
+
const ret = wasm.streamcipher_new_aes_ctr(ptr0, len0, ptr1, len1);
|
|
2571
3464
|
if (ret[2]) {
|
|
2572
3465
|
throw takeFromExternrefTable0(ret[1]);
|
|
2573
3466
|
}
|
|
@@ -2576,15 +3469,14 @@ export class StreamCipher {
|
|
|
2576
3469
|
/**
|
|
2577
3470
|
* @param {Uint8Array} key
|
|
2578
3471
|
* @param {Uint8Array} iv
|
|
2579
|
-
* @param {number | null} [rounds]
|
|
2580
3472
|
* @returns {StreamCipher}
|
|
2581
3473
|
*/
|
|
2582
|
-
static
|
|
3474
|
+
static new_aes_ofb(key, iv) {
|
|
2583
3475
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2584
3476
|
const len0 = WASM_VECTOR_LEN;
|
|
2585
3477
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2586
3478
|
const len1 = WASM_VECTOR_LEN;
|
|
2587
|
-
const ret = wasm.
|
|
3479
|
+
const ret = wasm.streamcipher_new_aes_ofb(ptr0, len0, ptr1, len1);
|
|
2588
3480
|
if (ret[2]) {
|
|
2589
3481
|
throw takeFromExternrefTable0(ret[1]);
|
|
2590
3482
|
}
|
|
@@ -2593,15 +3485,14 @@ export class StreamCipher {
|
|
|
2593
3485
|
/**
|
|
2594
3486
|
* @param {Uint8Array} key
|
|
2595
3487
|
* @param {Uint8Array} iv
|
|
2596
|
-
* @param {number | null} [rounds]
|
|
2597
3488
|
* @returns {StreamCipher}
|
|
2598
3489
|
*/
|
|
2599
|
-
static
|
|
3490
|
+
static new_aria_cfb(key, iv) {
|
|
2600
3491
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2601
3492
|
const len0 = WASM_VECTOR_LEN;
|
|
2602
3493
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2603
3494
|
const len1 = WASM_VECTOR_LEN;
|
|
2604
|
-
const ret = wasm.
|
|
3495
|
+
const ret = wasm.streamcipher_new_aria_cfb(ptr0, len0, ptr1, len1);
|
|
2605
3496
|
if (ret[2]) {
|
|
2606
3497
|
throw takeFromExternrefTable0(ret[1]);
|
|
2607
3498
|
}
|
|
@@ -2610,15 +3501,14 @@ export class StreamCipher {
|
|
|
2610
3501
|
/**
|
|
2611
3502
|
* @param {Uint8Array} key
|
|
2612
3503
|
* @param {Uint8Array} iv
|
|
2613
|
-
* @param {number | null} [rounds]
|
|
2614
3504
|
* @returns {StreamCipher}
|
|
2615
3505
|
*/
|
|
2616
|
-
static
|
|
3506
|
+
static new_aria_ctr(key, iv) {
|
|
2617
3507
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2618
3508
|
const len0 = WASM_VECTOR_LEN;
|
|
2619
3509
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2620
3510
|
const len1 = WASM_VECTOR_LEN;
|
|
2621
|
-
const ret = wasm.
|
|
3511
|
+
const ret = wasm.streamcipher_new_aria_ctr(ptr0, len0, ptr1, len1);
|
|
2622
3512
|
if (ret[2]) {
|
|
2623
3513
|
throw takeFromExternrefTable0(ret[1]);
|
|
2624
3514
|
}
|
|
@@ -2629,12 +3519,12 @@ export class StreamCipher {
|
|
|
2629
3519
|
* @param {Uint8Array} iv
|
|
2630
3520
|
* @returns {StreamCipher}
|
|
2631
3521
|
*/
|
|
2632
|
-
static
|
|
3522
|
+
static new_aria_ofb(key, iv) {
|
|
2633
3523
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2634
3524
|
const len0 = WASM_VECTOR_LEN;
|
|
2635
3525
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2636
3526
|
const len1 = WASM_VECTOR_LEN;
|
|
2637
|
-
const ret = wasm.
|
|
3527
|
+
const ret = wasm.streamcipher_new_aria_ofb(ptr0, len0, ptr1, len1);
|
|
2638
3528
|
if (ret[2]) {
|
|
2639
3529
|
throw takeFromExternrefTable0(ret[1]);
|
|
2640
3530
|
}
|
|
@@ -2645,12 +3535,12 @@ export class StreamCipher {
|
|
|
2645
3535
|
* @param {Uint8Array} iv
|
|
2646
3536
|
* @returns {StreamCipher}
|
|
2647
3537
|
*/
|
|
2648
|
-
static
|
|
3538
|
+
static new_blowfish_cfb(key, iv) {
|
|
2649
3539
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2650
3540
|
const len0 = WASM_VECTOR_LEN;
|
|
2651
3541
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2652
3542
|
const len1 = WASM_VECTOR_LEN;
|
|
2653
|
-
const ret = wasm.
|
|
3543
|
+
const ret = wasm.streamcipher_new_blowfish_cfb(ptr0, len0, ptr1, len1);
|
|
2654
3544
|
if (ret[2]) {
|
|
2655
3545
|
throw takeFromExternrefTable0(ret[1]);
|
|
2656
3546
|
}
|
|
@@ -2661,12 +3551,12 @@ export class StreamCipher {
|
|
|
2661
3551
|
* @param {Uint8Array} iv
|
|
2662
3552
|
* @returns {StreamCipher}
|
|
2663
3553
|
*/
|
|
2664
|
-
static
|
|
3554
|
+
static new_blowfish_ctr(key, iv) {
|
|
2665
3555
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2666
3556
|
const len0 = WASM_VECTOR_LEN;
|
|
2667
3557
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2668
3558
|
const len1 = WASM_VECTOR_LEN;
|
|
2669
|
-
const ret = wasm.
|
|
3559
|
+
const ret = wasm.streamcipher_new_blowfish_ctr(ptr0, len0, ptr1, len1);
|
|
2670
3560
|
if (ret[2]) {
|
|
2671
3561
|
throw takeFromExternrefTable0(ret[1]);
|
|
2672
3562
|
}
|
|
@@ -2677,12 +3567,12 @@ export class StreamCipher {
|
|
|
2677
3567
|
* @param {Uint8Array} iv
|
|
2678
3568
|
* @returns {StreamCipher}
|
|
2679
3569
|
*/
|
|
2680
|
-
static
|
|
3570
|
+
static new_blowfish_ofb(key, iv) {
|
|
2681
3571
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2682
3572
|
const len0 = WASM_VECTOR_LEN;
|
|
2683
3573
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2684
3574
|
const len1 = WASM_VECTOR_LEN;
|
|
2685
|
-
const ret = wasm.
|
|
3575
|
+
const ret = wasm.streamcipher_new_blowfish_ofb(ptr0, len0, ptr1, len1);
|
|
2686
3576
|
if (ret[2]) {
|
|
2687
3577
|
throw takeFromExternrefTable0(ret[1]);
|
|
2688
3578
|
}
|
|
@@ -2693,12 +3583,12 @@ export class StreamCipher {
|
|
|
2693
3583
|
* @param {Uint8Array} iv
|
|
2694
3584
|
* @returns {StreamCipher}
|
|
2695
3585
|
*/
|
|
2696
|
-
static
|
|
3586
|
+
static new_cast5_cfb(key, iv) {
|
|
2697
3587
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2698
3588
|
const len0 = WASM_VECTOR_LEN;
|
|
2699
3589
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2700
3590
|
const len1 = WASM_VECTOR_LEN;
|
|
2701
|
-
const ret = wasm.
|
|
3591
|
+
const ret = wasm.streamcipher_new_cast5_cfb(ptr0, len0, ptr1, len1);
|
|
2702
3592
|
if (ret[2]) {
|
|
2703
3593
|
throw takeFromExternrefTable0(ret[1]);
|
|
2704
3594
|
}
|
|
@@ -2709,12 +3599,12 @@ export class StreamCipher {
|
|
|
2709
3599
|
* @param {Uint8Array} iv
|
|
2710
3600
|
* @returns {StreamCipher}
|
|
2711
3601
|
*/
|
|
2712
|
-
static
|
|
3602
|
+
static new_cast5_ctr(key, iv) {
|
|
2713
3603
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2714
3604
|
const len0 = WASM_VECTOR_LEN;
|
|
2715
3605
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2716
3606
|
const len1 = WASM_VECTOR_LEN;
|
|
2717
|
-
const ret = wasm.
|
|
3607
|
+
const ret = wasm.streamcipher_new_cast5_ctr(ptr0, len0, ptr1, len1);
|
|
2718
3608
|
if (ret[2]) {
|
|
2719
3609
|
throw takeFromExternrefTable0(ret[1]);
|
|
2720
3610
|
}
|
|
@@ -2725,12 +3615,12 @@ export class StreamCipher {
|
|
|
2725
3615
|
* @param {Uint8Array} iv
|
|
2726
3616
|
* @returns {StreamCipher}
|
|
2727
3617
|
*/
|
|
2728
|
-
static
|
|
3618
|
+
static new_cast5_ofb(key, iv) {
|
|
2729
3619
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2730
3620
|
const len0 = WASM_VECTOR_LEN;
|
|
2731
3621
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2732
3622
|
const len1 = WASM_VECTOR_LEN;
|
|
2733
|
-
const ret = wasm.
|
|
3623
|
+
const ret = wasm.streamcipher_new_cast5_ofb(ptr0, len0, ptr1, len1);
|
|
2734
3624
|
if (ret[2]) {
|
|
2735
3625
|
throw takeFromExternrefTable0(ret[1]);
|
|
2736
3626
|
}
|
|
@@ -2741,12 +3631,12 @@ export class StreamCipher {
|
|
|
2741
3631
|
* @param {Uint8Array} iv
|
|
2742
3632
|
* @returns {StreamCipher}
|
|
2743
3633
|
*/
|
|
2744
|
-
static
|
|
3634
|
+
static new_des_cfb(key, iv) {
|
|
2745
3635
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2746
3636
|
const len0 = WASM_VECTOR_LEN;
|
|
2747
3637
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2748
3638
|
const len1 = WASM_VECTOR_LEN;
|
|
2749
|
-
const ret = wasm.
|
|
3639
|
+
const ret = wasm.streamcipher_new_des_cfb(ptr0, len0, ptr1, len1);
|
|
2750
3640
|
if (ret[2]) {
|
|
2751
3641
|
throw takeFromExternrefTable0(ret[1]);
|
|
2752
3642
|
}
|
|
@@ -2757,12 +3647,28 @@ export class StreamCipher {
|
|
|
2757
3647
|
* @param {Uint8Array} iv
|
|
2758
3648
|
* @returns {StreamCipher}
|
|
2759
3649
|
*/
|
|
2760
|
-
static
|
|
3650
|
+
static new_des_ctr(key, iv) {
|
|
3651
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3652
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3653
|
+
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3654
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3655
|
+
const ret = wasm.streamcipher_new_des_ctr(ptr0, len0, ptr1, len1);
|
|
3656
|
+
if (ret[2]) {
|
|
3657
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3658
|
+
}
|
|
3659
|
+
return StreamCipher.__wrap(ret[0]);
|
|
3660
|
+
}
|
|
3661
|
+
/**
|
|
3662
|
+
* @param {Uint8Array} key
|
|
3663
|
+
* @param {Uint8Array} iv
|
|
3664
|
+
* @returns {StreamCipher}
|
|
3665
|
+
*/
|
|
3666
|
+
static new_des_ofb(key, iv) {
|
|
2761
3667
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2762
3668
|
const len0 = WASM_VECTOR_LEN;
|
|
2763
3669
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2764
3670
|
const len1 = WASM_VECTOR_LEN;
|
|
2765
|
-
const ret = wasm.
|
|
3671
|
+
const ret = wasm.streamcipher_new_des_ofb(ptr0, len0, ptr1, len1);
|
|
2766
3672
|
if (ret[2]) {
|
|
2767
3673
|
throw takeFromExternrefTable0(ret[1]);
|
|
2768
3674
|
}
|
|
@@ -2773,12 +3679,12 @@ export class StreamCipher {
|
|
|
2773
3679
|
* @param {Uint8Array} iv
|
|
2774
3680
|
* @returns {StreamCipher}
|
|
2775
3681
|
*/
|
|
2776
|
-
static
|
|
3682
|
+
static new_tripledes_cfb(key, iv) {
|
|
2777
3683
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2778
3684
|
const len0 = WASM_VECTOR_LEN;
|
|
2779
3685
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2780
3686
|
const len1 = WASM_VECTOR_LEN;
|
|
2781
|
-
const ret = wasm.
|
|
3687
|
+
const ret = wasm.streamcipher_new_tripledes_cfb(ptr0, len0, ptr1, len1);
|
|
2782
3688
|
if (ret[2]) {
|
|
2783
3689
|
throw takeFromExternrefTable0(ret[1]);
|
|
2784
3690
|
}
|
|
@@ -2789,12 +3695,12 @@ export class StreamCipher {
|
|
|
2789
3695
|
* @param {Uint8Array} iv
|
|
2790
3696
|
* @returns {StreamCipher}
|
|
2791
3697
|
*/
|
|
2792
|
-
static
|
|
3698
|
+
static new_tripledes_ctr(key, iv) {
|
|
2793
3699
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2794
3700
|
const len0 = WASM_VECTOR_LEN;
|
|
2795
3701
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2796
3702
|
const len1 = WASM_VECTOR_LEN;
|
|
2797
|
-
const ret = wasm.
|
|
3703
|
+
const ret = wasm.streamcipher_new_tripledes_ctr(ptr0, len0, ptr1, len1);
|
|
2798
3704
|
if (ret[2]) {
|
|
2799
3705
|
throw takeFromExternrefTable0(ret[1]);
|
|
2800
3706
|
}
|
|
@@ -2805,12 +3711,12 @@ export class StreamCipher {
|
|
|
2805
3711
|
* @param {Uint8Array} iv
|
|
2806
3712
|
* @returns {StreamCipher}
|
|
2807
3713
|
*/
|
|
2808
|
-
static
|
|
3714
|
+
static new_tripledes_ofb(key, iv) {
|
|
2809
3715
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2810
3716
|
const len0 = WASM_VECTOR_LEN;
|
|
2811
3717
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2812
3718
|
const len1 = WASM_VECTOR_LEN;
|
|
2813
|
-
const ret = wasm.
|
|
3719
|
+
const ret = wasm.streamcipher_new_tripledes_ofb(ptr0, len0, ptr1, len1);
|
|
2814
3720
|
if (ret[2]) {
|
|
2815
3721
|
throw takeFromExternrefTable0(ret[1]);
|
|
2816
3722
|
}
|
|
@@ -2821,12 +3727,12 @@ export class StreamCipher {
|
|
|
2821
3727
|
* @param {Uint8Array} iv
|
|
2822
3728
|
* @returns {StreamCipher}
|
|
2823
3729
|
*/
|
|
2824
|
-
static
|
|
3730
|
+
static new_tea_cfb(key, iv) {
|
|
2825
3731
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2826
3732
|
const len0 = WASM_VECTOR_LEN;
|
|
2827
3733
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2828
3734
|
const len1 = WASM_VECTOR_LEN;
|
|
2829
|
-
const ret = wasm.
|
|
3735
|
+
const ret = wasm.streamcipher_new_tea_cfb(ptr0, len0, ptr1, len1);
|
|
2830
3736
|
if (ret[2]) {
|
|
2831
3737
|
throw takeFromExternrefTable0(ret[1]);
|
|
2832
3738
|
}
|
|
@@ -2837,12 +3743,12 @@ export class StreamCipher {
|
|
|
2837
3743
|
* @param {Uint8Array} iv
|
|
2838
3744
|
* @returns {StreamCipher}
|
|
2839
3745
|
*/
|
|
2840
|
-
static
|
|
3746
|
+
static new_tea_ctr(key, iv) {
|
|
2841
3747
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2842
3748
|
const len0 = WASM_VECTOR_LEN;
|
|
2843
3749
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2844
3750
|
const len1 = WASM_VECTOR_LEN;
|
|
2845
|
-
const ret = wasm.
|
|
3751
|
+
const ret = wasm.streamcipher_new_tea_ctr(ptr0, len0, ptr1, len1);
|
|
2846
3752
|
if (ret[2]) {
|
|
2847
3753
|
throw takeFromExternrefTable0(ret[1]);
|
|
2848
3754
|
}
|
|
@@ -2853,12 +3759,12 @@ export class StreamCipher {
|
|
|
2853
3759
|
* @param {Uint8Array} iv
|
|
2854
3760
|
* @returns {StreamCipher}
|
|
2855
3761
|
*/
|
|
2856
|
-
static
|
|
3762
|
+
static new_tea_ofb(key, iv) {
|
|
2857
3763
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2858
3764
|
const len0 = WASM_VECTOR_LEN;
|
|
2859
3765
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2860
3766
|
const len1 = WASM_VECTOR_LEN;
|
|
2861
|
-
const ret = wasm.
|
|
3767
|
+
const ret = wasm.streamcipher_new_tea_ofb(ptr0, len0, ptr1, len1);
|
|
2862
3768
|
if (ret[2]) {
|
|
2863
3769
|
throw takeFromExternrefTable0(ret[1]);
|
|
2864
3770
|
}
|
|
@@ -2869,12 +3775,12 @@ export class StreamCipher {
|
|
|
2869
3775
|
* @param {Uint8Array} iv
|
|
2870
3776
|
* @returns {StreamCipher}
|
|
2871
3777
|
*/
|
|
2872
|
-
static
|
|
3778
|
+
static new_twofish_cfb(key, iv) {
|
|
2873
3779
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2874
3780
|
const len0 = WASM_VECTOR_LEN;
|
|
2875
3781
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2876
3782
|
const len1 = WASM_VECTOR_LEN;
|
|
2877
|
-
const ret = wasm.
|
|
3783
|
+
const ret = wasm.streamcipher_new_twofish_cfb(ptr0, len0, ptr1, len1);
|
|
2878
3784
|
if (ret[2]) {
|
|
2879
3785
|
throw takeFromExternrefTable0(ret[1]);
|
|
2880
3786
|
}
|
|
@@ -2885,12 +3791,12 @@ export class StreamCipher {
|
|
|
2885
3791
|
* @param {Uint8Array} iv
|
|
2886
3792
|
* @returns {StreamCipher}
|
|
2887
3793
|
*/
|
|
2888
|
-
static
|
|
3794
|
+
static new_twofish_ctr(key, iv) {
|
|
2889
3795
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2890
3796
|
const len0 = WASM_VECTOR_LEN;
|
|
2891
3797
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2892
3798
|
const len1 = WASM_VECTOR_LEN;
|
|
2893
|
-
const ret = wasm.
|
|
3799
|
+
const ret = wasm.streamcipher_new_twofish_ctr(ptr0, len0, ptr1, len1);
|
|
2894
3800
|
if (ret[2]) {
|
|
2895
3801
|
throw takeFromExternrefTable0(ret[1]);
|
|
2896
3802
|
}
|
|
@@ -2901,12 +3807,12 @@ export class StreamCipher {
|
|
|
2901
3807
|
* @param {Uint8Array} iv
|
|
2902
3808
|
* @returns {StreamCipher}
|
|
2903
3809
|
*/
|
|
2904
|
-
static
|
|
3810
|
+
static new_twofish_ofb(key, iv) {
|
|
2905
3811
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2906
3812
|
const len0 = WASM_VECTOR_LEN;
|
|
2907
3813
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2908
3814
|
const len1 = WASM_VECTOR_LEN;
|
|
2909
|
-
const ret = wasm.
|
|
3815
|
+
const ret = wasm.streamcipher_new_twofish_ofb(ptr0, len0, ptr1, len1);
|
|
2910
3816
|
if (ret[2]) {
|
|
2911
3817
|
throw takeFromExternrefTable0(ret[1]);
|
|
2912
3818
|
}
|
|
@@ -2965,12 +3871,12 @@ export class StreamCipher {
|
|
|
2965
3871
|
* @param {Uint8Array} iv
|
|
2966
3872
|
* @returns {StreamCipher}
|
|
2967
3873
|
*/
|
|
2968
|
-
static
|
|
3874
|
+
static new_idea_cfb(key, iv) {
|
|
2969
3875
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2970
3876
|
const len0 = WASM_VECTOR_LEN;
|
|
2971
3877
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2972
3878
|
const len1 = WASM_VECTOR_LEN;
|
|
2973
|
-
const ret = wasm.
|
|
3879
|
+
const ret = wasm.streamcipher_new_idea_cfb(ptr0, len0, ptr1, len1);
|
|
2974
3880
|
if (ret[2]) {
|
|
2975
3881
|
throw takeFromExternrefTable0(ret[1]);
|
|
2976
3882
|
}
|
|
@@ -2981,12 +3887,12 @@ export class StreamCipher {
|
|
|
2981
3887
|
* @param {Uint8Array} iv
|
|
2982
3888
|
* @returns {StreamCipher}
|
|
2983
3889
|
*/
|
|
2984
|
-
static
|
|
3890
|
+
static new_idea_ctr(key, iv) {
|
|
2985
3891
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2986
3892
|
const len0 = WASM_VECTOR_LEN;
|
|
2987
3893
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2988
3894
|
const len1 = WASM_VECTOR_LEN;
|
|
2989
|
-
const ret = wasm.
|
|
3895
|
+
const ret = wasm.streamcipher_new_idea_ctr(ptr0, len0, ptr1, len1);
|
|
2990
3896
|
if (ret[2]) {
|
|
2991
3897
|
throw takeFromExternrefTable0(ret[1]);
|
|
2992
3898
|
}
|
|
@@ -2997,12 +3903,12 @@ export class StreamCipher {
|
|
|
2997
3903
|
* @param {Uint8Array} iv
|
|
2998
3904
|
* @returns {StreamCipher}
|
|
2999
3905
|
*/
|
|
3000
|
-
static
|
|
3906
|
+
static new_idea_ofb(key, iv) {
|
|
3001
3907
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3002
3908
|
const len0 = WASM_VECTOR_LEN;
|
|
3003
3909
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3004
3910
|
const len1 = WASM_VECTOR_LEN;
|
|
3005
|
-
const ret = wasm.
|
|
3911
|
+
const ret = wasm.streamcipher_new_idea_ofb(ptr0, len0, ptr1, len1);
|
|
3006
3912
|
if (ret[2]) {
|
|
3007
3913
|
throw takeFromExternrefTable0(ret[1]);
|
|
3008
3914
|
}
|
|
@@ -3013,12 +3919,12 @@ export class StreamCipher {
|
|
|
3013
3919
|
* @param {Uint8Array} iv
|
|
3014
3920
|
* @returns {StreamCipher}
|
|
3015
3921
|
*/
|
|
3016
|
-
static
|
|
3922
|
+
static new_rc6_cfb(key, iv) {
|
|
3017
3923
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3018
3924
|
const len0 = WASM_VECTOR_LEN;
|
|
3019
3925
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3020
3926
|
const len1 = WASM_VECTOR_LEN;
|
|
3021
|
-
const ret = wasm.
|
|
3927
|
+
const ret = wasm.streamcipher_new_rc6_cfb(ptr0, len0, ptr1, len1);
|
|
3022
3928
|
if (ret[2]) {
|
|
3023
3929
|
throw takeFromExternrefTable0(ret[1]);
|
|
3024
3930
|
}
|
|
@@ -3029,12 +3935,12 @@ export class StreamCipher {
|
|
|
3029
3935
|
* @param {Uint8Array} iv
|
|
3030
3936
|
* @returns {StreamCipher}
|
|
3031
3937
|
*/
|
|
3032
|
-
static
|
|
3938
|
+
static new_rc6_ctr(key, iv) {
|
|
3033
3939
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3034
3940
|
const len0 = WASM_VECTOR_LEN;
|
|
3035
3941
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3036
3942
|
const len1 = WASM_VECTOR_LEN;
|
|
3037
|
-
const ret = wasm.
|
|
3943
|
+
const ret = wasm.streamcipher_new_rc6_ctr(ptr0, len0, ptr1, len1);
|
|
3038
3944
|
if (ret[2]) {
|
|
3039
3945
|
throw takeFromExternrefTable0(ret[1]);
|
|
3040
3946
|
}
|
|
@@ -3045,12 +3951,12 @@ export class StreamCipher {
|
|
|
3045
3951
|
* @param {Uint8Array} iv
|
|
3046
3952
|
* @returns {StreamCipher}
|
|
3047
3953
|
*/
|
|
3048
|
-
static
|
|
3954
|
+
static new_rc6_ofb(key, iv) {
|
|
3049
3955
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3050
3956
|
const len0 = WASM_VECTOR_LEN;
|
|
3051
3957
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3052
3958
|
const len1 = WASM_VECTOR_LEN;
|
|
3053
|
-
const ret = wasm.
|
|
3959
|
+
const ret = wasm.streamcipher_new_rc6_ofb(ptr0, len0, ptr1, len1);
|
|
3054
3960
|
if (ret[2]) {
|
|
3055
3961
|
throw takeFromExternrefTable0(ret[1]);
|
|
3056
3962
|
}
|
|
@@ -3061,12 +3967,12 @@ export class StreamCipher {
|
|
|
3061
3967
|
* @param {Uint8Array} iv
|
|
3062
3968
|
* @returns {StreamCipher}
|
|
3063
3969
|
*/
|
|
3064
|
-
static
|
|
3970
|
+
static new_sm4_cfb(key, iv) {
|
|
3065
3971
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3066
3972
|
const len0 = WASM_VECTOR_LEN;
|
|
3067
3973
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3068
3974
|
const len1 = WASM_VECTOR_LEN;
|
|
3069
|
-
const ret = wasm.
|
|
3975
|
+
const ret = wasm.streamcipher_new_sm4_cfb(ptr0, len0, ptr1, len1);
|
|
3070
3976
|
if (ret[2]) {
|
|
3071
3977
|
throw takeFromExternrefTable0(ret[1]);
|
|
3072
3978
|
}
|
|
@@ -3077,12 +3983,12 @@ export class StreamCipher {
|
|
|
3077
3983
|
* @param {Uint8Array} iv
|
|
3078
3984
|
* @returns {StreamCipher}
|
|
3079
3985
|
*/
|
|
3080
|
-
static
|
|
3986
|
+
static new_sm4_ctr(key, iv) {
|
|
3081
3987
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3082
3988
|
const len0 = WASM_VECTOR_LEN;
|
|
3083
3989
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3084
3990
|
const len1 = WASM_VECTOR_LEN;
|
|
3085
|
-
const ret = wasm.
|
|
3991
|
+
const ret = wasm.streamcipher_new_sm4_ctr(ptr0, len0, ptr1, len1);
|
|
3086
3992
|
if (ret[2]) {
|
|
3087
3993
|
throw takeFromExternrefTable0(ret[1]);
|
|
3088
3994
|
}
|
|
@@ -3093,12 +3999,12 @@ export class StreamCipher {
|
|
|
3093
3999
|
* @param {Uint8Array} iv
|
|
3094
4000
|
* @returns {StreamCipher}
|
|
3095
4001
|
*/
|
|
3096
|
-
static
|
|
4002
|
+
static new_sm4_ofb(key, iv) {
|
|
3097
4003
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3098
4004
|
const len0 = WASM_VECTOR_LEN;
|
|
3099
4005
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3100
4006
|
const len1 = WASM_VECTOR_LEN;
|
|
3101
|
-
const ret = wasm.
|
|
4007
|
+
const ret = wasm.streamcipher_new_sm4_ofb(ptr0, len0, ptr1, len1);
|
|
3102
4008
|
if (ret[2]) {
|
|
3103
4009
|
throw takeFromExternrefTable0(ret[1]);
|
|
3104
4010
|
}
|
|
@@ -3109,12 +4015,12 @@ export class StreamCipher {
|
|
|
3109
4015
|
* @param {Uint8Array} iv
|
|
3110
4016
|
* @returns {StreamCipher}
|
|
3111
4017
|
*/
|
|
3112
|
-
static
|
|
4018
|
+
static new_skipjack_cfb(key, iv) {
|
|
3113
4019
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3114
4020
|
const len0 = WASM_VECTOR_LEN;
|
|
3115
4021
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3116
4022
|
const len1 = WASM_VECTOR_LEN;
|
|
3117
|
-
const ret = wasm.
|
|
4023
|
+
const ret = wasm.streamcipher_new_skipjack_cfb(ptr0, len0, ptr1, len1);
|
|
3118
4024
|
if (ret[2]) {
|
|
3119
4025
|
throw takeFromExternrefTable0(ret[1]);
|
|
3120
4026
|
}
|
|
@@ -3125,12 +4031,12 @@ export class StreamCipher {
|
|
|
3125
4031
|
* @param {Uint8Array} iv
|
|
3126
4032
|
* @returns {StreamCipher}
|
|
3127
4033
|
*/
|
|
3128
|
-
static
|
|
4034
|
+
static new_skipjack_ctr(key, iv) {
|
|
3129
4035
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3130
4036
|
const len0 = WASM_VECTOR_LEN;
|
|
3131
4037
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3132
4038
|
const len1 = WASM_VECTOR_LEN;
|
|
3133
|
-
const ret = wasm.
|
|
4039
|
+
const ret = wasm.streamcipher_new_skipjack_ctr(ptr0, len0, ptr1, len1);
|
|
3134
4040
|
if (ret[2]) {
|
|
3135
4041
|
throw takeFromExternrefTable0(ret[1]);
|
|
3136
4042
|
}
|
|
@@ -3141,12 +4047,12 @@ export class StreamCipher {
|
|
|
3141
4047
|
* @param {Uint8Array} iv
|
|
3142
4048
|
* @returns {StreamCipher}
|
|
3143
4049
|
*/
|
|
3144
|
-
static
|
|
4050
|
+
static new_skipjack_ofb(key, iv) {
|
|
3145
4051
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3146
4052
|
const len0 = WASM_VECTOR_LEN;
|
|
3147
4053
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3148
4054
|
const len1 = WASM_VECTOR_LEN;
|
|
3149
|
-
const ret = wasm.
|
|
4055
|
+
const ret = wasm.streamcipher_new_skipjack_ofb(ptr0, len0, ptr1, len1);
|
|
3150
4056
|
if (ret[2]) {
|
|
3151
4057
|
throw takeFromExternrefTable0(ret[1]);
|
|
3152
4058
|
}
|
|
@@ -3157,12 +4063,12 @@ export class StreamCipher {
|
|
|
3157
4063
|
* @param {Uint8Array} iv
|
|
3158
4064
|
* @returns {StreamCipher}
|
|
3159
4065
|
*/
|
|
3160
|
-
static
|
|
4066
|
+
static new_kasumi_cfb(key, iv) {
|
|
3161
4067
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3162
4068
|
const len0 = WASM_VECTOR_LEN;
|
|
3163
4069
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3164
4070
|
const len1 = WASM_VECTOR_LEN;
|
|
3165
|
-
const ret = wasm.
|
|
4071
|
+
const ret = wasm.streamcipher_new_kasumi_cfb(ptr0, len0, ptr1, len1);
|
|
3166
4072
|
if (ret[2]) {
|
|
3167
4073
|
throw takeFromExternrefTable0(ret[1]);
|
|
3168
4074
|
}
|
|
@@ -3173,12 +4079,12 @@ export class StreamCipher {
|
|
|
3173
4079
|
* @param {Uint8Array} iv
|
|
3174
4080
|
* @returns {StreamCipher}
|
|
3175
4081
|
*/
|
|
3176
|
-
static
|
|
4082
|
+
static new_kasumi_ctr(key, iv) {
|
|
3177
4083
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3178
4084
|
const len0 = WASM_VECTOR_LEN;
|
|
3179
4085
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3180
4086
|
const len1 = WASM_VECTOR_LEN;
|
|
3181
|
-
const ret = wasm.
|
|
4087
|
+
const ret = wasm.streamcipher_new_kasumi_ctr(ptr0, len0, ptr1, len1);
|
|
3182
4088
|
if (ret[2]) {
|
|
3183
4089
|
throw takeFromExternrefTable0(ret[1]);
|
|
3184
4090
|
}
|
|
@@ -3189,12 +4095,12 @@ export class StreamCipher {
|
|
|
3189
4095
|
* @param {Uint8Array} iv
|
|
3190
4096
|
* @returns {StreamCipher}
|
|
3191
4097
|
*/
|
|
3192
|
-
static
|
|
4098
|
+
static new_kasumi_ofb(key, iv) {
|
|
3193
4099
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3194
4100
|
const len0 = WASM_VECTOR_LEN;
|
|
3195
4101
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3196
4102
|
const len1 = WASM_VECTOR_LEN;
|
|
3197
|
-
const ret = wasm.
|
|
4103
|
+
const ret = wasm.streamcipher_new_kasumi_ofb(ptr0, len0, ptr1, len1);
|
|
3198
4104
|
if (ret[2]) {
|
|
3199
4105
|
throw takeFromExternrefTable0(ret[1]);
|
|
3200
4106
|
}
|
|
@@ -3205,12 +4111,12 @@ export class StreamCipher {
|
|
|
3205
4111
|
* @param {Uint8Array} iv
|
|
3206
4112
|
* @returns {StreamCipher}
|
|
3207
4113
|
*/
|
|
3208
|
-
static
|
|
4114
|
+
static new_kseed_cfb(key, iv) {
|
|
3209
4115
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3210
4116
|
const len0 = WASM_VECTOR_LEN;
|
|
3211
4117
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3212
4118
|
const len1 = WASM_VECTOR_LEN;
|
|
3213
|
-
const ret = wasm.
|
|
4119
|
+
const ret = wasm.streamcipher_new_kseed_cfb(ptr0, len0, ptr1, len1);
|
|
3214
4120
|
if (ret[2]) {
|
|
3215
4121
|
throw takeFromExternrefTable0(ret[1]);
|
|
3216
4122
|
}
|
|
@@ -3219,15 +4125,14 @@ export class StreamCipher {
|
|
|
3219
4125
|
/**
|
|
3220
4126
|
* @param {Uint8Array} key
|
|
3221
4127
|
* @param {Uint8Array} iv
|
|
3222
|
-
* @param {number | null} [rounds]
|
|
3223
4128
|
* @returns {StreamCipher}
|
|
3224
4129
|
*/
|
|
3225
|
-
static
|
|
4130
|
+
static new_kseed_ctr(key, iv) {
|
|
3226
4131
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3227
4132
|
const len0 = WASM_VECTOR_LEN;
|
|
3228
4133
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3229
4134
|
const len1 = WASM_VECTOR_LEN;
|
|
3230
|
-
const ret = wasm.
|
|
4135
|
+
const ret = wasm.streamcipher_new_kseed_ctr(ptr0, len0, ptr1, len1);
|
|
3231
4136
|
if (ret[2]) {
|
|
3232
4137
|
throw takeFromExternrefTable0(ret[1]);
|
|
3233
4138
|
}
|
|
@@ -3236,15 +4141,14 @@ export class StreamCipher {
|
|
|
3236
4141
|
/**
|
|
3237
4142
|
* @param {Uint8Array} key
|
|
3238
4143
|
* @param {Uint8Array} iv
|
|
3239
|
-
* @param {number | null} [rounds]
|
|
3240
4144
|
* @returns {StreamCipher}
|
|
3241
4145
|
*/
|
|
3242
|
-
static
|
|
4146
|
+
static new_kseed_ofb(key, iv) {
|
|
3243
4147
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3244
4148
|
const len0 = WASM_VECTOR_LEN;
|
|
3245
4149
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3246
4150
|
const len1 = WASM_VECTOR_LEN;
|
|
3247
|
-
const ret = wasm.
|
|
4151
|
+
const ret = wasm.streamcipher_new_kseed_ofb(ptr0, len0, ptr1, len1);
|
|
3248
4152
|
if (ret[2]) {
|
|
3249
4153
|
throw takeFromExternrefTable0(ret[1]);
|
|
3250
4154
|
}
|
|
@@ -3253,15 +4157,14 @@ export class StreamCipher {
|
|
|
3253
4157
|
/**
|
|
3254
4158
|
* @param {Uint8Array} key
|
|
3255
4159
|
* @param {Uint8Array} iv
|
|
3256
|
-
* @param {number | null} [rounds]
|
|
3257
4160
|
* @returns {StreamCipher}
|
|
3258
4161
|
*/
|
|
3259
|
-
static
|
|
4162
|
+
static new_anubis_cfb(key, iv) {
|
|
3260
4163
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3261
4164
|
const len0 = WASM_VECTOR_LEN;
|
|
3262
4165
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3263
4166
|
const len1 = WASM_VECTOR_LEN;
|
|
3264
|
-
const ret = wasm.
|
|
4167
|
+
const ret = wasm.streamcipher_new_anubis_cfb(ptr0, len0, ptr1, len1);
|
|
3265
4168
|
if (ret[2]) {
|
|
3266
4169
|
throw takeFromExternrefTable0(ret[1]);
|
|
3267
4170
|
}
|
|
@@ -3272,12 +4175,12 @@ export class StreamCipher {
|
|
|
3272
4175
|
* @param {Uint8Array} iv
|
|
3273
4176
|
* @returns {StreamCipher}
|
|
3274
4177
|
*/
|
|
3275
|
-
static
|
|
4178
|
+
static new_anubis_ctr(key, iv) {
|
|
3276
4179
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3277
4180
|
const len0 = WASM_VECTOR_LEN;
|
|
3278
4181
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3279
4182
|
const len1 = WASM_VECTOR_LEN;
|
|
3280
|
-
const ret = wasm.
|
|
4183
|
+
const ret = wasm.streamcipher_new_anubis_ctr(ptr0, len0, ptr1, len1);
|
|
3281
4184
|
if (ret[2]) {
|
|
3282
4185
|
throw takeFromExternrefTable0(ret[1]);
|
|
3283
4186
|
}
|
|
@@ -3288,12 +4191,12 @@ export class StreamCipher {
|
|
|
3288
4191
|
* @param {Uint8Array} iv
|
|
3289
4192
|
* @returns {StreamCipher}
|
|
3290
4193
|
*/
|
|
3291
|
-
static
|
|
4194
|
+
static new_anubis_ofb(key, iv) {
|
|
3292
4195
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3293
4196
|
const len0 = WASM_VECTOR_LEN;
|
|
3294
4197
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3295
4198
|
const len1 = WASM_VECTOR_LEN;
|
|
3296
|
-
const ret = wasm.
|
|
4199
|
+
const ret = wasm.streamcipher_new_anubis_ofb(ptr0, len0, ptr1, len1);
|
|
3297
4200
|
if (ret[2]) {
|
|
3298
4201
|
throw takeFromExternrefTable0(ret[1]);
|
|
3299
4202
|
}
|
|
@@ -3304,12 +4207,12 @@ export class StreamCipher {
|
|
|
3304
4207
|
* @param {Uint8Array} iv
|
|
3305
4208
|
* @returns {StreamCipher}
|
|
3306
4209
|
*/
|
|
3307
|
-
static
|
|
4210
|
+
static new_noekeon_cfb(key, iv) {
|
|
3308
4211
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3309
4212
|
const len0 = WASM_VECTOR_LEN;
|
|
3310
4213
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3311
4214
|
const len1 = WASM_VECTOR_LEN;
|
|
3312
|
-
const ret = wasm.
|
|
4215
|
+
const ret = wasm.streamcipher_new_noekeon_cfb(ptr0, len0, ptr1, len1);
|
|
3313
4216
|
if (ret[2]) {
|
|
3314
4217
|
throw takeFromExternrefTable0(ret[1]);
|
|
3315
4218
|
}
|
|
@@ -3320,12 +4223,12 @@ export class StreamCipher {
|
|
|
3320
4223
|
* @param {Uint8Array} iv
|
|
3321
4224
|
* @returns {StreamCipher}
|
|
3322
4225
|
*/
|
|
3323
|
-
static
|
|
4226
|
+
static new_noekeon_ctr(key, iv) {
|
|
3324
4227
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3325
4228
|
const len0 = WASM_VECTOR_LEN;
|
|
3326
4229
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3327
4230
|
const len1 = WASM_VECTOR_LEN;
|
|
3328
|
-
const ret = wasm.
|
|
4231
|
+
const ret = wasm.streamcipher_new_noekeon_ctr(ptr0, len0, ptr1, len1);
|
|
3329
4232
|
if (ret[2]) {
|
|
3330
4233
|
throw takeFromExternrefTable0(ret[1]);
|
|
3331
4234
|
}
|
|
@@ -3336,12 +4239,12 @@ export class StreamCipher {
|
|
|
3336
4239
|
* @param {Uint8Array} iv
|
|
3337
4240
|
* @returns {StreamCipher}
|
|
3338
4241
|
*/
|
|
3339
|
-
static
|
|
4242
|
+
static new_noekeon_ofb(key, iv) {
|
|
3340
4243
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3341
4244
|
const len0 = WASM_VECTOR_LEN;
|
|
3342
4245
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3343
4246
|
const len1 = WASM_VECTOR_LEN;
|
|
3344
|
-
const ret = wasm.
|
|
4247
|
+
const ret = wasm.streamcipher_new_noekeon_ofb(ptr0, len0, ptr1, len1);
|
|
3345
4248
|
if (ret[2]) {
|
|
3346
4249
|
throw takeFromExternrefTable0(ret[1]);
|
|
3347
4250
|
}
|
|
@@ -3352,12 +4255,12 @@ export class StreamCipher {
|
|
|
3352
4255
|
* @param {Uint8Array} iv
|
|
3353
4256
|
* @returns {StreamCipher}
|
|
3354
4257
|
*/
|
|
3355
|
-
static
|
|
4258
|
+
static new_khazad_cfb(key, iv) {
|
|
3356
4259
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3357
4260
|
const len0 = WASM_VECTOR_LEN;
|
|
3358
4261
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3359
4262
|
const len1 = WASM_VECTOR_LEN;
|
|
3360
|
-
const ret = wasm.
|
|
4263
|
+
const ret = wasm.streamcipher_new_khazad_cfb(ptr0, len0, ptr1, len1);
|
|
3361
4264
|
if (ret[2]) {
|
|
3362
4265
|
throw takeFromExternrefTable0(ret[1]);
|
|
3363
4266
|
}
|
|
@@ -3368,12 +4271,12 @@ export class StreamCipher {
|
|
|
3368
4271
|
* @param {Uint8Array} iv
|
|
3369
4272
|
* @returns {StreamCipher}
|
|
3370
4273
|
*/
|
|
3371
|
-
static
|
|
4274
|
+
static new_khazad_ctr(key, iv) {
|
|
3372
4275
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3373
4276
|
const len0 = WASM_VECTOR_LEN;
|
|
3374
4277
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3375
4278
|
const len1 = WASM_VECTOR_LEN;
|
|
3376
|
-
const ret = wasm.
|
|
4279
|
+
const ret = wasm.streamcipher_new_khazad_ctr(ptr0, len0, ptr1, len1);
|
|
3377
4280
|
if (ret[2]) {
|
|
3378
4281
|
throw takeFromExternrefTable0(ret[1]);
|
|
3379
4282
|
}
|
|
@@ -3384,12 +4287,12 @@ export class StreamCipher {
|
|
|
3384
4287
|
* @param {Uint8Array} iv
|
|
3385
4288
|
* @returns {StreamCipher}
|
|
3386
4289
|
*/
|
|
3387
|
-
static
|
|
4290
|
+
static new_khazad_ofb(key, iv) {
|
|
3388
4291
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3389
4292
|
const len0 = WASM_VECTOR_LEN;
|
|
3390
4293
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3391
4294
|
const len1 = WASM_VECTOR_LEN;
|
|
3392
|
-
const ret = wasm.
|
|
4295
|
+
const ret = wasm.streamcipher_new_khazad_ofb(ptr0, len0, ptr1, len1);
|
|
3393
4296
|
if (ret[2]) {
|
|
3394
4297
|
throw takeFromExternrefTable0(ret[1]);
|
|
3395
4298
|
}
|
|
@@ -3400,12 +4303,12 @@ export class StreamCipher {
|
|
|
3400
4303
|
* @param {Uint8Array} iv
|
|
3401
4304
|
* @returns {StreamCipher}
|
|
3402
4305
|
*/
|
|
3403
|
-
static
|
|
4306
|
+
static new_serpent_cfb(key, iv) {
|
|
3404
4307
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3405
4308
|
const len0 = WASM_VECTOR_LEN;
|
|
3406
4309
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3407
4310
|
const len1 = WASM_VECTOR_LEN;
|
|
3408
|
-
const ret = wasm.
|
|
4311
|
+
const ret = wasm.streamcipher_new_serpent_cfb(ptr0, len0, ptr1, len1);
|
|
3409
4312
|
if (ret[2]) {
|
|
3410
4313
|
throw takeFromExternrefTable0(ret[1]);
|
|
3411
4314
|
}
|
|
@@ -3416,12 +4319,12 @@ export class StreamCipher {
|
|
|
3416
4319
|
* @param {Uint8Array} iv
|
|
3417
4320
|
* @returns {StreamCipher}
|
|
3418
4321
|
*/
|
|
3419
|
-
static
|
|
4322
|
+
static new_serpent_ctr(key, iv) {
|
|
3420
4323
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3421
4324
|
const len0 = WASM_VECTOR_LEN;
|
|
3422
4325
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3423
4326
|
const len1 = WASM_VECTOR_LEN;
|
|
3424
|
-
const ret = wasm.
|
|
4327
|
+
const ret = wasm.streamcipher_new_serpent_ctr(ptr0, len0, ptr1, len1);
|
|
3425
4328
|
if (ret[2]) {
|
|
3426
4329
|
throw takeFromExternrefTable0(ret[1]);
|
|
3427
4330
|
}
|
|
@@ -3432,12 +4335,12 @@ export class StreamCipher {
|
|
|
3432
4335
|
* @param {Uint8Array} iv
|
|
3433
4336
|
* @returns {StreamCipher}
|
|
3434
4337
|
*/
|
|
3435
|
-
static
|
|
4338
|
+
static new_serpent_ofb(key, iv) {
|
|
3436
4339
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3437
4340
|
const len0 = WASM_VECTOR_LEN;
|
|
3438
4341
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3439
4342
|
const len1 = WASM_VECTOR_LEN;
|
|
3440
|
-
const ret = wasm.
|
|
4343
|
+
const ret = wasm.streamcipher_new_serpent_ofb(ptr0, len0, ptr1, len1);
|
|
3441
4344
|
if (ret[2]) {
|
|
3442
4345
|
throw takeFromExternrefTable0(ret[1]);
|
|
3443
4346
|
}
|
|
@@ -3446,14 +4349,15 @@ export class StreamCipher {
|
|
|
3446
4349
|
/**
|
|
3447
4350
|
* @param {Uint8Array} key
|
|
3448
4351
|
* @param {Uint8Array} iv
|
|
4352
|
+
* @param {number | null} [rounds]
|
|
3449
4353
|
* @returns {StreamCipher}
|
|
3450
4354
|
*/
|
|
3451
|
-
static
|
|
4355
|
+
static new_rc2_cfb(key, iv, rounds) {
|
|
3452
4356
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3453
4357
|
const len0 = WASM_VECTOR_LEN;
|
|
3454
4358
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3455
4359
|
const len1 = WASM_VECTOR_LEN;
|
|
3456
|
-
const ret = wasm.
|
|
4360
|
+
const ret = wasm.streamcipher_new_rc2_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3457
4361
|
if (ret[2]) {
|
|
3458
4362
|
throw takeFromExternrefTable0(ret[1]);
|
|
3459
4363
|
}
|
|
@@ -3465,12 +4369,12 @@ export class StreamCipher {
|
|
|
3465
4369
|
* @param {number | null} [rounds]
|
|
3466
4370
|
* @returns {StreamCipher}
|
|
3467
4371
|
*/
|
|
3468
|
-
static
|
|
4372
|
+
static new_rc2_ctr(key, iv, rounds) {
|
|
3469
4373
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3470
4374
|
const len0 = WASM_VECTOR_LEN;
|
|
3471
4375
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3472
4376
|
const len1 = WASM_VECTOR_LEN;
|
|
3473
|
-
const ret = wasm.
|
|
4377
|
+
const ret = wasm.streamcipher_new_rc2_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3474
4378
|
if (ret[2]) {
|
|
3475
4379
|
throw takeFromExternrefTable0(ret[1]);
|
|
3476
4380
|
}
|
|
@@ -3482,12 +4386,12 @@ export class StreamCipher {
|
|
|
3482
4386
|
* @param {number | null} [rounds]
|
|
3483
4387
|
* @returns {StreamCipher}
|
|
3484
4388
|
*/
|
|
3485
|
-
static
|
|
4389
|
+
static new_rc2_ofb(key, iv, rounds) {
|
|
3486
4390
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3487
4391
|
const len0 = WASM_VECTOR_LEN;
|
|
3488
4392
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3489
4393
|
const len1 = WASM_VECTOR_LEN;
|
|
3490
|
-
const ret = wasm.
|
|
4394
|
+
const ret = wasm.streamcipher_new_rc2_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3491
4395
|
if (ret[2]) {
|
|
3492
4396
|
throw takeFromExternrefTable0(ret[1]);
|
|
3493
4397
|
}
|
|
@@ -3499,12 +4403,12 @@ export class StreamCipher {
|
|
|
3499
4403
|
* @param {number | null} [rounds]
|
|
3500
4404
|
* @returns {StreamCipher}
|
|
3501
4405
|
*/
|
|
3502
|
-
static
|
|
4406
|
+
static new_rc5_cfb(key, iv, rounds) {
|
|
3503
4407
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3504
4408
|
const len0 = WASM_VECTOR_LEN;
|
|
3505
4409
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3506
4410
|
const len1 = WASM_VECTOR_LEN;
|
|
3507
|
-
const ret = wasm.
|
|
4411
|
+
const ret = wasm.streamcipher_new_rc5_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3508
4412
|
if (ret[2]) {
|
|
3509
4413
|
throw takeFromExternrefTable0(ret[1]);
|
|
3510
4414
|
}
|
|
@@ -3513,14 +4417,15 @@ export class StreamCipher {
|
|
|
3513
4417
|
/**
|
|
3514
4418
|
* @param {Uint8Array} key
|
|
3515
4419
|
* @param {Uint8Array} iv
|
|
4420
|
+
* @param {number | null} [rounds]
|
|
3516
4421
|
* @returns {StreamCipher}
|
|
3517
4422
|
*/
|
|
3518
|
-
static
|
|
4423
|
+
static new_rc5_ctr(key, iv, rounds) {
|
|
3519
4424
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3520
4425
|
const len0 = WASM_VECTOR_LEN;
|
|
3521
4426
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3522
4427
|
const len1 = WASM_VECTOR_LEN;
|
|
3523
|
-
const ret = wasm.
|
|
4428
|
+
const ret = wasm.streamcipher_new_rc5_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3524
4429
|
if (ret[2]) {
|
|
3525
4430
|
throw takeFromExternrefTable0(ret[1]);
|
|
3526
4431
|
}
|
|
@@ -3529,14 +4434,15 @@ export class StreamCipher {
|
|
|
3529
4434
|
/**
|
|
3530
4435
|
* @param {Uint8Array} key
|
|
3531
4436
|
* @param {Uint8Array} iv
|
|
4437
|
+
* @param {number | null} [rounds]
|
|
3532
4438
|
* @returns {StreamCipher}
|
|
3533
4439
|
*/
|
|
3534
|
-
static
|
|
4440
|
+
static new_rc5_ofb(key, iv, rounds) {
|
|
3535
4441
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3536
4442
|
const len0 = WASM_VECTOR_LEN;
|
|
3537
4443
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3538
4444
|
const len1 = WASM_VECTOR_LEN;
|
|
3539
|
-
const ret = wasm.
|
|
4445
|
+
const ret = wasm.streamcipher_new_rc5_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3540
4446
|
if (ret[2]) {
|
|
3541
4447
|
throw takeFromExternrefTable0(ret[1]);
|
|
3542
4448
|
}
|
|
@@ -3545,14 +4451,15 @@ export class StreamCipher {
|
|
|
3545
4451
|
/**
|
|
3546
4452
|
* @param {Uint8Array} key
|
|
3547
4453
|
* @param {Uint8Array} iv
|
|
4454
|
+
* @param {number | null} [rounds]
|
|
3548
4455
|
* @returns {StreamCipher}
|
|
3549
4456
|
*/
|
|
3550
|
-
static
|
|
4457
|
+
static new_camellia_cfb(key, iv, rounds) {
|
|
3551
4458
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3552
4459
|
const len0 = WASM_VECTOR_LEN;
|
|
3553
4460
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3554
4461
|
const len1 = WASM_VECTOR_LEN;
|
|
3555
|
-
const ret = wasm.
|
|
4462
|
+
const ret = wasm.streamcipher_new_camellia_cfb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3556
4463
|
if (ret[2]) {
|
|
3557
4464
|
throw takeFromExternrefTable0(ret[1]);
|
|
3558
4465
|
}
|
|
@@ -3561,14 +4468,15 @@ export class StreamCipher {
|
|
|
3561
4468
|
/**
|
|
3562
4469
|
* @param {Uint8Array} key
|
|
3563
4470
|
* @param {Uint8Array} iv
|
|
4471
|
+
* @param {number | null} [rounds]
|
|
3564
4472
|
* @returns {StreamCipher}
|
|
3565
4473
|
*/
|
|
3566
|
-
static
|
|
4474
|
+
static new_camellia_ctr(key, iv, rounds) {
|
|
3567
4475
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3568
4476
|
const len0 = WASM_VECTOR_LEN;
|
|
3569
4477
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3570
4478
|
const len1 = WASM_VECTOR_LEN;
|
|
3571
|
-
const ret = wasm.
|
|
4479
|
+
const ret = wasm.streamcipher_new_camellia_ctr(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3572
4480
|
if (ret[2]) {
|
|
3573
4481
|
throw takeFromExternrefTable0(ret[1]);
|
|
3574
4482
|
}
|
|
@@ -3577,72 +4485,121 @@ export class StreamCipher {
|
|
|
3577
4485
|
/**
|
|
3578
4486
|
* @param {Uint8Array} key
|
|
3579
4487
|
* @param {Uint8Array} iv
|
|
4488
|
+
* @param {number | null} [rounds]
|
|
3580
4489
|
* @returns {StreamCipher}
|
|
3581
4490
|
*/
|
|
3582
|
-
static
|
|
4491
|
+
static new_camellia_ofb(key, iv, rounds) {
|
|
3583
4492
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3584
4493
|
const len0 = WASM_VECTOR_LEN;
|
|
3585
4494
|
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
3586
4495
|
const len1 = WASM_VECTOR_LEN;
|
|
3587
|
-
const ret = wasm.
|
|
4496
|
+
const ret = wasm.streamcipher_new_camellia_ofb(ptr0, len0, ptr1, len1, isLikeNone(rounds) ? 0x100000001 : (rounds) >>> 0);
|
|
3588
4497
|
if (ret[2]) {
|
|
3589
4498
|
throw takeFromExternrefTable0(ret[1]);
|
|
3590
4499
|
}
|
|
3591
4500
|
return StreamCipher.__wrap(ret[0]);
|
|
3592
4501
|
}
|
|
4502
|
+
}
|
|
4503
|
+
if (Symbol.dispose) StreamCipher.prototype[Symbol.dispose] = StreamCipher.prototype.free;
|
|
4504
|
+
|
|
4505
|
+
const XtsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4506
|
+
? { register: () => {}, unregister: () => {} }
|
|
4507
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_xts_free(ptr >>> 0, 1));
|
|
4508
|
+
|
|
4509
|
+
export class Xts {
|
|
4510
|
+
|
|
4511
|
+
static __wrap(ptr) {
|
|
4512
|
+
ptr = ptr >>> 0;
|
|
4513
|
+
const obj = Object.create(Xts.prototype);
|
|
4514
|
+
obj.__wbg_ptr = ptr;
|
|
4515
|
+
XtsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
4516
|
+
return obj;
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4519
|
+
__destroy_into_raw() {
|
|
4520
|
+
const ptr = this.__wbg_ptr;
|
|
4521
|
+
this.__wbg_ptr = 0;
|
|
4522
|
+
XtsFinalization.unregister(this);
|
|
4523
|
+
return ptr;
|
|
4524
|
+
}
|
|
4525
|
+
|
|
4526
|
+
free() {
|
|
4527
|
+
const ptr = this.__destroy_into_raw();
|
|
4528
|
+
wasm.__wbg_xts_free(ptr, 0);
|
|
4529
|
+
}
|
|
3593
4530
|
/**
|
|
3594
4531
|
* @param {Uint8Array} key
|
|
3595
|
-
* @
|
|
3596
|
-
* @returns {StreamCipher}
|
|
4532
|
+
* @returns {Xts}
|
|
3597
4533
|
*/
|
|
3598
|
-
static
|
|
4534
|
+
static new_sm4_gb(key) {
|
|
3599
4535
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3600
4536
|
const len0 = WASM_VECTOR_LEN;
|
|
3601
|
-
const
|
|
3602
|
-
const len1 = WASM_VECTOR_LEN;
|
|
3603
|
-
const ret = wasm.streamcipher_new_tripledes_ofb(ptr0, len0, ptr1, len1);
|
|
4537
|
+
const ret = wasm.xts_new_sm4_gb(ptr0, len0);
|
|
3604
4538
|
if (ret[2]) {
|
|
3605
4539
|
throw takeFromExternrefTable0(ret[1]);
|
|
3606
4540
|
}
|
|
3607
|
-
return
|
|
4541
|
+
return Xts.__wrap(ret[0]);
|
|
3608
4542
|
}
|
|
3609
4543
|
/**
|
|
4544
|
+
* @param {Uint8Array} tweak
|
|
3610
4545
|
* @param {Uint8Array} data
|
|
3611
4546
|
*/
|
|
3612
|
-
decrypt(data) {
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
4547
|
+
decrypt(tweak, data) {
|
|
4548
|
+
const ptr0 = passArray8ToWasm0(tweak, wasm.__wbindgen_malloc);
|
|
4549
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4550
|
+
var ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
4551
|
+
var len1 = WASM_VECTOR_LEN;
|
|
4552
|
+
const ret = wasm.xts_decrypt(this.__wbg_ptr, ptr0, len0, ptr1, len1, data);
|
|
3616
4553
|
if (ret[1]) {
|
|
3617
4554
|
throw takeFromExternrefTable0(ret[0]);
|
|
3618
4555
|
}
|
|
3619
4556
|
}
|
|
3620
4557
|
/**
|
|
4558
|
+
* @param {Uint8Array} tweak
|
|
3621
4559
|
* @param {Uint8Array} data
|
|
3622
4560
|
*/
|
|
3623
|
-
encrypt(data) {
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
4561
|
+
encrypt(tweak, data) {
|
|
4562
|
+
const ptr0 = passArray8ToWasm0(tweak, wasm.__wbindgen_malloc);
|
|
4563
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4564
|
+
var ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
4565
|
+
var len1 = WASM_VECTOR_LEN;
|
|
4566
|
+
const ret = wasm.xts_encrypt(this.__wbg_ptr, ptr0, len0, ptr1, len1, data);
|
|
3627
4567
|
if (ret[1]) {
|
|
3628
4568
|
throw takeFromExternrefTable0(ret[0]);
|
|
3629
4569
|
}
|
|
3630
4570
|
}
|
|
3631
4571
|
/**
|
|
3632
4572
|
* @param {Uint8Array} key
|
|
3633
|
-
* @returns {
|
|
4573
|
+
* @returns {Xts}
|
|
3634
4574
|
*/
|
|
3635
|
-
static
|
|
4575
|
+
static new_aes(key) {
|
|
3636
4576
|
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3637
4577
|
const len0 = WASM_VECTOR_LEN;
|
|
3638
|
-
const ret = wasm.
|
|
4578
|
+
const ret = wasm.xts_new_aes(ptr0, len0);
|
|
3639
4579
|
if (ret[2]) {
|
|
3640
4580
|
throw takeFromExternrefTable0(ret[1]);
|
|
3641
4581
|
}
|
|
3642
|
-
return
|
|
4582
|
+
return Xts.__wrap(ret[0]);
|
|
4583
|
+
}
|
|
4584
|
+
/**
|
|
4585
|
+
* @param {Uint8Array} key
|
|
4586
|
+
* @returns {Xts}
|
|
4587
|
+
*/
|
|
4588
|
+
static new_sm4(key) {
|
|
4589
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
4590
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4591
|
+
const ret = wasm.xts_new_sm4(ptr0, len0);
|
|
4592
|
+
if (ret[2]) {
|
|
4593
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4594
|
+
}
|
|
4595
|
+
return Xts.__wrap(ret[0]);
|
|
3643
4596
|
}
|
|
3644
4597
|
}
|
|
3645
|
-
if (Symbol.dispose)
|
|
4598
|
+
if (Symbol.dispose) Xts.prototype[Symbol.dispose] = Xts.prototype.free;
|
|
4599
|
+
|
|
4600
|
+
export function __wbg_getRandomValues_3c9c0d586e575a16() { return handleError(function (arg0, arg1) {
|
|
4601
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
4602
|
+
}, arguments) };
|
|
3646
4603
|
|
|
3647
4604
|
export function __wbg_wbindgencopytotypedarray_d105febdb9374ca3(arg0, arg1, arg2) {
|
|
3648
4605
|
new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));
|
|
@@ -3659,7 +4616,7 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
|
3659
4616
|
};
|
|
3660
4617
|
|
|
3661
4618
|
export function __wbindgen_init_externref_table() {
|
|
3662
|
-
const table = wasm.
|
|
4619
|
+
const table = wasm.__wbindgen_export_2;
|
|
3663
4620
|
const offset = table.grow(4);
|
|
3664
4621
|
table.set(0, undefined);
|
|
3665
4622
|
table.set(offset + 0, undefined);
|