@anycon/protocol 0.1.1 → 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.
@@ -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 (1)
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.25 <https://github.com/unicode-rs/unicode-normalization>
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.1.1
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
 
@@ -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;
@@ -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;