@anycon/protocol 0.1.0 → 0.2.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/dist/constants.d.ts +14 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +15 -0
- package/dist/constants.js.map +1 -1
- package/dist/crypto.d.ts +10 -1
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +1 -0
- package/dist/crypto.js.map +1 -1
- package/dist/envelope.d.ts.map +1 -1
- package/dist/envelope.js +5 -3
- package/dist/envelope.js.map +1 -1
- package/dist/generated.d.ts +658 -13
- package/dist/generated.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/method-types.d.ts +29 -1
- package/dist/method-types.d.ts.map +1 -1
- package/dist/preview.d.ts +173 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +554 -0
- package/dist/preview.js.map +1 -0
- package/package.json +2 -2
- package/src/constants.ts +16 -0
- package/src/crypto.ts +16 -4
- package/src/envelope.ts +5 -3
- package/src/generated.ts +664 -13
- package/src/index.ts +2 -0
- package/src/method-types.ts +17 -0
- package/src/preview.ts +625 -0
- package/wasm/THIRD-PARTY-LICENSES.txt +4 -3
- package/wasm/anycon_crypto.d.ts +6 -0
- package/wasm/anycon_crypto.js +29 -0
- package/wasm/anycon_crypto_bg.wasm +0 -0
- package/wasm/anycon_crypto_bg.wasm.d.ts +1 -0
|
@@ -8,7 +8,7 @@ Overview:
|
|
|
8
8
|
Apache License 2.0 (49)
|
|
9
9
|
BSD 3-Clause "New" or "Revised" License (2)
|
|
10
10
|
MIT License (2)
|
|
11
|
-
Unicode License v3 (
|
|
11
|
+
Unicode License v3 (2)
|
|
12
12
|
|
|
13
13
|
--------------------------------------------------------------------------------
|
|
14
14
|
Apache License 2.0 (Apache-2.0)
|
|
@@ -651,7 +651,7 @@ Used by:
|
|
|
651
651
|
cfg-if 1.0.5 <https://github.com/rust-lang/cfg-if>
|
|
652
652
|
js-sys 0.3.106 <https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys>
|
|
653
653
|
once_cell 1.21.4 <https://github.com/matklad/once_cell>
|
|
654
|
-
unicode-normalization 0.1.
|
|
654
|
+
unicode-normalization 0.1.26 <https://github.com/unicode-rs/unicode-normalization>
|
|
655
655
|
wasm-bindgen-macro-support 0.2.129 <https://github.com/wasm-bindgen/wasm-bindgen/tree/main/crates/macro-support>
|
|
656
656
|
wasm-bindgen-macro 0.2.129 <https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro>
|
|
657
657
|
wasm-bindgen-shared 0.2.129 <https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/shared>
|
|
@@ -1705,7 +1705,7 @@ limitations under the License.
|
|
|
1705
1705
|
Apache License 2.0 (Apache-2.0)
|
|
1706
1706
|
|
|
1707
1707
|
Used by:
|
|
1708
|
-
anycon-crypto 0.
|
|
1708
|
+
anycon-crypto 0.2.0
|
|
1709
1709
|
pin-project-lite 0.2.17 <https://github.com/taiki-e/pin-project-lite>
|
|
1710
1710
|
proc-macro2 1.0.107 <https://github.com/dtolnay/proc-macro2>
|
|
1711
1711
|
quote 1.0.47 <https://github.com/dtolnay/quote>
|
|
@@ -1913,6 +1913,7 @@ Unicode License v3 (Unicode-3.0)
|
|
|
1913
1913
|
|
|
1914
1914
|
Used by:
|
|
1915
1915
|
unicode-ident 1.0.26 <https://github.com/dtolnay/unicode-ident>
|
|
1916
|
+
unicode-normalization 0.1.26 <https://github.com/unicode-rs/unicode-normalization>
|
|
1916
1917
|
|
|
1917
1918
|
UNICODE LICENSE V3
|
|
1918
1919
|
|
package/wasm/anycon_crypto.d.ts
CHANGED
|
@@ -38,6 +38,11 @@ export class WasmHandshake {
|
|
|
38
38
|
* 配对握手(XXpsk3)。joiner 传 `"initiator"`,host 传 `"responder"`。
|
|
39
39
|
*/
|
|
40
40
|
static pairing(role: string, kp: WasmKeypair, psk: Uint8Array): WasmHandshake;
|
|
41
|
+
/**
|
|
42
|
+
* 预览隧道握手(NKpsk0,ADR-39)的 initiator:预览页没有静态密钥,钉住 daemon 静态公钥;`psk` 是票据密钥,
|
|
43
|
+
* `prologue` 见 `anycon_protocol::tunnel::prologue`。daemon 一侧(responder)不在浏览器里跑,不导出。
|
|
44
|
+
*/
|
|
45
|
+
static previewInitiator(daemonPublic: Uint8Array, psk: Uint8Array, prologue: Uint8Array): WasmHandshake;
|
|
41
46
|
/**
|
|
42
47
|
* 读对方的握手消息,返回对方带的 payload。
|
|
43
48
|
*/
|
|
@@ -205,6 +210,7 @@ export interface InitOutput {
|
|
|
205
210
|
readonly wasmhandshake_isFinished: (a: number) => number;
|
|
206
211
|
readonly wasmhandshake_isMyTurn: (a: number) => number;
|
|
207
212
|
readonly wasmhandshake_pairing: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
213
|
+
readonly wasmhandshake_previewInitiator: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
208
214
|
readonly wasmhandshake_read: (a: number, b: number, c: number, d: number) => void;
|
|
209
215
|
readonly wasmhandshake_reconnect: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
210
216
|
readonly wasmhandshake_remotePublic: (a: number, b: number) => void;
|
package/wasm/anycon_crypto.js
CHANGED
|
@@ -173,6 +173,35 @@ export class WasmHandshake {
|
|
|
173
173
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* 预览隧道握手(NKpsk0,ADR-39)的 initiator:预览页没有静态密钥,钉住 daemon 静态公钥;`psk` 是票据密钥,
|
|
178
|
+
* `prologue` 见 `anycon_protocol::tunnel::prologue`。daemon 一侧(responder)不在浏览器里跑,不导出。
|
|
179
|
+
* @param {Uint8Array} daemonPublic
|
|
180
|
+
* @param {Uint8Array} psk
|
|
181
|
+
* @param {Uint8Array} prologue
|
|
182
|
+
* @returns {WasmHandshake}
|
|
183
|
+
*/
|
|
184
|
+
static previewInitiator(daemonPublic, psk, prologue) {
|
|
185
|
+
try {
|
|
186
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
187
|
+
const ptr0 = passArray8ToWasm0(daemonPublic, wasm.__wbindgen_export2);
|
|
188
|
+
const len0 = WASM_VECTOR_LEN;
|
|
189
|
+
const ptr1 = passArray8ToWasm0(psk, wasm.__wbindgen_export2);
|
|
190
|
+
const len1 = WASM_VECTOR_LEN;
|
|
191
|
+
const ptr2 = passArray8ToWasm0(prologue, wasm.__wbindgen_export2);
|
|
192
|
+
const len2 = WASM_VECTOR_LEN;
|
|
193
|
+
wasm.wasmhandshake_previewInitiator(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
194
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
195
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
196
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
197
|
+
if (r2) {
|
|
198
|
+
throw takeObject(r1);
|
|
199
|
+
}
|
|
200
|
+
return WasmHandshake.__wrap(r0);
|
|
201
|
+
} finally {
|
|
202
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
176
205
|
/**
|
|
177
206
|
* 读对方的握手消息,返回对方带的 payload。
|
|
178
207
|
* @param {Uint8Array} message
|
|
Binary file
|
|
@@ -28,6 +28,7 @@ export const wasmhandshake_intoTransport: (a: number, b: number) => void;
|
|
|
28
28
|
export const wasmhandshake_isFinished: (a: number) => number;
|
|
29
29
|
export const wasmhandshake_isMyTurn: (a: number) => number;
|
|
30
30
|
export const wasmhandshake_pairing: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
31
|
+
export const wasmhandshake_previewInitiator: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
31
32
|
export const wasmhandshake_read: (a: number, b: number, c: number, d: number) => void;
|
|
32
33
|
export const wasmhandshake_reconnect: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
33
34
|
export const wasmhandshake_remotePublic: (a: number, b: number) => void;
|