@cathaysia/crown-wasm 0.22.0 → 0.23.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 +6 -0
- package/crown_wasm_bg.js +92 -0
- package/crown_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/crown_wasm.d.ts
CHANGED
|
@@ -13,12 +13,14 @@ export class AeadCipher {
|
|
|
13
13
|
static new_sm4_gcm(key: Uint8Array): AeadCipher;
|
|
14
14
|
static new_tea_gcm(key: Uint8Array): AeadCipher;
|
|
15
15
|
static new_aes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
16
|
+
static new_aria_gcm(key: Uint8Array): AeadCipher;
|
|
16
17
|
static new_des_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
17
18
|
static new_idea_gcm(key: Uint8Array): AeadCipher;
|
|
18
19
|
static new_rc6_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
19
20
|
static new_sm4_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
20
21
|
static new_tea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
21
22
|
static new_xtea_gcm(key: Uint8Array): AeadCipher;
|
|
23
|
+
static new_aria_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
22
24
|
static new_cast5_gcm(key: Uint8Array): AeadCipher;
|
|
23
25
|
static new_idea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
24
26
|
static new_kseed_gcm(key: Uint8Array): AeadCipher;
|
|
@@ -62,6 +64,7 @@ export class BlockCipher {
|
|
|
62
64
|
static new_rc6_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
63
65
|
static new_sm4_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
64
66
|
static new_tea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
67
|
+
static new_aria_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
65
68
|
static new_idea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
66
69
|
static new_xtea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
67
70
|
static new_cast5_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
@@ -155,6 +158,9 @@ export class StreamCipher {
|
|
|
155
158
|
static new_tea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
156
159
|
static new_tea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
157
160
|
static new_tea_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
161
|
+
static new_aria_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
162
|
+
static new_aria_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
163
|
+
static new_aria_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
158
164
|
static new_chacha20(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
159
165
|
static new_idea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
160
166
|
static new_idea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
package/crown_wasm_bg.js
CHANGED
|
@@ -198,6 +198,19 @@ export class AeadCipher {
|
|
|
198
198
|
}
|
|
199
199
|
return AeadCipher.__wrap(ret[0]);
|
|
200
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* @param {Uint8Array} key
|
|
203
|
+
* @returns {AeadCipher}
|
|
204
|
+
*/
|
|
205
|
+
static new_aria_gcm(key) {
|
|
206
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
207
|
+
const len0 = WASM_VECTOR_LEN;
|
|
208
|
+
const ret = wasm.aeadcipher_new_aria_gcm(ptr0, len0);
|
|
209
|
+
if (ret[2]) {
|
|
210
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
211
|
+
}
|
|
212
|
+
return AeadCipher.__wrap(ret[0]);
|
|
213
|
+
}
|
|
201
214
|
/**
|
|
202
215
|
* @param {Uint8Array} key
|
|
203
216
|
* @param {number} tag_size
|
|
@@ -284,6 +297,21 @@ export class AeadCipher {
|
|
|
284
297
|
}
|
|
285
298
|
return AeadCipher.__wrap(ret[0]);
|
|
286
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* @param {Uint8Array} key
|
|
302
|
+
* @param {number} tag_size
|
|
303
|
+
* @param {number} nonce_size
|
|
304
|
+
* @returns {AeadCipher}
|
|
305
|
+
*/
|
|
306
|
+
static new_aria_ocb3(key, tag_size, nonce_size) {
|
|
307
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
309
|
+
const ret = wasm.aeadcipher_new_aria_ocb3(ptr0, len0, tag_size, nonce_size);
|
|
310
|
+
if (ret[2]) {
|
|
311
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
312
|
+
}
|
|
313
|
+
return AeadCipher.__wrap(ret[0]);
|
|
314
|
+
}
|
|
287
315
|
/**
|
|
288
316
|
* @param {Uint8Array} key
|
|
289
317
|
* @returns {AeadCipher}
|
|
@@ -866,6 +894,22 @@ export class BlockCipher {
|
|
|
866
894
|
}
|
|
867
895
|
return BlockCipher.__wrap(ret[0]);
|
|
868
896
|
}
|
|
897
|
+
/**
|
|
898
|
+
* @param {Uint8Array} key
|
|
899
|
+
* @param {Uint8Array} iv
|
|
900
|
+
* @returns {BlockCipher}
|
|
901
|
+
*/
|
|
902
|
+
static new_aria_cbc(key, iv) {
|
|
903
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
904
|
+
const len0 = WASM_VECTOR_LEN;
|
|
905
|
+
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
906
|
+
const len1 = WASM_VECTOR_LEN;
|
|
907
|
+
const ret = wasm.blockcipher_new_aria_cbc(ptr0, len0, ptr1, len1);
|
|
908
|
+
if (ret[2]) {
|
|
909
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
910
|
+
}
|
|
911
|
+
return BlockCipher.__wrap(ret[0]);
|
|
912
|
+
}
|
|
869
913
|
/**
|
|
870
914
|
* @param {Uint8Array} key
|
|
871
915
|
* @param {Uint8Array} iv
|
|
@@ -2042,6 +2086,54 @@ export class StreamCipher {
|
|
|
2042
2086
|
}
|
|
2043
2087
|
return StreamCipher.__wrap(ret[0]);
|
|
2044
2088
|
}
|
|
2089
|
+
/**
|
|
2090
|
+
* @param {Uint8Array} key
|
|
2091
|
+
* @param {Uint8Array} iv
|
|
2092
|
+
* @returns {StreamCipher}
|
|
2093
|
+
*/
|
|
2094
|
+
static new_aria_cfb(key, iv) {
|
|
2095
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2096
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2097
|
+
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2098
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2099
|
+
const ret = wasm.streamcipher_new_aria_cfb(ptr0, len0, ptr1, len1);
|
|
2100
|
+
if (ret[2]) {
|
|
2101
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2102
|
+
}
|
|
2103
|
+
return StreamCipher.__wrap(ret[0]);
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* @param {Uint8Array} key
|
|
2107
|
+
* @param {Uint8Array} iv
|
|
2108
|
+
* @returns {StreamCipher}
|
|
2109
|
+
*/
|
|
2110
|
+
static new_aria_ctr(key, iv) {
|
|
2111
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2112
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2113
|
+
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2114
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2115
|
+
const ret = wasm.streamcipher_new_aria_ctr(ptr0, len0, ptr1, len1);
|
|
2116
|
+
if (ret[2]) {
|
|
2117
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2118
|
+
}
|
|
2119
|
+
return StreamCipher.__wrap(ret[0]);
|
|
2120
|
+
}
|
|
2121
|
+
/**
|
|
2122
|
+
* @param {Uint8Array} key
|
|
2123
|
+
* @param {Uint8Array} iv
|
|
2124
|
+
* @returns {StreamCipher}
|
|
2125
|
+
*/
|
|
2126
|
+
static new_aria_ofb(key, iv) {
|
|
2127
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2128
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2129
|
+
const ptr1 = passArray8ToWasm0(iv, wasm.__wbindgen_malloc);
|
|
2130
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2131
|
+
const ret = wasm.streamcipher_new_aria_ofb(ptr0, len0, ptr1, len1);
|
|
2132
|
+
if (ret[2]) {
|
|
2133
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2134
|
+
}
|
|
2135
|
+
return StreamCipher.__wrap(ret[0]);
|
|
2136
|
+
}
|
|
2045
2137
|
/**
|
|
2046
2138
|
* @param {Uint8Array} key
|
|
2047
2139
|
* @param {Uint8Array} iv
|
package/crown_wasm_bg.wasm
CHANGED
|
Binary file
|