@wireapp/core-crypto 3.0.2 → 3.1.1
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/package.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wireapp/core-crypto",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.1.1",
|
4
4
|
"description": "CoreCrypto bindings for the Web",
|
5
5
|
"type": "module",
|
6
6
|
"module": "platforms/web/corecrypto.js",
|
7
7
|
"types": "platforms/web/corecrypto.d.ts",
|
8
8
|
"scripts": {
|
9
9
|
"clean": "rm -f ./platforms/web/*.{js,ts,wasm,html} && rm -rf ./platforms/web/assets",
|
10
|
-
"test": "[ \"$(basename $PWD)\" != \"crypto-ffi\" ] && echo \"Error: Not in crypto-ffi directory, do:\" && echo cd crypto-ffi && exit 1 || bun run build_ts.ts && wdio run bindings/js/wdio.conf.ts --spec bindings/js/test
|
11
|
-
"bench": "[ \"$(basename $PWD)\" != \"crypto-ffi\" ] && echo \"Error: Not in crypto-ffi directory, do:\" && echo cd crypto-ffi && exit 1 ||bun run build_ts.ts && wdio run bindings/js/wdio.conf.ts --spec bindings/js/benches
|
10
|
+
"test": "[ \"$(basename $PWD)\" != \"crypto-ffi\" ] && echo \"Error: Not in crypto-ffi directory, do:\" && echo cd crypto-ffi && exit 1 || bun run build_ts.ts && wdio run bindings/js/wdio.conf.ts --spec bindings/js/test/*.test.ts",
|
11
|
+
"bench": "[ \"$(basename $PWD)\" != \"crypto-ffi\" ] && echo \"Error: Not in crypto-ffi directory, do:\" && echo cd crypto-ffi && exit 1 ||bun run build_ts.ts && wdio run bindings/js/wdio.conf.ts --spec bindings/js/benches/*.bench.ts --log-level warn"
|
12
12
|
},
|
13
13
|
"publishConfig": {
|
14
14
|
"access": "public"
|
Binary file
|
@@ -1,12 +1,12 @@
|
|
1
|
-
declare enum
|
1
|
+
declare enum WirePolicy {
|
2
2
|
/**
|
3
|
-
*
|
3
|
+
* Handshake messages are never encrypted
|
4
4
|
*/
|
5
|
-
|
5
|
+
Plaintext = 1,
|
6
6
|
/**
|
7
|
-
*
|
7
|
+
* Handshake messages are always encrypted
|
8
8
|
*/
|
9
|
-
|
9
|
+
Ciphertext = 2
|
10
10
|
}
|
11
11
|
declare enum Ciphersuite {
|
12
12
|
/**
|
@@ -38,15 +38,15 @@ declare enum Ciphersuite {
|
|
38
38
|
*/
|
39
39
|
MLS_256_DHKEMP384_AES256GCM_SHA384_P384 = 7
|
40
40
|
}
|
41
|
-
declare enum
|
41
|
+
declare enum CredentialType {
|
42
42
|
/**
|
43
|
-
*
|
43
|
+
* Just a KeyPair
|
44
44
|
*/
|
45
|
-
|
45
|
+
Basic = 1,
|
46
46
|
/**
|
47
|
-
*
|
47
|
+
* A certificate obtained through e2e identity enrollment process
|
48
48
|
*/
|
49
|
-
|
49
|
+
X509 = 2
|
50
50
|
}
|
51
51
|
/**
|
52
52
|
* For creating a challenge.
|
@@ -13,6 +13,14 @@ var takeObject = function(idx) {
|
|
13
13
|
dropObject(idx);
|
14
14
|
return ret;
|
15
15
|
};
|
16
|
+
var addHeapObject = function(obj) {
|
17
|
+
if (heap_next === heap.length)
|
18
|
+
heap.push(heap.length + 1);
|
19
|
+
const idx = heap_next;
|
20
|
+
heap_next = heap[idx];
|
21
|
+
heap[idx] = obj;
|
22
|
+
return idx;
|
23
|
+
};
|
16
24
|
var getUint8ArrayMemory0 = function() {
|
17
25
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
18
26
|
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
@@ -23,14 +31,6 @@ var getStringFromWasm0 = function(ptr, len) {
|
|
23
31
|
ptr = ptr >>> 0;
|
24
32
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
25
33
|
};
|
26
|
-
var addHeapObject = function(obj) {
|
27
|
-
if (heap_next === heap.length)
|
28
|
-
heap.push(heap.length + 1);
|
29
|
-
const idx = heap_next;
|
30
|
-
heap_next = heap[idx];
|
31
|
-
heap[idx] = obj;
|
32
|
-
return idx;
|
33
|
-
};
|
34
34
|
var passStringToWasm0 = function(arg, malloc, realloc) {
|
35
35
|
if (realloc === undefined) {
|
36
36
|
const buf = cachedTextEncoder.encode(arg);
|
@@ -152,13 +152,13 @@ var makeMutClosure = function(arg0, arg1, dtor, f) {
|
|
152
152
|
return real;
|
153
153
|
};
|
154
154
|
var __wbg_adapter_54 = function(arg0, arg1, arg2) {
|
155
|
-
wasm.
|
155
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h19c41621fd130a07(arg0, arg1, addHeapObject(arg2));
|
156
156
|
};
|
157
157
|
var __wbg_adapter_57 = function(arg0, arg1, arg2) {
|
158
|
-
wasm.
|
158
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h83f1f35eeee33846(arg0, arg1, addHeapObject(arg2));
|
159
159
|
};
|
160
160
|
var __wbg_adapter_60 = function(arg0, arg1, arg2) {
|
161
|
-
wasm.
|
161
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h84d372f0b91a205d(arg0, arg1, addHeapObject(arg2));
|
162
162
|
};
|
163
163
|
var getArrayJsValueFromWasm0 = function(ptr, len) {
|
164
164
|
ptr = ptr >>> 0;
|
@@ -209,8 +209,8 @@ var handleError = function(f, args) {
|
|
209
209
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
210
210
|
}
|
211
211
|
};
|
212
|
-
var
|
213
|
-
wasm.
|
212
|
+
var __wbg_adapter_514 = function(arg0, arg1, arg2, arg3) {
|
213
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h00f8b7a5523a4e75(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
214
214
|
};
|
215
215
|
async function __wbg_load(module, imports) {
|
216
216
|
if (typeof Response === "function" && module instanceof Response) {
|
@@ -242,44 +242,44 @@ var __wbg_get_imports = function() {
|
|
242
242
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
243
243
|
takeObject(arg0);
|
244
244
|
};
|
245
|
-
imports.wbg.
|
246
|
-
const ret =
|
245
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
246
|
+
const ret = arg0;
|
247
|
+
return addHeapObject(ret);
|
248
|
+
};
|
249
|
+
imports.wbg.__wbg_newacmeauthz_new = function(arg0) {
|
250
|
+
const ret = NewAcmeAuthz.__wrap(arg0);
|
247
251
|
return addHeapObject(ret);
|
248
252
|
};
|
249
253
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
250
254
|
const ret = getStringFromWasm0(arg0, arg1);
|
251
255
|
return addHeapObject(ret);
|
252
256
|
};
|
253
|
-
imports.wbg.
|
254
|
-
const ret =
|
257
|
+
imports.wbg.__wbg_ffiwiree2eidentity_new = function(arg0) {
|
258
|
+
const ret = FfiWireE2EIdentity.__wrap(arg0);
|
255
259
|
return addHeapObject(ret);
|
256
260
|
};
|
257
|
-
imports.wbg.
|
258
|
-
const ret = arg0;
|
261
|
+
imports.wbg.__wbg_newacmeorder_new = function(arg0) {
|
262
|
+
const ret = NewAcmeOrder.__wrap(arg0);
|
259
263
|
return addHeapObject(ret);
|
260
264
|
};
|
261
265
|
imports.wbg.__wbg_proteusautoprekeybundle_new = function(arg0) {
|
262
266
|
const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
|
263
267
|
return addHeapObject(ret);
|
264
268
|
};
|
265
|
-
imports.wbg.__wbg_execute_73079ea1d8ef097c = function() {
|
266
|
-
return handleError(function(arg0, arg1) {
|
267
|
-
const ret = getObject(arg0).execute(CoreCryptoContext.__wrap(arg1));
|
268
|
-
return addHeapObject(ret);
|
269
|
-
}, arguments);
|
270
|
-
};
|
271
|
-
imports.wbg.__wbg_newacmeauthz_new = function(arg0) {
|
272
|
-
const ret = NewAcmeAuthz.__wrap(arg0);
|
273
|
-
return addHeapObject(ret);
|
274
|
-
};
|
275
269
|
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
276
270
|
const ret = BigInt.asUintN(64, arg0);
|
277
271
|
return addHeapObject(ret);
|
278
272
|
};
|
279
|
-
imports.wbg.
|
280
|
-
const ret =
|
273
|
+
imports.wbg.__wbg_acmedirectory_new = function(arg0) {
|
274
|
+
const ret = AcmeDirectory.__wrap(arg0);
|
281
275
|
return addHeapObject(ret);
|
282
276
|
};
|
277
|
+
imports.wbg.__wbg_execute_b4b48eb9f64d3255 = function() {
|
278
|
+
return handleError(function(arg0, arg1) {
|
279
|
+
const ret = getObject(arg0).execute(CoreCryptoContext.__wrap(arg1));
|
280
|
+
return addHeapObject(ret);
|
281
|
+
}, arguments);
|
282
|
+
};
|
283
283
|
imports.wbg.__wbg_buffereddecryptedmessage_new = function(arg0) {
|
284
284
|
const ret = BufferedDecryptedMessage.__wrap(arg0);
|
285
285
|
return addHeapObject(ret);
|
@@ -364,6 +364,11 @@ var __wbg_get_imports = function() {
|
|
364
364
|
imports.wbg.__wbg_queueMicrotask_12a30234db4045d3 = function(arg0) {
|
365
365
|
queueMicrotask(getObject(arg0));
|
366
366
|
};
|
367
|
+
imports.wbg.__wbg_getRandomValues_d9ee19ffb7278e97 = function() {
|
368
|
+
return handleError(function(arg0, arg1) {
|
369
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
370
|
+
}, arguments);
|
371
|
+
};
|
367
372
|
imports.wbg.__wbg_now_1be9a41d0832ae2d = function() {
|
368
373
|
const ret = Date.now();
|
369
374
|
return ret;
|
@@ -428,14 +433,14 @@ var __wbg_get_imports = function() {
|
|
428
433
|
const ret = getObject(arg0).msCrypto;
|
429
434
|
return addHeapObject(ret);
|
430
435
|
};
|
431
|
-
imports.wbg.
|
436
|
+
imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() {
|
432
437
|
return handleError(function(arg0, arg1) {
|
433
|
-
getObject(arg0).
|
438
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
434
439
|
}, arguments);
|
435
440
|
};
|
436
|
-
imports.wbg.
|
441
|
+
imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() {
|
437
442
|
return handleError(function(arg0, arg1) {
|
438
|
-
getObject(arg0).
|
443
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
439
444
|
}, arguments);
|
440
445
|
};
|
441
446
|
imports.wbg.__wbg_setmultientry_a4c0f50fb1bb8977 = function(arg0, arg1) {
|
@@ -963,7 +968,7 @@ var __wbg_get_imports = function() {
|
|
963
968
|
const a = state0.a;
|
964
969
|
state0.a = 0;
|
965
970
|
try {
|
966
|
-
return
|
971
|
+
return __wbg_adapter_514(a, state0.b, arg02, arg12);
|
967
972
|
} finally {
|
968
973
|
state0.a = a;
|
969
974
|
}
|
@@ -1049,16 +1054,16 @@ var __wbg_get_imports = function() {
|
|
1049
1054
|
const ret = v0;
|
1050
1055
|
return addHeapObject(ret);
|
1051
1056
|
};
|
1052
|
-
imports.wbg.
|
1053
|
-
const ret = makeMutClosure(arg0, arg1,
|
1057
|
+
imports.wbg.__wbindgen_closure_wrapper3748 = function(arg0, arg1, arg2) {
|
1058
|
+
const ret = makeMutClosure(arg0, arg1, 901, __wbg_adapter_54);
|
1054
1059
|
return addHeapObject(ret);
|
1055
1060
|
};
|
1056
|
-
imports.wbg.
|
1057
|
-
const ret = makeMutClosure(arg0, arg1,
|
1061
|
+
imports.wbg.__wbindgen_closure_wrapper13454 = function(arg0, arg1, arg2) {
|
1062
|
+
const ret = makeMutClosure(arg0, arg1, 2167, __wbg_adapter_57);
|
1058
1063
|
return addHeapObject(ret);
|
1059
1064
|
};
|
1060
|
-
imports.wbg.
|
1061
|
-
const ret = makeMutClosure(arg0, arg1,
|
1065
|
+
imports.wbg.__wbindgen_closure_wrapper15462 = function(arg0, arg1, arg2) {
|
1066
|
+
const ret = makeMutClosure(arg0, arg1, 2399, __wbg_adapter_60);
|
1062
1067
|
return addHeapObject(ret);
|
1063
1068
|
};
|
1064
1069
|
return imports;
|
@@ -1123,6 +1128,12 @@ var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: ()
|
|
1123
1128
|
wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b);
|
1124
1129
|
});
|
1125
1130
|
var cachedUint16ArrayMemory0 = null;
|
1131
|
+
var WirePolicy = Object.freeze({
|
1132
|
+
Plaintext: 1,
|
1133
|
+
"1": "Plaintext",
|
1134
|
+
Ciphertext: 2,
|
1135
|
+
"2": "Ciphertext"
|
1136
|
+
});
|
1126
1137
|
var DeviceStatus = Object.freeze({
|
1127
1138
|
Valid: 1,
|
1128
1139
|
"1": "Valid",
|
@@ -1131,13 +1142,6 @@ var DeviceStatus = Object.freeze({
|
|
1131
1142
|
Revoked: 3,
|
1132
1143
|
"3": "Revoked"
|
1133
1144
|
});
|
1134
|
-
var CoreCryptoLogLevel = Object.freeze({ Off: 1, "1": "Off", Trace: 2, "2": "Trace", Debug: 3, "3": "Debug", Info: 4, "4": "Info", Warn: 5, "5": "Warn", Error: 6, "6": "Error" });
|
1135
|
-
var CredentialType = Object.freeze({
|
1136
|
-
Basic: 1,
|
1137
|
-
"1": "Basic",
|
1138
|
-
X509: 2,
|
1139
|
-
"2": "X509"
|
1140
|
-
});
|
1141
1145
|
var Ciphersuite = Object.freeze({
|
1142
1146
|
MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519: 1,
|
1143
1147
|
"1": "MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519",
|
@@ -1154,11 +1158,12 @@ var Ciphersuite = Object.freeze({
|
|
1154
1158
|
MLS_256_DHKEMP384_AES256GCM_SHA384_P384: 7,
|
1155
1159
|
"7": "MLS_256_DHKEMP384_AES256GCM_SHA384_P384"
|
1156
1160
|
});
|
1157
|
-
var
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1161
|
+
var CoreCryptoLogLevel = Object.freeze({ Off: 1, "1": "Off", Trace: 2, "2": "Trace", Debug: 3, "3": "Debug", Info: 4, "4": "Info", Warn: 5, "5": "Warn", Error: 6, "6": "Error" });
|
1162
|
+
var CredentialType = Object.freeze({
|
1163
|
+
Basic: 1,
|
1164
|
+
"1": "Basic",
|
1165
|
+
X509: 2,
|
1166
|
+
"2": "X509"
|
1162
1167
|
});
|
1163
1168
|
var AcmeChallengeFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
1164
1169
|
}, unregister: () => {
|