From 088ffcba6696ddc43b15fcc804b3b2c34a4c2e5c Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Thu, 4 Apr 2024 21:05:33 +0800 Subject: [PATCH 01/14] Add verifier server. --- .gitignore | 1 + .vscode/settings.json | 3 +- interactive-demo/verifier/Cargo.lock | 3766 +++++++++++++++++ interactive-demo/verifier/Cargo.toml | 35 + interactive-demo/verifier/README.md | 17 + .../verifier/src/axum_websocket.rs | 914 ++++ interactive-demo/verifier/src/lib.rs | 161 + interactive-demo/verifier/src/main.rs | 29 + 8 files changed, 4925 insertions(+), 1 deletion(-) create mode 100644 interactive-demo/verifier/Cargo.lock create mode 100644 interactive-demo/verifier/Cargo.toml create mode 100644 interactive-demo/verifier/README.md create mode 100644 interactive-demo/verifier/src/axum_websocket.rs create mode 100644 interactive-demo/verifier/src/lib.rs create mode 100644 interactive-demo/verifier/src/main.rs diff --git a/.gitignore b/.gitignore index 8049f62..40ef638 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ test-build/ package-lock.json pnpm-lock.yaml yarn.lock +**/target* diff --git a/.vscode/settings.json b/.vscode/settings.json index 564fcab..9684ecb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "rust-analyzer.linkedProjects": [ - "wasm/prover/Cargo.toml" + "wasm/prover/Cargo.toml", + "interactive-demo/verifier/Cargo.toml" ], "rust-analyzer.cargo.target": "wasm32-unknown-unknown" } diff --git a/interactive-demo/verifier/Cargo.lock b/interactive-demo/verifier/Cargo.lock new file mode 100644 index 0000000..71a8564 --- /dev/null +++ b/interactive-demo/verifier/Cargo.lock @@ -0,0 +1,3766 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown", +] + +[[package]] +name = "ark-secp256r1" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3975a01b0a6e3eae0f72ec7ca8598a6620fc72fa5981f6f5cca33b7cd788f633" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +dependencies = [ + "concurrent-queue", + "event-listener 5.2.0", + "event-listener-strategy 0.5.1", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10b3e585719c2358d2660232671ca8ca4ddb4be4ce8a1842d6c2dc8685303316" +dependencies = [ + "async-lock 3.3.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.2", + "futures-lite 2.3.0", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.2.0", + "async-executor", + "async-io 2.3.2", + "async-lock 3.3.0", + "blocking", + "futures-lite 2.3.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.3.0", + "parking", + "polling 3.6.0", + "rustix 0.38.32", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" + +[[package]] +name = "async-trait" +version = "0.1.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "async-tungstenite" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5682ea0913e5c20780fe5785abacb85a411e7437bf52a1bedb93ddb3972cb8dd" +dependencies = [ + "futures-io", + "futures-util", + "log", + "pin-project-lite", + "tungstenite 0.16.0", +] + +[[package]] +name = "async-tungstenite" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce01ac37fdc85f10a43c43bc582cbd566720357011578a935761075f898baf58" +dependencies = [ + "futures-io", + "futures-util", + "log", + "native-tls", + "pin-project-lite", + "tokio", + "tokio-native-tls", + "tungstenite 0.19.0", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version", + "tokio", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" + +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "base64 0.21.7", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bcs" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b6598a2f5d564fb7855dc6b06fd1c38cff5a72bd8b863a4d021938497b440a" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "bimap" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" +dependencies = [ + "serde", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "rayon", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel 2.2.0", + "async-lock 3.3.0", + "async-task", + "fastrand 2.0.2", + "futures-io", + "futures-lite 2.3.0", + "piper", + "tracing", +] + +[[package]] +name = "bumpalo" +version = "3.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" + +[[package]] +name = "bytemuck" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +dependencies = [ + "serde", +] + +[[package]] +name = "cc" +version = "1.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clmul" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "bytemuck", + "cfg-if", + "cpufeatures", +] + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "fiat-crypto", + "platforms", + "rand_core", + "rustc_version", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +dependencies = [ + "darling_core 0.20.8", + "darling_macro 0.20.8", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.58", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +dependencies = [ + "darling_core 0.20.8", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" +dependencies = [ + "derive_builder_macro 0.11.2", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro 0.12.0", +] + +[[package]] +name = "derive_builder_core" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" +dependencies = [ + "derive_builder_core 0.11.2", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core 0.12.0", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "serdect", + "signature", + "spki", +] + +[[package]] +name = "educe" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "hkdf", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-ordinalize" +version = "3.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "enum-try-as-inner" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c448fc2753338b04aa344ead5a6bdda26f2df2dcd85b65c86dd15b16819369e" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" +dependencies = [ + "event-listener 5.2.0", + "pin-project-lite", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand 2.0.2", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.6", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "itybity" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f242558c18a6d4ec99bc1eaf1603ab49e857ab36b4c1b911ebd0028cb8165e79" +dependencies = [ + "rayon", +] + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +dependencies = [ + "value-bag", +] + +[[package]] +name = "ludi" +version = "0.1.0" +source = "git+https://github.com/sinui0/ludi?rev=b590de5#b590de59e700ec2dc3295a74111536f192206cd5" +dependencies = [ + "futures-util", + "ludi-core", + "ludi-macros", +] + +[[package]] +name = "ludi-core" +version = "0.1.0" +source = "git+https://github.com/sinui0/ludi?rev=b590de5#b590de59e700ec2dc3295a74111536f192206cd5" +dependencies = [ + "futures-channel", + "futures-core", + "futures-util", +] + +[[package]] +name = "ludi-macros" +version = "0.1.0" +source = "git+https://github.com/sinui0/ludi?rev=b590de5#b590de59e700ec2dc3295a74111536f192206cd5" +dependencies = [ + "darling 0.20.8", + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "matrix-transpose" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "thiserror", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "mpz-circuits" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "bincode", + "itybity", + "mpz-circuits-macros", + "once_cell", + "rand", + "regex", + "serde", + "serde_arrays", + "sha2", + "thiserror", +] + +[[package]] +name = "mpz-circuits-macros" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "mpz-core" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "aes", + "bcs", + "blake3", + "bytemuck", + "cfg-if", + "cipher", + "clmul", + "generic-array", + "itybity", + "once_cell", + "opaque-debug", + "rand", + "rand_chacha", + "rand_core", + "rayon", + "serde", + "thiserror", +] + +[[package]] +name = "mpz-garble" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "aes", + "async-trait", + "cipher", + "derive_builder 0.11.2", + "futures", + "futures-util", + "itybity", + "mpz-circuits", + "mpz-core", + "mpz-garble-core", + "mpz-ot", + "opaque-debug", + "prost", + "rand", + "rand_chacha", + "rand_core", + "rayon", + "thiserror", + "tlsn-utils", + "tlsn-utils-aio", +] + +[[package]] +name = "mpz-garble-core" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "aes", + "blake3", + "cipher", + "derive_builder 0.11.2", + "itybity", + "mpz-circuits", + "mpz-core", + "once_cell", + "rand", + "rand_chacha", + "rand_core", + "serde", + "serde_arrays", + "thiserror", +] + +[[package]] +name = "mpz-ot" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "aes", + "async-trait", + "cfg-if", + "cipher", + "enum-try-as-inner", + "futures", + "futures-util", + "itybity", + "mpz-core", + "mpz-ot-core", + "opaque-debug", + "prost", + "rand", + "rand_chacha", + "rand_core", + "rayon", + "serde", + "thiserror", + "tlsn-utils-aio", +] + +[[package]] +name = "mpz-ot-core" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "aes", + "blake3", + "bytemuck", + "cfg-if", + "cipher", + "clmul", + "ctr", + "curve25519-dalek", + "derive_builder 0.11.2", + "enum-try-as-inner", + "itybity", + "matrix-transpose", + "mpz-core", + "opaque-debug", + "rand", + "rand_chacha", + "rand_core", + "rayon", + "serde", + "thiserror", + "tlsn-utils", +] + +[[package]] +name = "mpz-share-conversion" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "async-trait", + "derive_builder 0.11.2", + "futures", + "mpz-core", + "mpz-ot", + "mpz-share-conversion-core", + "rand", + "rand_chacha", + "serde", + "thiserror", + "tlsn-utils-aio", +] + +[[package]] +name = "mpz-share-conversion-core" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" +dependencies = [ + "ark-ff", + "ark-secp256r1", + "ark-serialize", + "itybity", + "mpz-core", + "num-bigint", + "opaque-debug", + "rand", + "serde", + "thiserror", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "serdect", + "sha2", +] + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.2", + "futures-io", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "platforms" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix 0.38.32", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", + "serdect", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rs_merkle" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b241d2e59b74ef9e98d94c78c47623d04c8392abaf82014dfd372a16041128f" +dependencies = [ + "sha2", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-pki-types" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_arrays" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38636132857f68ec3d5f3eb121166d2af33cb55174c4d5ff645db6165cbef0fd" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "serde_json" +version = "1.0.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand 2.0.2", + "rustix 0.38.32", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tlsn-aead" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "derive_builder 0.12.0", + "futures", + "mpz-core", + "mpz-garble", + "serde", + "thiserror", + "tlsn-block-cipher", + "tlsn-stream-cipher", + "tlsn-universal-hash", + "tlsn-utils-aio", + "tracing", +] + +[[package]] +name = "tlsn-block-cipher" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "derive_builder 0.12.0", + "mpz-circuits", + "mpz-garble", + "thiserror", + "tlsn-utils", + "tracing", +] + +[[package]] +name = "tlsn-common" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "futures", + "tlsn-utils-aio", + "uid-mux", +] + +[[package]] +name = "tlsn-core" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "bimap", + "bytes", + "getrandom", + "mpz-circuits", + "mpz-core", + "mpz-garble-core", + "opaque-debug", + "p256", + "ring", + "rs_merkle", + "serde", + "thiserror", + "tlsn-tls-core", + "tlsn-utils", + "web-time", + "webpki-roots", +] + +[[package]] +name = "tlsn-hmac-sha256" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "derive_builder 0.12.0", + "enum-try-as-inner", + "futures", + "mpz-circuits", + "mpz-garble", + "thiserror", + "tlsn-hmac-sha256-circuits", + "tlsn-utils-aio", + "tracing", +] + +[[package]] +name = "tlsn-hmac-sha256-circuits" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "mpz-circuits", + "tracing", +] + +[[package]] +name = "tlsn-key-exchange" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "derive_builder 0.12.0", + "futures", + "mpz-circuits", + "mpz-garble", + "mpz-ot", + "mpz-share-conversion-core", + "p256", + "serde", + "thiserror", + "tlsn-point-addition", + "tlsn-utils-aio", + "tracing", +] + +[[package]] +name = "tlsn-point-addition" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "mpz-core", + "mpz-share-conversion", + "mpz-share-conversion-core", + "p256", + "thiserror", + "tracing", +] + +[[package]] +name = "tlsn-stream-cipher" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "aes", + "async-trait", + "cipher", + "ctr", + "derive_builder 0.12.0", + "mpz-circuits", + "mpz-garble", + "thiserror", + "tlsn-utils", + "tracing", +] + +[[package]] +name = "tlsn-tls-backend" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "futures", + "thiserror", + "tlsn-tls-core", +] + +[[package]] +name = "tlsn-tls-core" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "futures", + "hmac", + "rand", + "ring", + "rustls-pemfile", + "sct", + "serde", + "sha2", + "thiserror", + "tracing", + "web-time", + "webpki", +] + +[[package]] +name = "tlsn-tls-mpc" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "derive_builder 0.12.0", + "enum-try-as-inner", + "futures", + "ludi", + "mpz-core", + "mpz-garble", + "mpz-share-conversion", + "p256", + "rand", + "serde", + "thiserror", + "tlsn-aead", + "tlsn-block-cipher", + "tlsn-hmac-sha256", + "tlsn-key-exchange", + "tlsn-point-addition", + "tlsn-stream-cipher", + "tlsn-tls-backend", + "tlsn-tls-core", + "tlsn-universal-hash", + "tlsn-utils-aio", + "tracing", +] + +[[package]] +name = "tlsn-universal-hash" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "derive_builder 0.12.0", + "futures", + "futures-util", + "mpz-core", + "mpz-share-conversion", + "mpz-share-conversion-core", + "opaque-debug", + "thiserror", + "tracing", +] + +[[package]] +name = "tlsn-utils" +version = "0.1.0" +source = "git+https://github.com/tlsnotary/tlsn-utils?rev=51f313d#51f313d153f1b878e583e709d66a4661b40c2b6c" +dependencies = [ + "serde", +] + +[[package]] +name = "tlsn-utils-aio" +version = "0.1.0" +source = "git+https://github.com/tlsnotary/tlsn-utils?rev=51f313d#51f313d153f1b878e583e709d66a4661b40c2b6c" +dependencies = [ + "async-std", + "async-trait", + "async-tungstenite 0.16.1", + "bytes", + "futures", + "futures-util", + "rayon", + "serde", + "thiserror", + "tokio", + "tokio-serde", + "tokio-util", + "wasm-bindgen-futures", +] + +[[package]] +name = "tlsn-verifier" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "derive_builder 0.12.0", + "futures", + "mpz-circuits", + "mpz-core", + "mpz-garble", + "mpz-ot", + "mpz-share-conversion", + "opaque-debug", + "rand", + "signature", + "thiserror", + "tlsn-common", + "tlsn-core", + "tlsn-tls-core", + "tlsn-tls-mpc", + "tlsn-utils-aio", + "tracing", + "uid-mux", +] + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.5.6", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +dependencies = [ + "bincode", + "bytes", + "educe", + "futures-core", + "futures-sink", + "pin-project", + "serde", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.20.1", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand", + "sha-1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "tungstenite" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "native-tls", + "rand", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uid-mux" +version = "0.1.0-alpha.4" +source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" +dependencies = [ + "async-trait", + "futures", + "tlsn-utils-aio", + "tracing", + "yamux", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "value-bag" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "verifier" +version = "0.1.0" +dependencies = [ + "async-trait", + "async-tungstenite 0.22.2", + "axum", + "axum-core", + "base64 0.21.7", + "eyre", + "futures-util", + "http", + "hyper", + "serde", + "sha1", + "tlsn-core", + "tlsn-verifier", + "tokio", + "tokio-util", + "tower", + "tracing", + "tracing-subscriber", + "ws_stream_tungstenite", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.58", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "ws_stream_tungstenite" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b6e7a5ba9436eb3868b052be83377dc685fad6d2f4cddaa2a2251b673472071" +dependencies = [ + "async-tungstenite 0.22.2", + "async_io_stream", + "bitflags 2.5.0", + "futures-core", + "futures-io", + "futures-sink", + "futures-util", + "log", + "pharos", + "rustc_version", + "tokio", + "tungstenite 0.19.0", +] + +[[package]] +name = "yamux" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0875ad26dfbf0e7126d4a200747c78496aa3f0225d094a8c867b0e98bb19f9d7" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot", + "pin-project", + "rand", + "static_assertions", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] diff --git a/interactive-demo/verifier/Cargo.toml b/interactive-demo/verifier/Cargo.toml new file mode 100644 index 0000000..7379822 --- /dev/null +++ b/interactive-demo/verifier/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "verifier" +version = "0.1.0" +edition = "2021" + +[dependencies] +tokio = {version = "1", features = [ + "rt", + "rt-multi-thread", + "macros", + "net", + "io-std", + "fs", +]} +tokio-util = { version = "0.7", features = ["compat"] } +tracing = "0.1.40" + +tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-core" } +tlsn-verifier = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-verifier", features = [ + "tracing", +] } +eyre = "0.6.12" +tracing-subscriber = { version ="0.3.18", features = ["env-filter"] } +hyper = { version = "0.14", features = ["client", "http1", "server", "tcp"] } +axum = { version = "0.6.18", features = ["ws"] } +serde = { version = "1.0.147", features = ["derive"] } +futures-util = "0.3.28" +http = "0.2.9" +sha1 = "0.10" +async-trait = "0.1.67" +async-tungstenite = { version = "0.22.2", features = ["tokio-native-tls"] } +axum-core = "0.3.4" +base64 = "0.21.0" +tower = { version = "0.4.12", features = ["make"] } +ws_stream_tungstenite = { version = "0.10.0", features = ["tokio_io"] } diff --git a/interactive-demo/verifier/README.md b/interactive-demo/verifier/README.md new file mode 100644 index 0000000..bb61aeb --- /dev/null +++ b/interactive-demo/verifier/README.md @@ -0,0 +1,17 @@ +# verifier-server + +An implementation of the interactive verifier server in Rust. + +## Running the server +1. Configure this server setting via the global variables defined in [main.rs](./src/main.rs) — please ensure that the hardcoded `SERVER_DOMAIN` and `VERIFICATION_SESSION_ID` have the same values on the prover side. +2. Start the server by running the following in a terminal at the root of this crate. +```bash +cargo run --release +``` +## WebSocket APIs +### /verify +To perform verification via websocket + +## Design Choices +### WebSocket +Refer to https://github.com/tlsnotary/tlsn/tree/main/notary-server#websocket diff --git a/interactive-demo/verifier/src/axum_websocket.rs b/interactive-demo/verifier/src/axum_websocket.rs new file mode 100644 index 0000000..eea2358 --- /dev/null +++ b/interactive-demo/verifier/src/axum_websocket.rs @@ -0,0 +1,914 @@ +//! The following code is adapted from https://github.com/tokio-rs/axum/blob/axum-v0.6.19/axum/src/extract/ws.rs +//! where we swapped out tokio_tungstenite (https://docs.rs/tokio-tungstenite/latest/tokio_tungstenite/) +//! with async_tungstenite (https://docs.rs/async-tungstenite/latest/async_tungstenite/) so that we can use +//! ws_stream_tungstenite (https://docs.rs/ws_stream_tungstenite/latest/ws_stream_tungstenite/index.html) +//! to get AsyncRead and AsyncWrite implemented for the WebSocket. Any other modification is commented with the prefix "NOTARY_MODIFICATION:" +//! +//! The code is under the following license: +//! +//! Copyright (c) 2019 Axum Contributors +//! +//! Permission is hereby granted, free of charge, to any +//! person obtaining a copy of this software and associated +//! documentation files (the "Software"), to deal in the +//! Software without restriction, including without +//! limitation the rights to use, copy, modify, merge, +//! publish, distribute, sublicense, and/or sell copies of +//! the Software, and to permit persons to whom the Software +//! is furnished to do so, subject to the following +//! conditions: +//! +//! The above copyright notice and this permission notice +//! shall be included in all copies or substantial portions +//! of the Software. +//! +//! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +//! ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +//! TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +//! PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +//! SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +//! CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +//! OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +//! IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +//! DEALINGS IN THE SOFTWARE. +//! +//! +//! Handle WebSocket connections. +//! +//! # Example +//! +//! ``` +//! use axum::{ +//! extract::ws::{WebSocketUpgrade, WebSocket}, +//! routing::get, +//! response::{IntoResponse, Response}, +//! Router, +//! }; +//! +//! let app = Router::new().route("/ws", get(handler)); +//! +//! async fn handler(ws: WebSocketUpgrade) -> Response { +//! ws.on_upgrade(handle_socket) +//! } +//! +//! async fn handle_socket(mut socket: WebSocket) { +//! while let Some(msg) = socket.recv().await { +//! let msg = if let Ok(msg) = msg { +//! msg +//! } else { +//! // client disconnected +//! return; +//! }; +//! +//! if socket.send(msg).await.is_err() { +//! // client disconnected +//! return; +//! } +//! } +//! } +//! # async { +//! # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap(); +//! # }; +//! ``` +//! +//! # Passing data and/or state to an `on_upgrade` callback +//! +//! ``` +//! use axum::{ +//! extract::{ws::{WebSocketUpgrade, WebSocket}, State}, +//! response::Response, +//! routing::get, +//! Router, +//! }; +//! +//! #[derive(Clone)] +//! struct AppState { +//! // ... +//! } +//! +//! async fn handler(ws: WebSocketUpgrade, State(state): State) -> Response { +//! ws.on_upgrade(|socket| handle_socket(socket, state)) +//! } +//! +//! async fn handle_socket(socket: WebSocket, state: AppState) { +//! // ... +//! } +//! +//! let app = Router::new() +//! .route("/ws", get(handler)) +//! .with_state(AppState { /* ... */ }); +//! # async { +//! # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap(); +//! # }; +//! ``` +//! +//! # Read and write concurrently +//! +//! If you need to read and write concurrently from a [`WebSocket`] you can use +//! [`StreamExt::split`]: +//! +//! ```rust,no_run +//! use axum::{Error, extract::ws::{WebSocket, Message}}; +//! use futures_util::{sink::SinkExt, stream::{StreamExt, SplitSink, SplitStream}}; +//! +//! async fn handle_socket(mut socket: WebSocket) { +//! let (mut sender, mut receiver) = socket.split(); +//! +//! tokio::spawn(write(sender)); +//! tokio::spawn(read(receiver)); +//! } +//! +//! async fn read(receiver: SplitStream) { +//! // ... +//! } +//! +//! async fn write(sender: SplitSink) { +//! // ... +//! } +//! ``` +//! +//! [`StreamExt::split`]: https://docs.rs/futures/0.3.17/futures/stream/trait.StreamExt.html#method.split + +#![allow(unused)] + +use self::rejection::*; +use async_trait::async_trait; +use async_tungstenite::{ + tokio::TokioAdapter, + tungstenite::{ + self as ts, + protocol::{self, WebSocketConfig}, + }, + WebSocketStream, +}; +use axum::{ + body::{self, Bytes}, + extract::FromRequestParts, + response::Response, + Error, +}; + +use futures_util::{ + sink::{Sink, SinkExt}, + stream::{Stream, StreamExt}, +}; +use http::{ + header::{self, HeaderMap, HeaderName, HeaderValue}, + request::Parts, + Method, StatusCode, +}; +use hyper::upgrade::{OnUpgrade, Upgraded}; +use sha1::{Digest, Sha1}; +use std::{ + borrow::Cow, + future::Future, + pin::Pin, + task::{Context, Poll}, +}; +use tracing::error; + +/// Extractor for establishing WebSocket connections. +/// +/// Note: This extractor requires the request method to be `GET` so it should +/// always be used with [`get`](crate::routing::get). Requests with other methods will be +/// rejected. +/// +/// See the [module docs](self) for an example. +#[cfg_attr(docsrs, doc(cfg(feature = "ws")))] +pub struct WebSocketUpgrade { + config: WebSocketConfig, + /// The chosen protocol sent in the `Sec-WebSocket-Protocol` header of the response. + protocol: Option, + sec_websocket_key: HeaderValue, + on_upgrade: OnUpgrade, + on_failed_upgrade: F, + sec_websocket_protocol: Option, +} + +impl std::fmt::Debug for WebSocketUpgrade { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("WebSocketUpgrade") + .field("config", &self.config) + .field("protocol", &self.protocol) + .field("sec_websocket_key", &self.sec_websocket_key) + .field("sec_websocket_protocol", &self.sec_websocket_protocol) + .finish_non_exhaustive() + } +} + +impl WebSocketUpgrade { + /// Set the size of the internal message send queue. + pub fn max_send_queue(mut self, max: usize) -> Self { + self.config.max_send_queue = Some(max); + self + } + + /// Set the maximum message size (defaults to 64 megabytes) + pub fn max_message_size(mut self, max: usize) -> Self { + self.config.max_message_size = Some(max); + self + } + + /// Set the maximum frame size (defaults to 16 megabytes) + pub fn max_frame_size(mut self, max: usize) -> Self { + self.config.max_frame_size = Some(max); + self + } + + /// Allow server to accept unmasked frames (defaults to false) + pub fn accept_unmasked_frames(mut self, accept: bool) -> Self { + self.config.accept_unmasked_frames = accept; + self + } + + /// Set the known protocols. + /// + /// If the protocol name specified by `Sec-WebSocket-Protocol` header + /// to match any of them, the upgrade response will include `Sec-WebSocket-Protocol` header and + /// return the protocol name. + /// + /// The protocols should be listed in decreasing order of preference: if the client offers + /// multiple protocols that the server could support, the server will pick the first one in + /// this list. + /// + /// # Examples + /// + /// ``` + /// use axum::{ + /// extract::ws::{WebSocketUpgrade, WebSocket}, + /// routing::get, + /// response::{IntoResponse, Response}, + /// Router, + /// }; + /// + /// let app = Router::new().route("/ws", get(handler)); + /// + /// async fn handler(ws: WebSocketUpgrade) -> Response { + /// ws.protocols(["graphql-ws", "graphql-transport-ws"]) + /// .on_upgrade(|socket| async { + /// // ... + /// }) + /// } + /// # async { + /// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap(); + /// # }; + /// ``` + pub fn protocols(mut self, protocols: I) -> Self + where + I: IntoIterator, + I::Item: Into>, + { + if let Some(req_protocols) = self + .sec_websocket_protocol + .as_ref() + .and_then(|p| p.to_str().ok()) + { + self.protocol = protocols + .into_iter() + // FIXME: This will often allocate a new `String` and so is less efficient than it + // could be. But that can't be fixed without breaking changes to the public API. + .map(Into::into) + .find(|protocol| { + req_protocols + .split(',') + .any(|req_protocol| req_protocol.trim() == protocol) + }) + .map(|protocol| match protocol { + Cow::Owned(s) => HeaderValue::from_str(&s).unwrap(), + Cow::Borrowed(s) => HeaderValue::from_static(s), + }); + } + + self + } + + /// Provide a callback to call if upgrading the connection fails. + /// + /// The connection upgrade is performed in a background task. If that fails this callback + /// will be called. + /// + /// By default any errors will be silently ignored. + /// + /// # Example + /// + /// ``` + /// use axum::{ + /// extract::{WebSocketUpgrade}, + /// response::Response, + /// }; + /// + /// async fn handler(ws: WebSocketUpgrade) -> Response { + /// ws.on_failed_upgrade(|error| { + /// report_error(error); + /// }) + /// .on_upgrade(|socket| async { /* ... */ }) + /// } + /// # + /// # fn report_error(_: axum::Error) {} + /// ``` + pub fn on_failed_upgrade(self, callback: C) -> WebSocketUpgrade + where + C: OnFailedUpdgrade, + { + WebSocketUpgrade { + config: self.config, + protocol: self.protocol, + sec_websocket_key: self.sec_websocket_key, + on_upgrade: self.on_upgrade, + on_failed_upgrade: callback, + sec_websocket_protocol: self.sec_websocket_protocol, + } + } + + /// Finalize upgrading the connection and call the provided callback with + /// the stream. + #[must_use = "to setup the WebSocket connection, this response must be returned"] + pub fn on_upgrade(self, callback: C) -> Response + where + C: FnOnce(WebSocket) -> Fut + Send + 'static, + Fut: Future + Send + 'static, + F: OnFailedUpdgrade, + { + let on_upgrade = self.on_upgrade; + let config = self.config; + let on_failed_upgrade = self.on_failed_upgrade; + + let protocol = self.protocol.clone(); + + tokio::spawn(async move { + let upgraded = match on_upgrade.await { + Ok(upgraded) => upgraded, + Err(err) => { + error!("Something wrong with on_upgrade: {:?}", err); + on_failed_upgrade.call(Error::new(err)); + return; + } + }; + let socket = WebSocketStream::from_raw_socket( + // NOTARY_MODIFICATION: Need to use TokioAdapter to wrap Upgraded which doesn't implement futures crate's AsyncRead and AsyncWrite + TokioAdapter::new(upgraded), + protocol::Role::Server, + Some(config), + ) + .await; + let socket = WebSocket { + inner: socket, + protocol, + }; + callback(socket).await; + }); + + #[allow(clippy::declare_interior_mutable_const)] + const UPGRADE: HeaderValue = HeaderValue::from_static("upgrade"); + #[allow(clippy::declare_interior_mutable_const)] + const WEBSOCKET: HeaderValue = HeaderValue::from_static("websocket"); + + let mut builder = Response::builder() + .status(StatusCode::SWITCHING_PROTOCOLS) + .header(header::CONNECTION, UPGRADE) + .header(header::UPGRADE, WEBSOCKET) + .header( + header::SEC_WEBSOCKET_ACCEPT, + sign(self.sec_websocket_key.as_bytes()), + ); + + if let Some(protocol) = self.protocol { + builder = builder.header(header::SEC_WEBSOCKET_PROTOCOL, protocol); + } + + builder.body(body::boxed(body::Empty::new())).unwrap() + } +} + +/// What to do when a connection upgrade fails. +/// +/// See [`WebSocketUpgrade::on_failed_upgrade`] for more details. +pub trait OnFailedUpdgrade: Send + 'static { + /// Call the callback. + fn call(self, error: Error); +} + +impl OnFailedUpdgrade for F +where + F: FnOnce(Error) + Send + 'static, +{ + fn call(self, error: Error) { + self(error) + } +} + +/// The default `OnFailedUpdgrade` used by `WebSocketUpgrade`. +/// +/// It simply ignores the error. +#[non_exhaustive] +#[derive(Debug)] +pub struct DefaultOnFailedUpdgrade; + +impl OnFailedUpdgrade for DefaultOnFailedUpdgrade { + #[inline] + fn call(self, _error: Error) {} +} + +#[async_trait] +impl FromRequestParts for WebSocketUpgrade +where + S: Send + Sync, +{ + type Rejection = WebSocketUpgradeRejection; + + async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result { + if parts.method != Method::GET { + return Err(MethodNotGet.into()); + } + + if !header_contains(&parts.headers, header::CONNECTION, "upgrade") { + return Err(InvalidConnectionHeader.into()); + } + + if !header_eq(&parts.headers, header::UPGRADE, "websocket") { + return Err(InvalidUpgradeHeader.into()); + } + + if !header_eq(&parts.headers, header::SEC_WEBSOCKET_VERSION, "13") { + return Err(InvalidWebSocketVersionHeader.into()); + } + + let sec_websocket_key = parts + .headers + .get(header::SEC_WEBSOCKET_KEY) + .ok_or(WebSocketKeyHeaderMissing)? + .clone(); + + let on_upgrade = parts + .extensions + .remove::() + .ok_or(ConnectionNotUpgradable)?; + + let sec_websocket_protocol = parts.headers.get(header::SEC_WEBSOCKET_PROTOCOL).cloned(); + + Ok(Self { + config: Default::default(), + protocol: None, + sec_websocket_key, + on_upgrade, + sec_websocket_protocol, + on_failed_upgrade: DefaultOnFailedUpdgrade, + }) + } +} + +pub fn header_eq(headers: &HeaderMap, key: HeaderName, value: &'static str) -> bool { + if let Some(header) = headers.get(&key) { + header.as_bytes().eq_ignore_ascii_case(value.as_bytes()) + } else { + false + } +} + +fn header_contains(headers: &HeaderMap, key: HeaderName, value: &'static str) -> bool { + let header = if let Some(header) = headers.get(&key) { + header + } else { + return false; + }; + + if let Ok(header) = std::str::from_utf8(header.as_bytes()) { + header.to_ascii_lowercase().contains(value) + } else { + false + } +} + +/// A stream of WebSocket messages. +/// +/// See [the module level documentation](self) for more details. +#[derive(Debug)] +pub struct WebSocket { + inner: WebSocketStream>, + protocol: Option, +} + +impl WebSocket { + /// Consume `self` and get the inner [`async_tungstenite::WebSocketStream`]. + pub fn into_inner(self) -> WebSocketStream> { + self.inner + } + + /// Receive another message. + /// + /// Returns `None` if the stream has closed. + pub async fn recv(&mut self) -> Option> { + self.next().await + } + + /// Send a message. + pub async fn send(&mut self, msg: Message) -> Result<(), Error> { + self.inner + .send(msg.into_tungstenite()) + .await + .map_err(Error::new) + } + + /// Gracefully close this WebSocket. + pub async fn close(mut self) -> Result<(), Error> { + self.inner.close(None).await.map_err(Error::new) + } + + /// Return the selected WebSocket subprotocol, if one has been chosen. + pub fn protocol(&self) -> Option<&HeaderValue> { + self.protocol.as_ref() + } +} + +impl Stream for WebSocket { + type Item = Result; + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + loop { + match futures_util::ready!(self.inner.poll_next_unpin(cx)) { + Some(Ok(msg)) => { + if let Some(msg) = Message::from_tungstenite(msg) { + return Poll::Ready(Some(Ok(msg))); + } + } + Some(Err(err)) => return Poll::Ready(Some(Err(Error::new(err)))), + None => return Poll::Ready(None), + } + } + } +} + +impl Sink for WebSocket { + type Error = Error; + + fn poll_ready(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::new(&mut self.inner).poll_ready(cx).map_err(Error::new) + } + + fn start_send(mut self: Pin<&mut Self>, item: Message) -> Result<(), Self::Error> { + Pin::new(&mut self.inner) + .start_send(item.into_tungstenite()) + .map_err(Error::new) + } + + fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::new(&mut self.inner).poll_flush(cx).map_err(Error::new) + } + + fn poll_close(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::new(&mut self.inner).poll_close(cx).map_err(Error::new) + } +} + +/// Status code used to indicate why an endpoint is closing the WebSocket connection. +pub type CloseCode = u16; + +/// A struct representing the close command. +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct CloseFrame<'t> { + /// The reason as a code. + pub code: CloseCode, + /// The reason as text string. + pub reason: Cow<'t, str>, +} + +/// A WebSocket message. +// +// This code comes from https://github.com/snapview/tungstenite-rs/blob/master/src/protocol/message.rs and is under following license: +// Copyright (c) 2017 Alexey Galakhov +// Copyright (c) 2016 Jason Housley +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +#[derive(Debug, Eq, PartialEq, Clone)] +pub enum Message { + /// A text WebSocket message + Text(String), + /// A binary WebSocket message + Binary(Vec), + /// A ping message with the specified payload + /// + /// The payload here must have a length less than 125 bytes. + /// + /// Ping messages will be automatically responded to by the server, so you do not have to worry + /// about dealing with them yourself. + Ping(Vec), + /// A pong message with the specified payload + /// + /// The payload here must have a length less than 125 bytes. + /// + /// Pong messages will be automatically sent to the client if a ping message is received, so + /// you do not have to worry about constructing them yourself unless you want to implement a + /// [unidirectional heartbeat](https://tools.ietf.org/html/rfc6455#section-5.5.3). + Pong(Vec), + /// A close message with the optional close frame. + Close(Option>), +} + +impl Message { + fn into_tungstenite(self) -> ts::Message { + match self { + Self::Text(text) => ts::Message::Text(text), + Self::Binary(binary) => ts::Message::Binary(binary), + Self::Ping(ping) => ts::Message::Ping(ping), + Self::Pong(pong) => ts::Message::Pong(pong), + Self::Close(Some(close)) => ts::Message::Close(Some(ts::protocol::CloseFrame { + code: ts::protocol::frame::coding::CloseCode::from(close.code), + reason: close.reason, + })), + Self::Close(None) => ts::Message::Close(None), + } + } + + fn from_tungstenite(message: ts::Message) -> Option { + match message { + ts::Message::Text(text) => Some(Self::Text(text)), + ts::Message::Binary(binary) => Some(Self::Binary(binary)), + ts::Message::Ping(ping) => Some(Self::Ping(ping)), + ts::Message::Pong(pong) => Some(Self::Pong(pong)), + ts::Message::Close(Some(close)) => Some(Self::Close(Some(CloseFrame { + code: close.code.into(), + reason: close.reason, + }))), + ts::Message::Close(None) => Some(Self::Close(None)), + // we can ignore `Frame` frames as recommended by the tungstenite maintainers + // https://github.com/snapview/tungstenite-rs/issues/268 + ts::Message::Frame(_) => None, + } + } + + /// Consume the WebSocket and return it as binary data. + pub fn into_data(self) -> Vec { + match self { + Self::Text(string) => string.into_bytes(), + Self::Binary(data) | Self::Ping(data) | Self::Pong(data) => data, + Self::Close(None) => Vec::new(), + Self::Close(Some(frame)) => frame.reason.into_owned().into_bytes(), + } + } + + /// Attempt to consume the WebSocket message and convert it to a String. + pub fn into_text(self) -> Result { + match self { + Self::Text(string) => Ok(string), + Self::Binary(data) | Self::Ping(data) | Self::Pong(data) => Ok(String::from_utf8(data) + .map_err(|err| err.utf8_error()) + .map_err(Error::new)?), + Self::Close(None) => Ok(String::new()), + Self::Close(Some(frame)) => Ok(frame.reason.into_owned()), + } + } + + /// Attempt to get a &str from the WebSocket message, + /// this will try to convert binary data to utf8. + pub fn to_text(&self) -> Result<&str, Error> { + match *self { + Self::Text(ref string) => Ok(string), + Self::Binary(ref data) | Self::Ping(ref data) | Self::Pong(ref data) => { + Ok(std::str::from_utf8(data).map_err(Error::new)?) + } + Self::Close(None) => Ok(""), + Self::Close(Some(ref frame)) => Ok(&frame.reason), + } + } +} + +impl From for Message { + fn from(string: String) -> Self { + Message::Text(string) + } +} + +impl<'s> From<&'s str> for Message { + fn from(string: &'s str) -> Self { + Message::Text(string.into()) + } +} + +impl<'b> From<&'b [u8]> for Message { + fn from(data: &'b [u8]) -> Self { + Message::Binary(data.into()) + } +} + +impl From> for Message { + fn from(data: Vec) -> Self { + Message::Binary(data) + } +} + +impl From for Vec { + fn from(msg: Message) -> Self { + msg.into_data() + } +} + +fn sign(key: &[u8]) -> HeaderValue { + use base64::engine::Engine as _; + + let mut sha1 = Sha1::default(); + sha1.update(key); + sha1.update(&b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"[..]); + let b64 = Bytes::from(base64::engine::general_purpose::STANDARD.encode(sha1.finalize())); + HeaderValue::from_maybe_shared(b64).expect("base64 is a valid value") +} + +pub mod rejection { + //! WebSocket specific rejections. + + use axum_core::{ + __composite_rejection as composite_rejection, __define_rejection as define_rejection, + }; + + define_rejection! { + #[status = METHOD_NOT_ALLOWED] + #[body = "Request method must be `GET`"] + /// Rejection type for [`WebSocketUpgrade`](super::WebSocketUpgrade). + pub struct MethodNotGet; + } + + define_rejection! { + #[status = BAD_REQUEST] + #[body = "Connection header did not include 'upgrade'"] + /// Rejection type for [`WebSocketUpgrade`](super::WebSocketUpgrade). + pub struct InvalidConnectionHeader; + } + + define_rejection! { + #[status = BAD_REQUEST] + #[body = "`Upgrade` header did not include 'websocket'"] + /// Rejection type for [`WebSocketUpgrade`](super::WebSocketUpgrade). + pub struct InvalidUpgradeHeader; + } + + define_rejection! { + #[status = BAD_REQUEST] + #[body = "`Sec-WebSocket-Version` header did not include '13'"] + /// Rejection type for [`WebSocketUpgrade`](super::WebSocketUpgrade). + pub struct InvalidWebSocketVersionHeader; + } + + define_rejection! { + #[status = BAD_REQUEST] + #[body = "`Sec-WebSocket-Key` header missing"] + /// Rejection type for [`WebSocketUpgrade`](super::WebSocketUpgrade). + pub struct WebSocketKeyHeaderMissing; + } + + define_rejection! { + #[status = UPGRADE_REQUIRED] + #[body = "WebSocket request couldn't be upgraded since no upgrade state was present"] + /// Rejection type for [`WebSocketUpgrade`](super::WebSocketUpgrade). + /// + /// This rejection is returned if the connection cannot be upgraded for example if the + /// request is HTTP/1.0. + /// + /// See [MDN] for more details about connection upgrades. + /// + /// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade + pub struct ConnectionNotUpgradable; + } + + composite_rejection! { + /// Rejection used for [`WebSocketUpgrade`](super::WebSocketUpgrade). + /// + /// Contains one variant for each way the [`WebSocketUpgrade`](super::WebSocketUpgrade) + /// extractor can fail. + pub enum WebSocketUpgradeRejection { + MethodNotGet, + InvalidConnectionHeader, + InvalidUpgradeHeader, + InvalidWebSocketVersionHeader, + WebSocketKeyHeaderMissing, + ConnectionNotUpgradable, + } + } +} + +pub mod close_code { + //! Constants for [`CloseCode`]s. + //! + //! [`CloseCode`]: super::CloseCode + + /// Indicates a normal closure, meaning that the purpose for which the connection was + /// established has been fulfilled. + pub const NORMAL: u16 = 1000; + + /// Indicates that an endpoint is "going away", such as a server going down or a browser having + /// navigated away from a page. + pub const AWAY: u16 = 1001; + + /// Indicates that an endpoint is terminating the connection due to a protocol error. + pub const PROTOCOL: u16 = 1002; + + /// Indicates that an endpoint is terminating the connection because it has received a type of + /// data it cannot accept (e.g., an endpoint that understands only text data MAY send this if + /// it receives a binary message). + pub const UNSUPPORTED: u16 = 1003; + + /// Indicates that no status code was included in a closing frame. + pub const STATUS: u16 = 1005; + + /// Indicates an abnormal closure. + pub const ABNORMAL: u16 = 1006; + + /// Indicates that an endpoint is terminating the connection because it has received data + /// within a message that was not consistent with the type of the message (e.g., non-UTF-8 + /// RFC3629 data within a text message). + pub const INVALID: u16 = 1007; + + /// Indicates that an endpoint is terminating the connection because it has received a message + /// that violates its policy. This is a generic status code that can be returned when there is + /// no other more suitable status code (e.g., `UNSUPPORTED` or `SIZE`) or if there is a need to + /// hide specific details about the policy. + pub const POLICY: u16 = 1008; + + /// Indicates that an endpoint is terminating the connection because it has received a message + /// that is too big for it to process. + pub const SIZE: u16 = 1009; + + /// Indicates that an endpoint (client) is terminating the connection because it has expected + /// the server to negotiate one or more extension, but the server didn't return them in the + /// response message of the WebSocket handshake. The list of extensions that are needed should + /// be given as the reason for closing. Note that this status code is not used by the server, + /// because it can fail the WebSocket handshake instead. + pub const EXTENSION: u16 = 1010; + + /// Indicates that a server is terminating the connection because it encountered an unexpected + /// condition that prevented it from fulfilling the request. + pub const ERROR: u16 = 1011; + + /// Indicates that the server is restarting. + pub const RESTART: u16 = 1012; + + /// Indicates that the server is overloaded and the client should either connect to a different + /// IP (when multiple targets exist), or reconnect to the same IP when a user has performed an + /// action. + pub const AGAIN: u16 = 1013; +} + +#[cfg(test)] +mod tests { + use super::*; + use axum::{body::Body, routing::get, Router}; + use http::{Request, Version}; + use tower::ServiceExt; + + #[tokio::test] + async fn rejects_http_1_0_requests() { + let svc = get(|ws: Result| { + let rejection = ws.unwrap_err(); + assert!(matches!( + rejection, + WebSocketUpgradeRejection::ConnectionNotUpgradable(_) + )); + std::future::ready(()) + }); + + let req = Request::builder() + .version(Version::HTTP_10) + .method(Method::GET) + .header("upgrade", "websocket") + .header("connection", "Upgrade") + .header("sec-websocket-key", "6D69KGBOr4Re+Nj6zx9aQA==") + .header("sec-websocket-version", "13") + .body(Body::empty()) + .unwrap(); + + let res = svc.oneshot(req).await.unwrap(); + + assert_eq!(res.status(), StatusCode::OK); + } + + #[allow(dead_code)] + fn default_on_failed_upgrade() { + async fn handler(ws: WebSocketUpgrade) -> Response { + ws.on_upgrade(|_| async {}) + } + let _: Router = Router::new().route("/", get(handler)); + } + + #[allow(dead_code)] + fn on_failed_upgrade() { + async fn handler(ws: WebSocketUpgrade) -> Response { + ws.on_failed_upgrade(|_error: Error| println!("oops!")) + .on_upgrade(|_| async {}) + } + let _: Router = Router::new().route("/", get(handler)); + } +} diff --git a/interactive-demo/verifier/src/lib.rs b/interactive-demo/verifier/src/lib.rs new file mode 100644 index 0000000..66c5988 --- /dev/null +++ b/interactive-demo/verifier/src/lib.rs @@ -0,0 +1,161 @@ +use axum::{extract::State, response::IntoResponse, routing::get, Router}; +use axum_websocket::{WebSocket, WebSocketUpgrade}; +use eyre::eyre; +use http::Request; +use hyper::server::conn::Http; +use std::{ + net::{IpAddr, SocketAddr}, + sync::Arc, +}; +use tlsn_core::proof::SessionInfo; +use tlsn_verifier::tls::{Verifier, VerifierConfig}; +use tokio::{ + io::{AsyncRead, AsyncWrite}, + net::TcpListener, +}; +use tokio_util::compat::TokioAsyncReadCompatExt; +use tower::MakeService; +use tracing::{debug, error, info}; +use ws_stream_tungstenite::WsStream; + +mod axum_websocket; + +/// Global data that needs to be shared with the axum handlers +#[derive(Clone, Debug)] +struct VerifierGlobals { + pub server_domain: String, + pub verification_session_id: String, +} + +pub async fn run_server( + verifier_host: &str, + verifier_port: u16, + server_domain: &str, + verification_session_id: &str, +) -> Result<(), eyre::ErrReport> { + let verifier_address = SocketAddr::new( + IpAddr::V4(verifier_host.parse().map_err(|err| { + eyre!("Failed to parse verifer host address from server config: {err}") + })?), + verifier_port, + ); + let listener = TcpListener::bind(verifier_address) + .await + .map_err(|err| eyre!("Failed to bind server address to tcp listener: {err}"))?; + + info!("Listening for TCP traffic at {}", verifier_address); + + let protocol = Arc::new(Http::new()); + let router = Router::new() + .route("/verify", get(ws_handler)) + .with_state(VerifierGlobals { + server_domain: server_domain.to_string(), + verification_session_id: verification_session_id.to_string(), + }); + let mut app = router.into_make_service(); + + loop { + let stream = match listener.accept().await { + Ok((stream, _)) => stream, + Err(err) => { + error!("Failed to connect to prover: {err}"); + continue; + } + }; + debug!("Received a prover's TCP connection"); + + let protocol = protocol.clone(); + let service = MakeService::<_, Request>::make_service(&mut app, &stream); + + tokio::spawn(async move { + info!("Accepted prover's TCP connection",); + let _ = protocol + // Can unwrap because it's infallible + .serve_connection(stream, service.await.unwrap()) + // use with_upgrades to upgrade connection to websocket for websocket clients + // and to extract tcp connection for tcp clients + .with_upgrades() + .await; + }); + } +} + +async fn ws_handler( + ws: WebSocketUpgrade, + State(verifier_globals): State, +) -> impl IntoResponse { + info!("Received websocket request"); + ws.on_upgrade(|socket| handle_socket(socket, verifier_globals)) +} + +async fn handle_socket(socket: WebSocket, verifier_globals: VerifierGlobals) { + debug!("Upgraded to websocket connection"); + let stream = WsStream::new(socket.into_inner()); + + match verifier( + stream, + &verifier_globals.verification_session_id, + &verifier_globals.server_domain, + ) + .await + { + Ok((sent, received, _session_info)) => { + info!("Successfully verified {}", &verifier_globals.server_domain); + info!("Verified sent data:\n{}", sent,); + println!("Verified received data:\n{}", received,); + } + Err(err) => { + error!("Failed verification using websocket: {err}"); + } + } +} + +async fn verifier( + socket: T, + verification_session_id: &str, + server_domain: &str, +) -> Result<(String, String, SessionInfo), eyre::ErrReport> { + debug!("Starting verification..."); + + // Setup Verifier. + let verifier_config = VerifierConfig::builder() + .id(verification_session_id) + .build()?; + let verifier = Verifier::new(verifier_config); + + // Verify MPC-TLS and wait for (redacted) data. + let (sent, received, session_info) = verifier + .verify(socket.compat()) + .await + .map_err(|err| eyre!("Verification failed: {err}"))?; + + // Check send data: check host. + let sent_data = String::from_utf8(sent.data().to_vec()) + .map_err(|err| eyre!("Failed to parse sent data: {err}"))?; + sent_data + .find(server_domain) + .ok_or_else(|| eyre!("Verification failed: Expected host {}", server_domain))?; + + // Check received data: check json and version number. + let response = String::from_utf8(received.data().to_vec()) + .map_err(|err| eyre!("Failed to parse received data: {err}"))?; + response + .find("BEGIN PUBLIC KEY") + .ok_or_else(|| eyre!("Verification failed: invalid public key in JSON response"))?; + // Check Session info: server name. + if session_info.server_name.as_str() != server_domain { + return Err(eyre!("Verification failed: server name mismatches")); + } + + let sent_string = bytes_to_redacted_string(sent.data())?; + let received_string = bytes_to_redacted_string(received.data())?; + + Ok((sent_string, received_string, session_info)) +} + +/// Render redacted bytes as `🙈`. +fn bytes_to_redacted_string(bytes: &[u8]) -> Result { + Ok(String::from_utf8(bytes.to_vec()) + .map_err(|err| eyre!("Failed to parse bytes to redacted string: {err}"))? + .replace('\0', "🙈")) +} diff --git a/interactive-demo/verifier/src/main.rs b/interactive-demo/verifier/src/main.rs new file mode 100644 index 0000000..db6b058 --- /dev/null +++ b/interactive-demo/verifier/src/main.rs @@ -0,0 +1,29 @@ +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; +use verifier::run_server; + +const VERIFIER_HOST: &str = "0.0.0.0"; +const VERIFIER_PORT: u16 = 9816; +const TRACING_FILTER: &str = "DEBUG"; + +/// Make sure these are the same on the prover side +const SERVER_DOMAIN: &str = "notary.pse.dev"; +const VERIFICATION_SESSION_ID: &str = "interactive-verifier-demo"; + + +#[tokio::main] +async fn main() -> Result<(), eyre::ErrReport> { + tracing_subscriber::registry() + .with(EnvFilter::try_from_default_env().unwrap_or_else(|_| TRACING_FILTER.into())) + .with(tracing_subscriber::fmt::layer()) + .init(); + + run_server( + VERIFIER_HOST, + VERIFIER_PORT, + SERVER_DOMAIN, + VERIFICATION_SESSION_ID, + ) + .await?; + + Ok(()) +} From 2be01981b38c440fd3c6ecd90f5f81ac9425d977 Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Thu, 4 Apr 2024 21:16:45 +0800 Subject: [PATCH 02/14] Remove Cargo.lock. --- .gitignore | 1 + interactive-demo/verifier/Cargo.lock | 3766 -------------------------- 2 files changed, 1 insertion(+), 3766 deletions(-) delete mode 100644 interactive-demo/verifier/Cargo.lock diff --git a/.gitignore b/.gitignore index 40ef638..6703e23 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ package-lock.json pnpm-lock.yaml yarn.lock **/target* +Cargo.lock diff --git a/interactive-demo/verifier/Cargo.lock b/interactive-demo/verifier/Cargo.lock deleted file mode 100644 index 71a8564..0000000 --- a/interactive-demo/verifier/Cargo.lock +++ /dev/null @@ -1,3766 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" - -[[package]] -name = "ark-ec" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" -dependencies = [ - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "derivative", - "hashbrown", - "itertools", - "num-traits", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", - "derivative", - "digest 0.10.7", - "itertools", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-poly" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" -dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", - "derivative", - "hashbrown", -] - -[[package]] -name = "ark-secp256r1" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3975a01b0a6e3eae0f72ec7ca8598a6620fc72fa5981f6f5cca33b7cd788f633" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", -] - -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-serialize-derive", - "ark-std", - "digest 0.10.7", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" -dependencies = [ - "concurrent-queue", - "event-listener 5.2.0", - "event-listener-strategy 0.5.1", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b3e585719c2358d2660232671ca8ca4ddb4be4ce8a1842d6c2dc8685303316" -dependencies = [ - "async-lock 3.3.0", - "async-task", - "concurrent-queue", - "fastrand 2.0.2", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.2.0", - "async-executor", - "async-io 2.3.2", - "async-lock 3.3.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" -dependencies = [ - "async-lock 3.3.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.6.0", - "rustix 0.38.32", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-task" -version = "4.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" - -[[package]] -name = "async-trait" -version = "0.1.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "async-tungstenite" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5682ea0913e5c20780fe5785abacb85a411e7437bf52a1bedb93ddb3972cb8dd" -dependencies = [ - "futures-io", - "futures-util", - "log", - "pin-project-lite", - "tungstenite 0.16.0", -] - -[[package]] -name = "async-tungstenite" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce01ac37fdc85f10a43c43bc582cbd566720357011578a935761075f898baf58" -dependencies = [ - "futures-io", - "futures-util", - "log", - "native-tls", - "pin-project-lite", - "tokio", - "tokio-native-tls", - "tungstenite 0.19.0", -] - -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version", - "tokio", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" - -[[package]] -name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core", - "base64 0.21.7", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sha1", - "sync_wrapper", - "tokio", - "tokio-tungstenite", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - -[[package]] -name = "backtrace" -version = "0.3.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bcs" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b6598a2f5d564fb7855dc6b06fd1c38cff5a72bd8b863a4d021938497b440a" -dependencies = [ - "serde", - "thiserror", -] - -[[package]] -name = "bimap" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" -dependencies = [ - "serde", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "blake3" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", - "rayon", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "blocking" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" -dependencies = [ - "async-channel 2.2.0", - "async-lock 3.3.0", - "async-task", - "fastrand 2.0.2", - "futures-io", - "futures-lite 2.3.0", - "piper", - "tracing", -] - -[[package]] -name = "bumpalo" -version = "3.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" - -[[package]] -name = "bytemuck" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" -dependencies = [ - "serde", -] - -[[package]] -name = "cc" -version = "1.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "clmul" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "bytemuck", - "cfg-if", - "cpufeatures", -] - -[[package]] -name = "concurrent-queue" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - -[[package]] -name = "curve25519-dalek" -version = "4.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "fiat-crypto", - "platforms", - "rand_core", - "rustc_version", - "serde", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", -] - -[[package]] -name = "darling" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" -dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.109", -] - -[[package]] -name = "darling_core" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.58", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" -dependencies = [ - "darling_core 0.20.8", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "data-encoding" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro 0.11.2", -] - -[[package]] -name = "derive_builder" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" -dependencies = [ - "derive_builder_macro 0.12.0", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_core" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core 0.11.2", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" -dependencies = [ - "derive_builder_core 0.12.0", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "serdect", - "signature", - "spki", -] - -[[package]] -name = "educe" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" -dependencies = [ - "enum-ordinalize", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "either" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "hkdf", - "pem-rfc7468", - "pkcs8", - "rand_core", - "sec1", - "serdect", - "subtle", - "zeroize", -] - -[[package]] -name = "enum-ordinalize" -version = "3.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "enum-try-as-inner" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c448fc2753338b04aa344ead5a6bdda26f2df2dcd85b65c86dd15b16819369e" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" -dependencies = [ - "event-listener 5.2.0", - "pin-project-lite", -] - -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "fiat-crypto" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand 2.0.2", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.6", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "itybity" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f242558c18a6d4ec99bc1eaf1603ab49e857ab36b4c1b911ebd0028cb8165e79" -dependencies = [ - "rayon", -] - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" -dependencies = [ - "value-bag", -] - -[[package]] -name = "ludi" -version = "0.1.0" -source = "git+https://github.com/sinui0/ludi?rev=b590de5#b590de59e700ec2dc3295a74111536f192206cd5" -dependencies = [ - "futures-util", - "ludi-core", - "ludi-macros", -] - -[[package]] -name = "ludi-core" -version = "0.1.0" -source = "git+https://github.com/sinui0/ludi?rev=b590de5#b590de59e700ec2dc3295a74111536f192206cd5" -dependencies = [ - "futures-channel", - "futures-core", - "futures-util", -] - -[[package]] -name = "ludi-macros" -version = "0.1.0" -source = "git+https://github.com/sinui0/ludi?rev=b590de5#b590de59e700ec2dc3295a74111536f192206cd5" -dependencies = [ - "darling 0.20.8", - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - -[[package]] -name = "matrix-transpose" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "thiserror", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "mpz-circuits" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "bincode", - "itybity", - "mpz-circuits-macros", - "once_cell", - "rand", - "regex", - "serde", - "serde_arrays", - "sha2", - "thiserror", -] - -[[package]] -name = "mpz-circuits-macros" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "mpz-core" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "aes", - "bcs", - "blake3", - "bytemuck", - "cfg-if", - "cipher", - "clmul", - "generic-array", - "itybity", - "once_cell", - "opaque-debug", - "rand", - "rand_chacha", - "rand_core", - "rayon", - "serde", - "thiserror", -] - -[[package]] -name = "mpz-garble" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "aes", - "async-trait", - "cipher", - "derive_builder 0.11.2", - "futures", - "futures-util", - "itybity", - "mpz-circuits", - "mpz-core", - "mpz-garble-core", - "mpz-ot", - "opaque-debug", - "prost", - "rand", - "rand_chacha", - "rand_core", - "rayon", - "thiserror", - "tlsn-utils", - "tlsn-utils-aio", -] - -[[package]] -name = "mpz-garble-core" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "aes", - "blake3", - "cipher", - "derive_builder 0.11.2", - "itybity", - "mpz-circuits", - "mpz-core", - "once_cell", - "rand", - "rand_chacha", - "rand_core", - "serde", - "serde_arrays", - "thiserror", -] - -[[package]] -name = "mpz-ot" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "aes", - "async-trait", - "cfg-if", - "cipher", - "enum-try-as-inner", - "futures", - "futures-util", - "itybity", - "mpz-core", - "mpz-ot-core", - "opaque-debug", - "prost", - "rand", - "rand_chacha", - "rand_core", - "rayon", - "serde", - "thiserror", - "tlsn-utils-aio", -] - -[[package]] -name = "mpz-ot-core" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "aes", - "blake3", - "bytemuck", - "cfg-if", - "cipher", - "clmul", - "ctr", - "curve25519-dalek", - "derive_builder 0.11.2", - "enum-try-as-inner", - "itybity", - "matrix-transpose", - "mpz-core", - "opaque-debug", - "rand", - "rand_chacha", - "rand_core", - "rayon", - "serde", - "thiserror", - "tlsn-utils", -] - -[[package]] -name = "mpz-share-conversion" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "async-trait", - "derive_builder 0.11.2", - "futures", - "mpz-core", - "mpz-ot", - "mpz-share-conversion-core", - "rand", - "rand_chacha", - "serde", - "thiserror", - "tlsn-utils-aio", -] - -[[package]] -name = "mpz-share-conversion-core" -version = "0.1.0" -source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=850636f#850636fae4b327d2dba3924c9fa7a8c4c9003ab1" -dependencies = [ - "ark-ff", - "ark-secp256r1", - "ark-serialize", - "itybity", - "mpz-core", - "num-bigint", - "opaque-debug", - "rand", - "serde", - "thiserror", -] - -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags 2.5.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "serdect", - "sha2", -] - -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.48.5", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand 2.0.2", - "futures-io", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi", - "pin-project-lite", - "rustix 0.38.32", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", - "serdect", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.3", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rs_merkle" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b241d2e59b74ef9e98d94c78c47623d04c8392abaf82014dfd372a16041128f" -dependencies = [ - "sha2", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" -dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys 0.4.13", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-pki-types" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "serdect", - "subtle", - "zeroize", -] - -[[package]] -name = "security-framework" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - -[[package]] -name = "serde" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_arrays" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38636132857f68ec3d5f3eb121166d2af33cb55174c4d5ff645db6165cbef0fd" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "serde_json" -version = "1.0.115" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serdect" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" -dependencies = [ - "base16ct", - "serde", -] - -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest 0.10.7", - "rand_core", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand 2.0.2", - "rustix 0.38.32", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tlsn-aead" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "derive_builder 0.12.0", - "futures", - "mpz-core", - "mpz-garble", - "serde", - "thiserror", - "tlsn-block-cipher", - "tlsn-stream-cipher", - "tlsn-universal-hash", - "tlsn-utils-aio", - "tracing", -] - -[[package]] -name = "tlsn-block-cipher" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "derive_builder 0.12.0", - "mpz-circuits", - "mpz-garble", - "thiserror", - "tlsn-utils", - "tracing", -] - -[[package]] -name = "tlsn-common" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "futures", - "tlsn-utils-aio", - "uid-mux", -] - -[[package]] -name = "tlsn-core" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "bimap", - "bytes", - "getrandom", - "mpz-circuits", - "mpz-core", - "mpz-garble-core", - "opaque-debug", - "p256", - "ring", - "rs_merkle", - "serde", - "thiserror", - "tlsn-tls-core", - "tlsn-utils", - "web-time", - "webpki-roots", -] - -[[package]] -name = "tlsn-hmac-sha256" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "derive_builder 0.12.0", - "enum-try-as-inner", - "futures", - "mpz-circuits", - "mpz-garble", - "thiserror", - "tlsn-hmac-sha256-circuits", - "tlsn-utils-aio", - "tracing", -] - -[[package]] -name = "tlsn-hmac-sha256-circuits" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "mpz-circuits", - "tracing", -] - -[[package]] -name = "tlsn-key-exchange" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "derive_builder 0.12.0", - "futures", - "mpz-circuits", - "mpz-garble", - "mpz-ot", - "mpz-share-conversion-core", - "p256", - "serde", - "thiserror", - "tlsn-point-addition", - "tlsn-utils-aio", - "tracing", -] - -[[package]] -name = "tlsn-point-addition" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "mpz-core", - "mpz-share-conversion", - "mpz-share-conversion-core", - "p256", - "thiserror", - "tracing", -] - -[[package]] -name = "tlsn-stream-cipher" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "aes", - "async-trait", - "cipher", - "ctr", - "derive_builder 0.12.0", - "mpz-circuits", - "mpz-garble", - "thiserror", - "tlsn-utils", - "tracing", -] - -[[package]] -name = "tlsn-tls-backend" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "futures", - "thiserror", - "tlsn-tls-core", -] - -[[package]] -name = "tlsn-tls-core" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "futures", - "hmac", - "rand", - "ring", - "rustls-pemfile", - "sct", - "serde", - "sha2", - "thiserror", - "tracing", - "web-time", - "webpki", -] - -[[package]] -name = "tlsn-tls-mpc" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "derive_builder 0.12.0", - "enum-try-as-inner", - "futures", - "ludi", - "mpz-core", - "mpz-garble", - "mpz-share-conversion", - "p256", - "rand", - "serde", - "thiserror", - "tlsn-aead", - "tlsn-block-cipher", - "tlsn-hmac-sha256", - "tlsn-key-exchange", - "tlsn-point-addition", - "tlsn-stream-cipher", - "tlsn-tls-backend", - "tlsn-tls-core", - "tlsn-universal-hash", - "tlsn-utils-aio", - "tracing", -] - -[[package]] -name = "tlsn-universal-hash" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "derive_builder 0.12.0", - "futures", - "futures-util", - "mpz-core", - "mpz-share-conversion", - "mpz-share-conversion-core", - "opaque-debug", - "thiserror", - "tracing", -] - -[[package]] -name = "tlsn-utils" -version = "0.1.0" -source = "git+https://github.com/tlsnotary/tlsn-utils?rev=51f313d#51f313d153f1b878e583e709d66a4661b40c2b6c" -dependencies = [ - "serde", -] - -[[package]] -name = "tlsn-utils-aio" -version = "0.1.0" -source = "git+https://github.com/tlsnotary/tlsn-utils?rev=51f313d#51f313d153f1b878e583e709d66a4661b40c2b6c" -dependencies = [ - "async-std", - "async-trait", - "async-tungstenite 0.16.1", - "bytes", - "futures", - "futures-util", - "rayon", - "serde", - "thiserror", - "tokio", - "tokio-serde", - "tokio-util", - "wasm-bindgen-futures", -] - -[[package]] -name = "tlsn-verifier" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "derive_builder 0.12.0", - "futures", - "mpz-circuits", - "mpz-core", - "mpz-garble", - "mpz-ot", - "mpz-share-conversion", - "opaque-debug", - "rand", - "signature", - "thiserror", - "tlsn-common", - "tlsn-core", - "tlsn-tls-core", - "tlsn-tls-mpc", - "tlsn-utils-aio", - "tracing", - "uid-mux", -] - -[[package]] -name = "tokio" -version = "1.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2 0.5.6", - "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-macros" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-serde" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" -dependencies = [ - "bincode", - "bytes", - "educe", - "futures-core", - "futures-sink", - "pin-project", - "serde", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite 0.20.1", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-io", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "tungstenite" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http", - "httparse", - "log", - "rand", - "sha-1", - "thiserror", - "url", - "utf-8", -] - -[[package]] -name = "tungstenite" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "native-tls", - "rand", - "sha1", - "thiserror", - "url", - "utf-8", -] - -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "rand", - "sha1", - "thiserror", - "url", - "utf-8", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "uid-mux" -version = "0.1.0-alpha.4" -source = "git+https://github.com/tlsnotary/tlsn.git?tag=v0.1.0-alpha.4#309c37fdecd719d8837ec617646a2d394ac3386f" -dependencies = [ - "async-trait", - "futures", - "tlsn-utils-aio", - "tracing", - "yamux", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "value-bag" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "verifier" -version = "0.1.0" -dependencies = [ - "async-trait", - "async-tungstenite 0.22.2", - "axum", - "axum-core", - "base64 0.21.7", - "eyre", - "futures-util", - "http", - "hyper", - "serde", - "sha1", - "tlsn-core", - "tlsn-verifier", - "tokio", - "tokio-util", - "tower", - "tracing", - "tracing-subscriber", - "ws_stream_tungstenite", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.58", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" -dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" - -[[package]] -name = "ws_stream_tungstenite" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6e7a5ba9436eb3868b052be83377dc685fad6d2f4cddaa2a2251b673472071" -dependencies = [ - "async-tungstenite 0.22.2", - "async_io_stream", - "bitflags 2.5.0", - "futures-core", - "futures-io", - "futures-sink", - "futures-util", - "log", - "pharos", - "rustc_version", - "tokio", - "tungstenite 0.19.0", -] - -[[package]] -name = "yamux" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0875ad26dfbf0e7126d4a200747c78496aa3f0225d094a8c867b0e98bb19f9d7" -dependencies = [ - "futures", - "log", - "nohash-hasher", - "parking_lot", - "pin-project", - "rand", - "static_assertions", -] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - -[[package]] -name = "zeroize" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] From 4b29bf854ad79d355a704e183a87ee465c7249f7 Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Fri, 5 Apr 2024 16:30:35 +0800 Subject: [PATCH 03/14] Add prover. --- .vscode/settings.json | 3 +- interactive-demo/prover/prover-rs/Cargo.toml | 31 ++++ interactive-demo/prover/prover-rs/README.md | 9 + interactive-demo/prover/prover-rs/src/main.rs | 168 ++++++++++++++++++ interactive-demo/verifier/Cargo.toml | 10 +- interactive-demo/verifier/README.md | 3 +- interactive-demo/verifier/src/main.rs | 6 +- 7 files changed, 221 insertions(+), 9 deletions(-) create mode 100644 interactive-demo/prover/prover-rs/Cargo.toml create mode 100644 interactive-demo/prover/prover-rs/README.md create mode 100644 interactive-demo/prover/prover-rs/src/main.rs diff --git a/.vscode/settings.json b/.vscode/settings.json index 9684ecb..b893da9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,8 @@ { "rust-analyzer.linkedProjects": [ "wasm/prover/Cargo.toml", - "interactive-demo/verifier/Cargo.toml" + "interactive-demo/verifier/Cargo.toml", + "interactive-demo/prover/prover-rs/Cargo.toml" ], "rust-analyzer.cargo.target": "wasm32-unknown-unknown" } diff --git a/interactive-demo/prover/prover-rs/Cargo.toml b/interactive-demo/prover/prover-rs/Cargo.toml new file mode 100644 index 0000000..3230baf --- /dev/null +++ b/interactive-demo/prover/prover-rs/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "prover" +version = "0.1.0" +edition = "2021" + +[dependencies] +tracing = "0.1.40" +tracing-subscriber = { version ="0.3.18", features = ["env-filter"] } +tokio = {version = "1", features = [ + "rt", + "rt-multi-thread", + "macros", + "net", + "io-std", + "fs", +]} +tokio-util = { version = "0.7", features = ["compat"] } +http = "0.2.9" +hyper-util = {version = "0.1", features = ["full"]} +http-body-util = "0.1" +hyper = {version = "1.1", features = ["client", "http1"]} +uuid = { version = "1.4.1", features = ["v4", "fast-rng"] } +regex = "1.10.3" +futures = "0.3" +async-tungstenite = { version = "0.22.2", features = ["tokio-runtime"] } +ws_stream_tungstenite = { version = "0.10.0", features = ["tokio_io"] } + +tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-core" } +tlsn-prover = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-prover", features = [ + "tracing", +] } diff --git a/interactive-demo/prover/prover-rs/README.md b/interactive-demo/prover/prover-rs/README.md new file mode 100644 index 0000000..0b92d86 --- /dev/null +++ b/interactive-demo/prover/prover-rs/README.md @@ -0,0 +1,9 @@ +## Interactive Prover +An implementation of the interactive prover in Rust. + +## Running the prover +1. Configure this prover setting via the global variables defined in [main.rs](./src/main.rs) — please ensure that the hardcoded `SERVER_URL` and `VERIFICATION_SESSION_ID` have the same values on the verifier side. +2. Start the prover by running the following in a terminal at the root of this crate. +```bash +cargo run --release +``` diff --git a/interactive-demo/prover/prover-rs/src/main.rs b/interactive-demo/prover/prover-rs/src/main.rs new file mode 100644 index 0000000..633c8c9 --- /dev/null +++ b/interactive-demo/prover/prover-rs/src/main.rs @@ -0,0 +1,168 @@ +use async_tungstenite::{tokio::connect_async_with_config, tungstenite::protocol::WebSocketConfig}; +use futures::AsyncWriteExt; +use http_body_util::Empty; +use hyper::{body::Bytes, Request, StatusCode, Uri}; +use hyper_util::rt::TokioIo; +use regex::Regex; +use tlsn_core::Direction; +use tlsn_prover::tls::{state::Prove, Prover, ProverConfig}; +use tokio::io::{AsyncRead, AsyncWrite}; +use tokio_util::compat::{FuturesAsyncReadCompatExt, TokioAsyncReadCompatExt}; +use tracing::{debug, info}; +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; +use ws_stream_tungstenite::WsStream; + +const TRACING_FILTER: &str = "DEBUG"; + +const VERIFIER_HOST: &str = "localhost"; +const VERIFIER_PORT: u16 = 9816; + +const SECRET: &str = "TLSNotary's private key 🤡"; +/// Make sure the following url's domain is the same as SERVER_DOMAIN on the verifier side +const SERVER_URL: &str = "https://notary.pse.dev/info"; +/// Make sure this is the same on the verifier side +const VERIFICATION_SESSION_ID: &str = "interactive-verifier-demo"; + +#[tokio::main] +async fn main() { + tracing_subscriber::registry() + .with(EnvFilter::try_from_default_env().unwrap_or_else(|_| TRACING_FILTER.into())) + .with(tracing_subscriber::fmt::layer()) + .init(); + + run_prover( + VERIFIER_HOST, + VERIFIER_PORT, + SERVER_URL, + VERIFICATION_SESSION_ID, + ) + .await; +} + +async fn run_prover( + verifier_host: &str, + verifier_port: u16, + server_uri: &str, + verification_session_id: &str, +) { + info!("Sending websocket request..."); + let request = http::Request::builder() + .uri(format!("ws://{}:{}/verify", verifier_host, verifier_port,)) + .header("Host", verifier_host) + .header("Sec-WebSocket-Key", uuid::Uuid::new_v4().to_string()) + .header("Sec-WebSocket-Version", "13") + .header("Connection", "Upgrade") + .header("Upgrade", "Websocket") + .body(()) + .unwrap(); + + let (verifier_ws_stream, _) = + connect_async_with_config(request, Some(WebSocketConfig::default())) + .await + .unwrap(); + + info!("Websocket connection established!"); + let verifier_ws_socket = WsStream::new(verifier_ws_stream); + prover(verifier_ws_socket, server_uri, verification_session_id).await; + info!("Proving is successful!"); +} + +async fn prover( + verifier_socket: T, + uri: &str, + id: &str, +) { + debug!("Starting proving..."); + + let uri = uri.parse::().unwrap(); + assert_eq!(uri.scheme().unwrap().as_str(), "https"); + let server_domain = uri.authority().unwrap().host(); + let server_port = uri.port_u16().unwrap_or(443); + + // Create prover and connect to verifier. + let prover = Prover::new( + ProverConfig::builder() + .id(id) + .server_dns(server_domain) + .build() + .unwrap(), + ) + .setup(verifier_socket.compat()) + .await + .unwrap(); + + // Connect to TLS Server. + let tls_client_socket = tokio::net::TcpStream::connect((server_domain, server_port)) + .await + .unwrap(); + let (mpc_tls_connection, prover_fut) = + prover.connect(tls_client_socket.compat()).await.unwrap(); + let mpc_tls_connection = TokioIo::new(mpc_tls_connection.compat()); + let prover_task = tokio::spawn(prover_fut); + + // MPC-TLS Handshake. + let (mut request_sender, connection) = + hyper::client::conn::http1::handshake(mpc_tls_connection) + .await + .unwrap(); + + let connection_task = tokio::spawn(connection.without_shutdown()); + + // MPC-TLS: Send Request and wait for Response. + let request = Request::builder() + .uri(uri.clone()) + .header("Host", server_domain) + .header("Connection", "close") + .header("Secret", SECRET) + .method("GET") + .body(Empty::::new()) + .unwrap(); + let response = request_sender.send_request(request).await.unwrap(); + + assert!(response.status() == StatusCode::OK); + + // Close TLS Connection. + let tls_connection = connection_task.await.unwrap().unwrap().io.into_inner(); + tls_connection.compat().close().await.unwrap(); + + // Create proof for the Verifier. + let mut prover = prover_task.await.unwrap().unwrap().start_prove(); + redact_and_reveal_received_data(&mut prover); + redact_and_reveal_sent_data(&mut prover); + prover.prove().await.unwrap(); + + // Finalize. + prover.finalize().await.unwrap() +} + +/// Redacts and reveals received data to the verifier. +fn redact_and_reveal_received_data(prover: &mut Prover) { + let recv_transcript_len = prover.recv_transcript().data().len(); + + // Get the commit hash from the received data. + let received_string = String::from_utf8(prover.recv_transcript().data().to_vec()).unwrap(); + let re = Regex::new(r#""gitCommitHash"\s?:\s?"(.*?)""#).unwrap(); + let commit_hash_match = re.captures(&received_string).unwrap().get(1).unwrap(); + + // Reveal everything except for the commit hash. + _ = prover.reveal(0..commit_hash_match.start(), Direction::Received); + _ = prover.reveal( + commit_hash_match.end()..recv_transcript_len, + Direction::Received, + ); +} + +/// Redacts and reveals sent data to the verifier. +fn redact_and_reveal_sent_data(prover: &mut Prover) { + let sent_transcript_len = prover.sent_transcript().data().len(); + + let sent_string = String::from_utf8(prover.sent_transcript().data().to_vec()).unwrap(); + let secret_start = sent_string.find(SECRET).unwrap(); + + // Reveal everything except for the SECRET. + _ = prover.reveal(0..secret_start, Direction::Sent); + _ = prover.reveal( + secret_start + SECRET.len()..sent_transcript_len, + Direction::Sent, + ); +} diff --git a/interactive-demo/verifier/Cargo.toml b/interactive-demo/verifier/Cargo.toml index 7379822..ff9d399 100644 --- a/interactive-demo/verifier/Cargo.toml +++ b/interactive-demo/verifier/Cargo.toml @@ -14,11 +14,6 @@ tokio = {version = "1", features = [ ]} tokio-util = { version = "0.7", features = ["compat"] } tracing = "0.1.40" - -tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-core" } -tlsn-verifier = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-verifier", features = [ - "tracing", -] } eyre = "0.6.12" tracing-subscriber = { version ="0.3.18", features = ["env-filter"] } hyper = { version = "0.14", features = ["client", "http1", "server", "tcp"] } @@ -33,3 +28,8 @@ axum-core = "0.3.4" base64 = "0.21.0" tower = { version = "0.4.12", features = ["make"] } ws_stream_tungstenite = { version = "0.10.0", features = ["tokio_io"] } + +tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-core" } +tlsn-verifier = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-verifier", features = [ + "tracing", +] } diff --git a/interactive-demo/verifier/README.md b/interactive-demo/verifier/README.md index bb61aeb..8ffe740 100644 --- a/interactive-demo/verifier/README.md +++ b/interactive-demo/verifier/README.md @@ -8,9 +8,10 @@ An implementation of the interactive verifier server in Rust. ```bash cargo run --release ``` + ## WebSocket APIs ### /verify -To perform verification via websocket +To perform verification via websocket, i.e. `ws://localhost:9816/verify` ## Design Choices ### WebSocket diff --git a/interactive-demo/verifier/src/main.rs b/interactive-demo/verifier/src/main.rs index db6b058..0c08b68 100644 --- a/interactive-demo/verifier/src/main.rs +++ b/interactive-demo/verifier/src/main.rs @@ -1,12 +1,14 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; use verifier::run_server; +const TRACING_FILTER: &str = "DEBUG"; + const VERIFIER_HOST: &str = "0.0.0.0"; const VERIFIER_PORT: u16 = 9816; -const TRACING_FILTER: &str = "DEBUG"; -/// Make sure these are the same on the prover side +/// Make sure the following domain is the same in SERVER_URL on the prover side const SERVER_DOMAIN: &str = "notary.pse.dev"; +/// Make sure this is the same on the prover side const VERIFICATION_SESSION_ID: &str = "interactive-verifier-demo"; From 1643bdb4fbbdf3953c348053b98286876c5c0a78 Mon Sep 17 00:00:00 2001 From: Hendrik Eeckhaut Date: Fri, 5 Apr 2024 14:56:57 +0200 Subject: [PATCH 04/14] Use swapi.dev as TLS server instead of notary.pse.dev --- interactive-demo/prover/prover-rs/src/main.rs | 19 +++++++++++++------ interactive-demo/verifier/src/lib.rs | 5 +++-- interactive-demo/verifier/src/main.rs | 3 +-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/interactive-demo/prover/prover-rs/src/main.rs b/interactive-demo/prover/prover-rs/src/main.rs index 633c8c9..61af73b 100644 --- a/interactive-demo/prover/prover-rs/src/main.rs +++ b/interactive-demo/prover/prover-rs/src/main.rs @@ -19,7 +19,7 @@ const VERIFIER_PORT: u16 = 9816; const SECRET: &str = "TLSNotary's private key 🤡"; /// Make sure the following url's domain is the same as SERVER_DOMAIN on the verifier side -const SERVER_URL: &str = "https://notary.pse.dev/info"; +const SERVER_URL: &str = "https://swapi.dev/api/people/1"; /// Make sure this is the same on the verifier side const VERIFICATION_SESSION_ID: &str = "interactive-verifier-demo"; @@ -92,6 +92,7 @@ async fn prover( .unwrap(); // Connect to TLS Server. + info!("Connect to TLS Server"); let tls_client_socket = tokio::net::TcpStream::connect((server_domain, server_port)) .await .unwrap(); @@ -109,6 +110,7 @@ async fn prover( let connection_task = tokio::spawn(connection.without_shutdown()); // MPC-TLS: Send Request and wait for Response. + info!("Send Request and wait for Response"); let request = Request::builder() .uri(uri.clone()) .header("Host", server_domain) @@ -119,19 +121,24 @@ async fn prover( .unwrap(); let response = request_sender.send_request(request).await.unwrap(); + debug!("TLS response: {:?}", response); assert!(response.status() == StatusCode::OK); // Close TLS Connection. - let tls_connection = connection_task.await.unwrap().unwrap().io.into_inner(); - tls_connection.compat().close().await.unwrap(); + // let tls_connection = connection_task.await.unwrap().unwrap().io.into_inner(); + // debug!("TLS connection: {:?}", tls_connection); + // tls_connection.compat().close().await.unwrap(); + // info!("TLS Connection closed"); // Create proof for the Verifier. + info!("Create proof for the Verifier"); let mut prover = prover_task.await.unwrap().unwrap().start_prove(); redact_and_reveal_received_data(&mut prover); redact_and_reveal_sent_data(&mut prover); prover.prove().await.unwrap(); // Finalize. + info!("Finalize prover"); prover.finalize().await.unwrap() } @@ -139,12 +146,12 @@ async fn prover( fn redact_and_reveal_received_data(prover: &mut Prover) { let recv_transcript_len = prover.recv_transcript().data().len(); - // Get the commit hash from the received data. + // Get the homeworld from the received data. let received_string = String::from_utf8(prover.recv_transcript().data().to_vec()).unwrap(); - let re = Regex::new(r#""gitCommitHash"\s?:\s?"(.*?)""#).unwrap(); + let re = Regex::new(r#""homeworld"\s?:\s?"(.*?)""#).unwrap(); let commit_hash_match = re.captures(&received_string).unwrap().get(1).unwrap(); - // Reveal everything except for the commit hash. + // Reveal everything except for the homeworld. _ = prover.reveal(0..commit_hash_match.start(), Direction::Received); _ = prover.reveal( commit_hash_match.end()..recv_transcript_len, diff --git a/interactive-demo/verifier/src/lib.rs b/interactive-demo/verifier/src/lib.rs index 66c5988..94eb634 100644 --- a/interactive-demo/verifier/src/lib.rs +++ b/interactive-demo/verifier/src/lib.rs @@ -139,9 +139,10 @@ async fn verifier( // Check received data: check json and version number. let response = String::from_utf8(received.data().to_vec()) .map_err(|err| eyre!("Failed to parse received data: {err}"))?; + debug!("Received data: {:?}", response); response - .find("BEGIN PUBLIC KEY") - .ok_or_else(|| eyre!("Verification failed: invalid public key in JSON response"))?; + .find("eye_color") + .ok_or_else(|| eyre!("Verification failed: missing eye_color in received data"))?; // Check Session info: server name. if session_info.server_name.as_str() != server_domain { return Err(eyre!("Verification failed: server name mismatches")); diff --git a/interactive-demo/verifier/src/main.rs b/interactive-demo/verifier/src/main.rs index 0c08b68..68da5d6 100644 --- a/interactive-demo/verifier/src/main.rs +++ b/interactive-demo/verifier/src/main.rs @@ -7,11 +7,10 @@ const VERIFIER_HOST: &str = "0.0.0.0"; const VERIFIER_PORT: u16 = 9816; /// Make sure the following domain is the same in SERVER_URL on the prover side -const SERVER_DOMAIN: &str = "notary.pse.dev"; +const SERVER_DOMAIN: &str = "swapi.dev"; /// Make sure this is the same on the prover side const VERIFICATION_SESSION_ID: &str = "interactive-verifier-demo"; - #[tokio::main] async fn main() -> Result<(), eyre::ErrReport> { tracing_subscriber::registry() From ec3be0d56133e1de91128f49b8f369700a2bec3e Mon Sep 17 00:00:00 2001 From: Hendrik Eeckhaut Date: Fri, 5 Apr 2024 23:24:17 +0200 Subject: [PATCH 05/14] WIP: interactive prover in TypeScript/React --- interactive-demo/prover-ts/.gitignore | 1 + interactive-demo/prover-ts/README.md | 15 ++ interactive-demo/prover-ts/app.tsx | 90 +++++++++ interactive-demo/prover-ts/index.ejs | 16 ++ interactive-demo/prover-ts/package.json | 30 +++ interactive-demo/prover-ts/tsconfig.json | 19 ++ interactive-demo/prover-ts/webpack.js | 110 +++++++++++ interactive-demo/prover/prover-rs/src/main.rs | 6 +- interactive-demo/verifier/src/lib.rs | 5 +- package.json | 11 +- src/index.ts | 19 ++ src/tlsn.ts | 26 +++ wasm/prover/Cargo.toml | 4 +- wasm/prover/src/interactive_prover.rs | 173 ++++++++++++++++++ wasm/prover/src/lib.rs | 3 + 15 files changed, 517 insertions(+), 11 deletions(-) create mode 100644 interactive-demo/prover-ts/.gitignore create mode 100644 interactive-demo/prover-ts/README.md create mode 100644 interactive-demo/prover-ts/app.tsx create mode 100644 interactive-demo/prover-ts/index.ejs create mode 100644 interactive-demo/prover-ts/package.json create mode 100644 interactive-demo/prover-ts/tsconfig.json create mode 100644 interactive-demo/prover-ts/webpack.js create mode 100644 wasm/prover/src/interactive_prover.rs diff --git a/interactive-demo/prover-ts/.gitignore b/interactive-demo/prover-ts/.gitignore new file mode 100644 index 0000000..d8b83df --- /dev/null +++ b/interactive-demo/prover-ts/.gitignore @@ -0,0 +1 @@ +package-lock.json diff --git a/interactive-demo/prover-ts/README.md b/interactive-demo/prover-ts/README.md new file mode 100644 index 0000000..054d1e7 --- /dev/null +++ b/interactive-demo/prover-ts/README.md @@ -0,0 +1,15 @@ +TODO + +1. Start Verifier +2. Start websocket proxy +3. Start app + + +Since a web browser doesn't have the ability to make TCP connection, we need to use a websocket proxy server. + +To run your own websockify proxy **locally**, run: +```sh +git clone https://github.com/novnc/websockify && cd websockify +./docker/build.sh +docker run -it --rm -p 55688:80 novnc/websockify 80 swapi.dev:443 +``` \ No newline at end of file diff --git a/interactive-demo/prover-ts/app.tsx b/interactive-demo/prover-ts/app.tsx new file mode 100644 index 0000000..3f2c1c3 --- /dev/null +++ b/interactive-demo/prover-ts/app.tsx @@ -0,0 +1,90 @@ +import React, { ReactElement, useCallback, useEffect, useState } from 'react'; +import { createRoot } from 'react-dom/client'; +import { interactive_prove, prove, verify } from 'tlsn-js'; +import { Proof } from 'tlsn-js/build/types'; +import { Watch } from 'react-loader-spinner'; + +const container = document.getElementById('root'); +const root = createRoot(container!); + +root.render(); + +function App(): ReactElement { + const [processing, setProcessing] = useState(false); + const [result, setResult] = useState<{ + time: number; + sent: string; + recv: string; + notaryUrl: string; + } | null>(null); + const [proof, setProof] = useState(null); + + const uri = "https://swapi.dev/api/people/1"; + const id = "interactive-verifier-demo"; + + const onClick = useCallback(async () => { + setProcessing(true); + const p = await interactive_prove( + 'ws://localhost:55688', + 'ws://localhost:9816', + uri, + id); + // setProof(p); + }, [setProof, setProcessing]); + + useEffect(() => { + (async () => { + if (proof) { + const r = await verify(proof); + setResult(r); + setProcessing(false); + } + })(); + }, [proof, setResult]); + + return ( +
+ +
+ Proof: + {!processing && !proof ? ( + not started + ) : !proof ? ( + <> + Proving data from swapi... + + Open Developer tools to follow progress + + ) : ( + <> +
+ View Proof +
{JSON.stringify(proof, null, 2)}
+
+ + )} +
+
+ Verification: + {!proof ? ( + not started + ) : !result ? ( + verifying + ) : ( +
{JSON.stringify(result, null, 2)}
+ )} +
+
+ ); +} diff --git a/interactive-demo/prover-ts/index.ejs b/interactive-demo/prover-ts/index.ejs new file mode 100644 index 0000000..7bd6dac --- /dev/null +++ b/interactive-demo/prover-ts/index.ejs @@ -0,0 +1,16 @@ + + + + + + + React/Typescrip Example + + + + +
+ + + \ No newline at end of file diff --git a/interactive-demo/prover-ts/package.json b/interactive-demo/prover-ts/package.json new file mode 100644 index 0000000..4bb6399 --- /dev/null +++ b/interactive-demo/prover-ts/package.json @@ -0,0 +1,30 @@ +{ + "name": "prover-ts", + "version": "1.0.0", + "description": "", + "main": "webpack.js", + "scripts": { + "dev": "webpack-dev-server --config webpack.js" + }, + "author": "", + "license": "ISC", + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-loader-spinner": "^6.1.6", + "tlsn-js": "../../../tlsn-js" + }, + "devDependencies": { + "@types/react": "^18.0.26", + "@types/react-dom": "^18.0.10", + "babel-loader": "^9.1.3", + "copy-webpack-plugin": "^11.0.0", + "html-webpack-plugin": "^5.5.0", + "source-map-loader": "^5.0.0", + "ts-loader": "^9.4.2", + "typescript": "^4.9.4", + "webpack": "^5.75.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.11.1" + } +} \ No newline at end of file diff --git a/interactive-demo/prover-ts/tsconfig.json b/interactive-demo/prover-ts/tsconfig.json new file mode 100644 index 0000000..226acce --- /dev/null +++ b/interactive-demo/prover-ts/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "noEmit": false, + "jsx": "react" + }, + "include": ["app.tsx"] +} \ No newline at end of file diff --git a/interactive-demo/prover-ts/webpack.js b/interactive-demo/prover-ts/webpack.js new file mode 100644 index 0000000..bf71b21 --- /dev/null +++ b/interactive-demo/prover-ts/webpack.js @@ -0,0 +1,110 @@ +var webpack = require('webpack'), + path = require('path'), + CopyWebpackPlugin = require('copy-webpack-plugin'), + HtmlWebpackPlugin = require('html-webpack-plugin'); + +const ASSET_PATH = process.env.ASSET_PATH || '/'; + +var alias = {}; + +var fileExtensions = [ + 'jpg', + 'jpeg', + 'png', + 'gif', + 'eot', + 'otf', + 'svg', + 'ttf', + 'woff', + 'woff2', +]; + +var options = { + ignoreWarnings: [ + /Circular dependency between chunks with runtime/, + /ResizeObserver loop completed with undelivered notifications/, + ], + mode: 'development', + entry: { + app: path.join(__dirname, 'app.tsx'), + }, + output: { + filename: '[name].bundle.js', + path: path.resolve(__dirname, 'build'), + clean: true, + publicPath: ASSET_PATH, + }, + module: { + rules: [ + { + test: new RegExp('.(' + fileExtensions.join('|') + ')$'), + type: 'asset/resource', + exclude: /node_modules/, + }, + { + test: /\.html$/, + loader: 'html-loader', + exclude: /node_modules/, + }, + { + test: /\.(ts|tsx)$/, + exclude: /node_modules/, + use: [ + { + loader: require.resolve('ts-loader'), + }, + ], + }, + { + test: /\.(js|jsx)$/, + use: [ + { + loader: 'source-map-loader', + }, + { + loader: require.resolve('babel-loader'), + }, + ], + exclude: /node_modules/, + }, + ], + }, + resolve: { + alias: alias, + extensions: fileExtensions + .map((extension) => '.' + extension) + .concat(['.js', '.jsx', '.ts', '.tsx', '.css']), + }, + plugins: [ + new CopyWebpackPlugin({ + patterns: [ + { + from: 'node_modules/tlsn-js/build', + to: path.join(__dirname, 'build'), + force: true, + }, + ], + }), + new HtmlWebpackPlugin({ + template: path.join(__dirname, 'index.ejs'), + filename: 'index.html', + cache: false, + }), + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + }), + ].filter(Boolean), + // Required by wasm-bindgen-rayon, in order to use SharedArrayBuffer on the Web + // Ref: + // - https://github.com/GoogleChromeLabs/wasm-bindgen-rayon#setting-up + // - https://web.dev/i18n/en/coop-coep/ + devServer: { + headers: { + 'Cross-Origin-Embedder-Policy': 'require-corp', + 'Cross-Origin-Opener-Policy': 'same-origin', + }, + }, +}; + +module.exports = options; diff --git a/interactive-demo/prover/prover-rs/src/main.rs b/interactive-demo/prover/prover-rs/src/main.rs index 61af73b..d40180e 100644 --- a/interactive-demo/prover/prover-rs/src/main.rs +++ b/interactive-demo/prover/prover-rs/src/main.rs @@ -149,12 +149,12 @@ fn redact_and_reveal_received_data(prover: &mut Prover) { // Get the homeworld from the received data. let received_string = String::from_utf8(prover.recv_transcript().data().to_vec()).unwrap(); let re = Regex::new(r#""homeworld"\s?:\s?"(.*?)""#).unwrap(); - let commit_hash_match = re.captures(&received_string).unwrap().get(1).unwrap(); + let homeworld_match = re.captures(&received_string).unwrap().get(1).unwrap(); // Reveal everything except for the homeworld. - _ = prover.reveal(0..commit_hash_match.start(), Direction::Received); + _ = prover.reveal(0..homeworld_match.start(), Direction::Received); _ = prover.reveal( - commit_hash_match.end()..recv_transcript_len, + homeworld_match.end()..recv_transcript_len, Direction::Received, ); } diff --git a/interactive-demo/verifier/src/lib.rs b/interactive-demo/verifier/src/lib.rs index 94eb634..abc95f8 100644 --- a/interactive-demo/verifier/src/lib.rs +++ b/interactive-demo/verifier/src/lib.rs @@ -124,12 +124,14 @@ async fn verifier( let verifier = Verifier::new(verifier_config); // Verify MPC-TLS and wait for (redacted) data. + debug!("Starting MPC-TLS verification..."); let (sent, received, session_info) = verifier .verify(socket.compat()) .await .map_err(|err| eyre!("Verification failed: {err}"))?; - // Check send data: check host. + // Check sent data: check host. + debug!("Starting sent data verification..."); let sent_data = String::from_utf8(sent.data().to_vec()) .map_err(|err| eyre!("Failed to parse sent data: {err}"))?; sent_data @@ -137,6 +139,7 @@ async fn verifier( .ok_or_else(|| eyre!("Verification failed: Expected host {}", server_domain))?; // Check received data: check json and version number. + debug!("Starting received data verification..."); let response = String::from_utf8(received.data().to_vec()) .map_err(|err| eyre!("Failed to parse received data: {err}"))?; debug!("Received data: {:?}", response); diff --git a/package.json b/package.json index 983e7c1..5553c38 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "serve:test": "serve --config ../serve.json ./test-build -l 3001", "build:src": "webpack --config webpack.build.config.js", "build:types": "tsc --project tsconfig.compile.json", - "build": "NODE_ENV=production concurrently npm:build:src npm:build:types", + "build": "npm run build:wasm && NODE_ENV=production concurrently npm:build:src npm:build:types", "update:wasm": "sh utils/check-wasm.sh -f", "test:wasm": "cd wasm/prover; wasm-pack test --firefox --release --headless", "build:wasm": "wasm-pack build --target web wasm/prover", @@ -38,14 +38,12 @@ "@types/expect": "^24.3.0", "@types/mocha": "^10.0.6", "@types/serve-handler": "^6.1.4", - "@typescript-eslint/eslint-plugin": "^6.15.0", - "@typescript-eslint/parser": "7.0.2", "browserify": "^17.0.0", "concurrently": "^5.1.0", "constants-browserify": "^1.0.0", "copy-webpack-plugin": "^5.0.5", "crypto-browserify": "^3.12.0", - "eslint": "^8.47.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.0", "file-loader": "^5.0.2", @@ -64,7 +62,8 @@ "ts-loader": "^6.2.1", "ts-mocha": "^10.0.0", "ts-node": "^10.9.2", - "typescript": "^4.9.3", + "typescript": "^4.9.5", + "typescript-eslint": "^7.4.0", "webpack": "^5.75.0", "webpack-cli": "^5.0.0", "webpack-dev-server": "^4.11.1", @@ -76,4 +75,4 @@ "engines": { "node": ">= 16.20.2" } -} +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 6e6471a..666bcb4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,6 +56,25 @@ export const prove = async ( }; }; + +export const interactive_prove = async ( + websocket_proxy_url: string, + verifier_proxy_url: string, + uri: string, + id: string +): Promise => { + const tlsn = await getTLSN(); + + + const proof = await tlsn.interactive_prove( + websocket_proxy_url, + verifier_proxy_url, + uri, + id); + + return proof +}; + export const verify = async ( proof: Proof, publicKeyOverride?: string, diff --git a/src/tlsn.ts b/src/tlsn.ts index 17cfb17..2bf0ef0 100644 --- a/src/tlsn.ts +++ b/src/tlsn.ts @@ -1,6 +1,7 @@ import init, { initThreadPool, prover, + interactive_prover, verify, } from '../wasm/prover/pkg/tlsn_extension_rs'; @@ -73,6 +74,31 @@ export default class TLSN { return resJSON; } + async interactive_prove( + websocket_proxy_url: string, + verifier_proxy_url: string, + uri: string, + id: string, + ) { + await this.waitForStart(); + const resProver = await interactive_prover( + websocket_proxy_url, + verifier_proxy_url, + uri, + id + ); + const resJSON = JSON.parse(resProver); + // console.log('!@# resProver,resJSON=', { resProver, resJSON }); + // console.log('!@# resAfter.memory=', resJSON.memory); + // 1105920000 ~= 1.03 gb + // console.log( + // '!@# resAfter.memory.buffer.length=', + // resJSON.memory?.buffer?.byteLength, + // ); + + return resJSON; + } + async verify(proof: any, pubkey: string) { await this.waitForStart(); const raw = await verify(JSON.stringify(proof), pubkey); diff --git a/wasm/prover/Cargo.toml b/wasm/prover/Cargo.toml index cba3959..e71cfb2 100644 --- a/wasm/prover/Cargo.toml +++ b/wasm/prover/Cargo.toml @@ -31,7 +31,7 @@ pin-project-lite = "0.2.4" http-body-util = "0.1" hyper = { version = "1.1", features = ["client", "http1"] } -hyper-util = { version = "0.1", features = ["http1"] } +hyper-util = { version = "0.1.3" } tracing-subscriber = { version = "0.3", features = ["time"] } tracing-web = "0.1.2" @@ -81,6 +81,7 @@ console_error_panic_hook = { version = "0.1.7" } strum = { version = "0.26.1" } strum_macros = "0.26.1" +regex = "1.10.4" [dev-dependencies] wasm-bindgen-test = "0.3.34" @@ -88,6 +89,7 @@ wasm-bindgen-test = "0.3.34" [profile.release] lto = true # Enable Link Time Optimization opt-level = "z" # Optimize for size +debug = true [package.metadata.wasm-pack.profile.release] wasm-opt = true diff --git a/wasm/prover/src/interactive_prover.rs b/wasm/prover/src/interactive_prover.rs new file mode 100644 index 0000000..f4d5f55 --- /dev/null +++ b/wasm/prover/src/interactive_prover.rs @@ -0,0 +1,173 @@ +use crate::hyper_io::FuturesIo; +use crate::request_opt::RequestOptions; +pub use crate::request_opt::VerifyResult; +use crate::requests::{ClientType, NotarizationSessionRequest, NotarizationSessionResponse}; +use crate::{fetch_as_json_string, setup_tracing_web}; +use futures::channel::oneshot; +use futures::AsyncWriteExt; +use http_body_util::{BodyExt, Empty, Full}; +use hyper::{body::Bytes, Request, StatusCode, Uri}; +use js_sys::Array; +use regex::Regex; +use std::ops::Range; +use strum::EnumMessage; +use tlsn_core::proof::TlsProof; +use tlsn_core::{proof::SessionInfo, Direction, RedactedTranscript}; +use tlsn_prover::tls::{state::Prove, Prover, ProverConfig}; +use tracing::instrument; +use url::Url; +use wasm_bindgen::prelude::*; +use wasm_bindgen_futures::spawn_local; +pub use wasm_bindgen_rayon::init_thread_pool; +use web_sys::{Headers, RequestInit, RequestMode}; +use web_time::Instant; +use ws_stream_wasm::*; + +use tracing::{debug, info}; + +const SECRET: &str = "TLSNotary's private key 🤡"; + +#[tracing::instrument] +#[wasm_bindgen] +pub async fn interactive_prover( + websocket_proxy_url: String, + verifier_proxy_url: String, + uri: String, + id: String, +) -> Result { + let uri = uri.parse::().unwrap(); + assert_eq!(uri.scheme().unwrap().as_str(), "https"); + let server_domain = uri.authority().unwrap().host(); + + info!( + "Interactive proof: {}, {}, {} ,{} ", + websocket_proxy_url, verifier_proxy_url, uri, id + ); + + let test = format!("{}/verify", verifier_proxy_url); + let (_, verifier_ws_stream) = WsMeta::connect(test, None) + .await + .expect_throw("assume the verifier ws connection succeeds"); + let verifier_ws_stream_into = verifier_ws_stream.into_io(); + + // Create prover and connect to verifier. + let prover = Prover::new( + ProverConfig::builder() + .id(id) + .server_dns(server_domain) + .build() + .unwrap(), + ) + .setup(verifier_ws_stream_into) + .await + .unwrap(); + + // Connect to TLS Server. + debug!("Connect to websocket proxy {}", websocket_proxy_url); + let (_, client_ws_stream) = WsMeta::connect(websocket_proxy_url, None) + .await + .expect_throw("assume the client ws connection succeeds"); + let (mpc_tls_connection, prover_fut) = + prover.connect(client_ws_stream.into_io()).await.unwrap(); + let mpc_tls_connection = unsafe { FuturesIo::new(mpc_tls_connection) }; + let (prover_sender, prover_receiver) = oneshot::channel(); + let handled_prover_fut = async { + let result = prover_fut.await; + let _ = prover_sender.send(result); + }; + spawn_local(handled_prover_fut); + + // Attach the hyper HTTP client to the TLS connection + let (mut request_sender, connection) = + hyper::client::conn::http1::handshake(mpc_tls_connection) + .await + .map_err(|e| JsValue::from_str(&format!("Could not handshake: {:?}", e)))?; + + // Spawn the HTTP task to be run concurrently + let (connection_sender, connection_receiver) = oneshot::channel(); + let connection_fut = connection.without_shutdown(); + let handled_connection_fut = async { + let result = connection_fut.await; + let _ = connection_sender.send(result); + }; + spawn_local(handled_connection_fut); + + // MPC-TLS: Send Request and wait for Response. + let request = Request::builder() + .uri(uri.clone()) + .header("Host", server_domain) + .header("Connection", "close") + .header("Secret", SECRET) + .method("GET") + .body(Empty::::new()) + .unwrap(); + let response = request_sender.send_request(request).await.unwrap(); + + assert!(response.status() == StatusCode::OK); + + // Close TLS Connection. + // let mut client_socket = connection_receiver + // .await + // .map_err(|e| { + // JsValue::from_str(&format!( + // "Could not receive from connection_receiver: {:?}", + // e + // )) + // })? + // .map_err(|e| JsValue::from_str(&format!("Could not get TlsConnection: {:?}", e)))? + // .io + // .into_inner(); + // client_socket + // .close() + // .await + // .map_err(|e| JsValue::from_str(&format!("Could not close socket: {:?}", e)))?; + + // Create proof for the Verifier. + let prover = prover_receiver + .await + .map_err(|e| { + JsValue::from_str(&format!("Could not receive from prover_receiver: {:?}", e)) + })? + .map_err(|e| JsValue::from_str(&format!("Could not get Prover: {:?}", e)))?; + let mut prover = prover.start_prove(); + redact_and_reveal_received_data(&mut prover); + redact_and_reveal_sent_data(&mut prover); + prover.prove().await.unwrap(); + + // Finalize. + let _ = prover.finalize().await; + + Ok(r#"{"result": "success"}"#.to_string()) +} + +/// Redacts and reveals received data to the verifier. +fn redact_and_reveal_received_data(prover: &mut Prover) { + let recv_transcript_len = prover.recv_transcript().data().len(); + + // Get the homeworld from the received data. + let received_string = String::from_utf8(prover.recv_transcript().data().to_vec()).unwrap(); + let re = Regex::new(r#""homeworld"\s?:\s?"(.*?)""#).unwrap(); + let commit_hash_match = re.captures(&received_string).unwrap().get(1).unwrap(); + + // Reveal everything except for the commit hash. + _ = prover.reveal(0..commit_hash_match.start(), Direction::Received); + _ = prover.reveal( + commit_hash_match.end()..recv_transcript_len, + Direction::Received, + ); +} + +/// Redacts and reveals sent data to the verifier. +fn redact_and_reveal_sent_data(prover: &mut Prover) { + let sent_transcript_len = prover.sent_transcript().data().len(); + + let sent_string = String::from_utf8(prover.sent_transcript().data().to_vec()).unwrap(); + let secret_start = sent_string.find(SECRET).unwrap(); + + // Reveal everything except for the SECRET. + _ = prover.reveal(0..secret_start, Direction::Sent); + _ = prover.reveal( + secret_start + SECRET.len()..sent_transcript_len, + Direction::Sent, + ); +} diff --git a/wasm/prover/src/lib.rs b/wasm/prover/src/lib.rs index 934d36c..e6f0a27 100644 --- a/wasm/prover/src/lib.rs +++ b/wasm/prover/src/lib.rs @@ -5,6 +5,9 @@ mod requests; pub mod prover; pub use prover::prover; +pub mod interactive_prover; +pub use interactive_prover::interactive_prover; + pub mod verify; use tracing::error; pub use verify::verify; From db0904988aae89edac63e2fdc9e7367796e9ebd0 Mon Sep 17 00:00:00 2001 From: Hendrik Eeckhaut Date: Sat, 6 Apr 2024 22:44:37 +0200 Subject: [PATCH 06/14] WIP: improve text in React app --- interactive-demo/prover-ts/README.md | 7 +++- interactive-demo/prover-ts/app.tsx | 62 +++++++++------------------- 2 files changed, 25 insertions(+), 44 deletions(-) diff --git a/interactive-demo/prover-ts/README.md b/interactive-demo/prover-ts/README.md index 054d1e7..9faac9c 100644 --- a/interactive-demo/prover-ts/README.md +++ b/interactive-demo/prover-ts/README.md @@ -12,4 +12,9 @@ To run your own websockify proxy **locally**, run: git clone https://github.com/novnc/websockify && cd websockify ./docker/build.sh docker run -it --rm -p 55688:80 novnc/websockify 80 swapi.dev:443 -``` \ No newline at end of file +``` + +Run a local websocket proxy +cargo install wstcp + +wstcp $(dig swapi.dev +short):443 --bind-addr 127.0.0.1:55688 \ No newline at end of file diff --git a/interactive-demo/prover-ts/app.tsx b/interactive-demo/prover-ts/app.tsx index 3f2c1c3..7c96669 100644 --- a/interactive-demo/prover-ts/app.tsx +++ b/interactive-demo/prover-ts/app.tsx @@ -11,47 +11,36 @@ root.render(); function App(): ReactElement { const [processing, setProcessing] = useState(false); - const [result, setResult] = useState<{ - time: number; - sent: string; - recv: string; - notaryUrl: string; - } | null>(null); - const [proof, setProof] = useState(null); - - const uri = "https://swapi.dev/api/people/1"; - const id = "interactive-verifier-demo"; + const [result, setResult] = useState(null); const onClick = useCallback(async () => { setProcessing(true); - const p = await interactive_prove( - 'ws://localhost:55688', + const result = await interactive_prove( + 'wss://notary.pse.dev/proxy?token=swapi.dev', //'ws://localhost:55688', 'ws://localhost:9816', - uri, - id); - // setProof(p); - }, [setProof, setProcessing]); + "https://swapi.dev/api/people/1", + "interactive-verifier-demo"); + setResult(result); + setProcessing(false); - useEffect(() => { - (async () => { - if (proof) { - const r = await verify(proof); - setResult(r); - setProcessing(false); - } - })(); - }, [proof, setResult]); + }, [setResult, setProcessing]); return (
+

TLSNotary interactive prover demo

+
+ Before clicking the start button, make sure the interactive verifier is running:
cd interactive-demo/verifier; cargo run --release
+
+
+
Proof: - {!processing && !proof ? ( - not started - ) : !proof ? ( + {!processing && !result ? ( + not started yet + ) : !result ? ( <> Proving data from swapi... ) : ( <> -
- View Proof -
{JSON.stringify(proof, null, 2)}
-
+
{JSON.stringify(result, null, 2)}
)}
-
- Verification: - {!proof ? ( - not started - ) : !result ? ( - verifying - ) : ( -
{JSON.stringify(result, null, 2)}
- )} -
); } From 4a457877be8080070d486c03fc23a4d8c7b812db Mon Sep 17 00:00:00 2001 From: Hendrik Eeckhaut Date: Mon, 8 Apr 2024 16:17:45 +0200 Subject: [PATCH 07/14] reorganized projects + debug data at prover side --- interactive-demo/{prover => }/prover-rs/Cargo.toml | 0 interactive-demo/{prover => }/prover-rs/README.md | 0 interactive-demo/{prover => }/prover-rs/src/main.rs | 5 ++++- interactive-demo/{verifier => verifier-rs}/Cargo.toml | 0 interactive-demo/{verifier => verifier-rs}/README.md | 0 .../{verifier => verifier-rs}/src/axum_websocket.rs | 0 interactive-demo/{verifier => verifier-rs}/src/lib.rs | 0 interactive-demo/{verifier => verifier-rs}/src/main.rs | 0 wasm/prover/src/interactive_prover.rs | 4 +++- 9 files changed, 7 insertions(+), 2 deletions(-) rename interactive-demo/{prover => }/prover-rs/Cargo.toml (100%) rename interactive-demo/{prover => }/prover-rs/README.md (100%) rename interactive-demo/{prover => }/prover-rs/src/main.rs (98%) rename interactive-demo/{verifier => verifier-rs}/Cargo.toml (100%) rename interactive-demo/{verifier => verifier-rs}/README.md (100%) rename interactive-demo/{verifier => verifier-rs}/src/axum_websocket.rs (100%) rename interactive-demo/{verifier => verifier-rs}/src/lib.rs (100%) rename interactive-demo/{verifier => verifier-rs}/src/main.rs (100%) diff --git a/interactive-demo/prover/prover-rs/Cargo.toml b/interactive-demo/prover-rs/Cargo.toml similarity index 100% rename from interactive-demo/prover/prover-rs/Cargo.toml rename to interactive-demo/prover-rs/Cargo.toml diff --git a/interactive-demo/prover/prover-rs/README.md b/interactive-demo/prover-rs/README.md similarity index 100% rename from interactive-demo/prover/prover-rs/README.md rename to interactive-demo/prover-rs/README.md diff --git a/interactive-demo/prover/prover-rs/src/main.rs b/interactive-demo/prover-rs/src/main.rs similarity index 98% rename from interactive-demo/prover/prover-rs/src/main.rs rename to interactive-demo/prover-rs/src/main.rs index d40180e..f11feb1 100644 --- a/interactive-demo/prover/prover-rs/src/main.rs +++ b/interactive-demo/prover-rs/src/main.rs @@ -133,8 +133,8 @@ async fn prover( // Create proof for the Verifier. info!("Create proof for the Verifier"); let mut prover = prover_task.await.unwrap().unwrap().start_prove(); - redact_and_reveal_received_data(&mut prover); redact_and_reveal_sent_data(&mut prover); + redact_and_reveal_received_data(&mut prover); prover.prove().await.unwrap(); // Finalize. @@ -148,6 +148,7 @@ fn redact_and_reveal_received_data(prover: &mut Prover) { // Get the homeworld from the received data. let received_string = String::from_utf8(prover.recv_transcript().data().to_vec()).unwrap(); + debug!("Received data: {}", received_string); let re = Regex::new(r#""homeworld"\s?:\s?"(.*?)""#).unwrap(); let homeworld_match = re.captures(&received_string).unwrap().get(1).unwrap(); @@ -166,6 +167,8 @@ fn redact_and_reveal_sent_data(prover: &mut Prover) { let sent_string = String::from_utf8(prover.sent_transcript().data().to_vec()).unwrap(); let secret_start = sent_string.find(SECRET).unwrap(); + debug!("Send data: {}", sent_string); + // Reveal everything except for the SECRET. _ = prover.reveal(0..secret_start, Direction::Sent); _ = prover.reveal( diff --git a/interactive-demo/verifier/Cargo.toml b/interactive-demo/verifier-rs/Cargo.toml similarity index 100% rename from interactive-demo/verifier/Cargo.toml rename to interactive-demo/verifier-rs/Cargo.toml diff --git a/interactive-demo/verifier/README.md b/interactive-demo/verifier-rs/README.md similarity index 100% rename from interactive-demo/verifier/README.md rename to interactive-demo/verifier-rs/README.md diff --git a/interactive-demo/verifier/src/axum_websocket.rs b/interactive-demo/verifier-rs/src/axum_websocket.rs similarity index 100% rename from interactive-demo/verifier/src/axum_websocket.rs rename to interactive-demo/verifier-rs/src/axum_websocket.rs diff --git a/interactive-demo/verifier/src/lib.rs b/interactive-demo/verifier-rs/src/lib.rs similarity index 100% rename from interactive-demo/verifier/src/lib.rs rename to interactive-demo/verifier-rs/src/lib.rs diff --git a/interactive-demo/verifier/src/main.rs b/interactive-demo/verifier-rs/src/main.rs similarity index 100% rename from interactive-demo/verifier/src/main.rs rename to interactive-demo/verifier-rs/src/main.rs diff --git a/wasm/prover/src/interactive_prover.rs b/wasm/prover/src/interactive_prover.rs index f4d5f55..903d3d8 100644 --- a/wasm/prover/src/interactive_prover.rs +++ b/wasm/prover/src/interactive_prover.rs @@ -130,8 +130,8 @@ pub async fn interactive_prover( })? .map_err(|e| JsValue::from_str(&format!("Could not get Prover: {:?}", e)))?; let mut prover = prover.start_prove(); - redact_and_reveal_received_data(&mut prover); redact_and_reveal_sent_data(&mut prover); + redact_and_reveal_received_data(&mut prover); prover.prove().await.unwrap(); // Finalize. @@ -146,6 +146,7 @@ fn redact_and_reveal_received_data(prover: &mut Prover) { // Get the homeworld from the received data. let received_string = String::from_utf8(prover.recv_transcript().data().to_vec()).unwrap(); + debug!("Received data: {}", received_string); let re = Regex::new(r#""homeworld"\s?:\s?"(.*?)""#).unwrap(); let commit_hash_match = re.captures(&received_string).unwrap().get(1).unwrap(); @@ -163,6 +164,7 @@ fn redact_and_reveal_sent_data(prover: &mut Prover) { let sent_string = String::from_utf8(prover.sent_transcript().data().to_vec()).unwrap(); let secret_start = sent_string.find(SECRET).unwrap(); + debug!("Send data: {}", sent_string); // Reveal everything except for the SECRET. _ = prover.reveal(0..secret_start, Direction::Sent); From 3c7d6f837b19c2fa5013757db90705a3cecb9b1c Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Mon, 6 May 2024 13:52:22 +0800 Subject: [PATCH 08/14] Change setting.json for vscode. --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b893da9..e753d5a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,8 @@ { "rust-analyzer.linkedProjects": [ "wasm/prover/Cargo.toml", - "interactive-demo/verifier/Cargo.toml", - "interactive-demo/prover/prover-rs/Cargo.toml" + "interactive-demo/verifier-rs/Cargo.toml", + "interactive-demo/prover-rs/Cargo.toml" ], "rust-analyzer.cargo.target": "wasm32-unknown-unknown" } From 6dbc4096633a1247b76346efd72d5d1e530290fd Mon Sep 17 00:00:00 2001 From: Pete Thomas Date: Wed, 5 Jun 2024 07:27:00 -0700 Subject: [PATCH 09/14] Support passing additional HTTP headers into interactive_prove(). (#54) --- interactive-demo/prover-ts/app.tsx | 14 +++++--- src/index.ts | 31 +++++++++++------ src/tlsn.ts | 22 +++++++----- wasm/prover/src/interactive_prover.rs | 50 ++++++++++++++++----------- wasm/prover/src/request_opt.rs | 9 +++++ 5 files changed, 83 insertions(+), 43 deletions(-) diff --git a/interactive-demo/prover-ts/app.tsx b/interactive-demo/prover-ts/app.tsx index 7c96669..aac0cbe 100644 --- a/interactive-demo/prover-ts/app.tsx +++ b/interactive-demo/prover-ts/app.tsx @@ -15,11 +15,15 @@ function App(): ReactElement { const onClick = useCallback(async () => { setProcessing(true); - const result = await interactive_prove( - 'wss://notary.pse.dev/proxy?token=swapi.dev', //'ws://localhost:55688', - 'ws://localhost:9816', - "https://swapi.dev/api/people/1", - "interactive-verifier-demo"); + const result = await interactive_prove('https://swapi.dev/api/people/1', { + headers: { + RTT: '125', + 'Sec-GPC': '1', + }, + id: "interactive-verifier-demo", + verifierProxyUrl: 'ws://localhost:9816', + websocketProxyUrl: 'wss://notary.pse.dev/proxy?token=swapi.dev', //'ws://localhost:55688', + }); setResult(result); setProcessing(false); diff --git a/src/index.ts b/src/index.ts index 666bcb4..580e450 100644 --- a/src/index.ts +++ b/src/index.ts @@ -58,19 +58,30 @@ export const prove = async ( export const interactive_prove = async ( - websocket_proxy_url: string, - verifier_proxy_url: string, - uri: string, - id: string + url: string, + options: { + headers?: { [key: string]: string }; + id: string; + verifierProxyUrl: string; + websocketProxyUrl: string; + }, ): Promise => { - const tlsn = await getTLSN(); + const { + headers, + id, + verifierProxyUrl, + websocketProxyUrl, + } = options; + + const tlsn = await getTLSN(); - const proof = await tlsn.interactive_prove( - websocket_proxy_url, - verifier_proxy_url, - uri, - id); + const proof = await tlsn.interactive_prove(url, { + headers, + websocketProxyUrl, + verifierProxyUrl, + id, + }); return proof }; diff --git a/src/tlsn.ts b/src/tlsn.ts index 2bf0ef0..1023736 100644 --- a/src/tlsn.ts +++ b/src/tlsn.ts @@ -75,17 +75,23 @@ export default class TLSN { } async interactive_prove( - websocket_proxy_url: string, - verifier_proxy_url: string, - uri: string, - id: string, + url: string, + options?: { + headers?: { [key: string]: string }; + id?: string; + verifierProxyUrl?: string; + websocketProxyUrl?: string; + }, ) { await this.waitForStart(); const resProver = await interactive_prover( - websocket_proxy_url, - verifier_proxy_url, - uri, - id + url, + { + ...options, + id: options?.id, + verifierProxyUrl: options?.verifierProxyUrl, + websocketProxyUrl: options?.websocketProxyUrl, + } ); const resJSON = JSON.parse(resProver); // console.log('!@# resProver,resJSON=', { resProver, resJSON }); diff --git a/wasm/prover/src/interactive_prover.rs b/wasm/prover/src/interactive_prover.rs index 903d3d8..842246b 100644 --- a/wasm/prover/src/interactive_prover.rs +++ b/wasm/prover/src/interactive_prover.rs @@ -1,5 +1,5 @@ use crate::hyper_io::FuturesIo; -use crate::request_opt::RequestOptions; +use crate::request_opt::InteractiveRequestOptions; pub use crate::request_opt::VerifyResult; use crate::requests::{ClientType, NotarizationSessionRequest, NotarizationSessionResponse}; use crate::{fetch_as_json_string, setup_tracing_web}; @@ -30,21 +30,22 @@ const SECRET: &str = "TLSNotary's private key 🤡"; #[tracing::instrument] #[wasm_bindgen] pub async fn interactive_prover( - websocket_proxy_url: String, - verifier_proxy_url: String, - uri: String, - id: String, + url: String, + val: JsValue, ) -> Result { - let uri = uri.parse::().unwrap(); - assert_eq!(uri.scheme().unwrap().as_str(), "https"); - let server_domain = uri.authority().unwrap().host(); + let url = url.parse::().unwrap(); + assert_eq!(url.scheme().unwrap().as_str(), "https"); + let server_domain = url.authority().unwrap().host(); + + let options: InteractiveRequestOptions = serde_wasm_bindgen::from_value(val) + .map_err(|e| JsValue::from_str(&format!("Could not deserialize options: {:?}", e)))?; info!( "Interactive proof: {}, {}, {} ,{} ", - websocket_proxy_url, verifier_proxy_url, uri, id + options.websocket_proxy_url, options.verifier_proxy_url, url, options.id ); - let test = format!("{}/verify", verifier_proxy_url); + let test = format!("{}/verify", options.verifier_proxy_url); let (_, verifier_ws_stream) = WsMeta::connect(test, None) .await .expect_throw("assume the verifier ws connection succeeds"); @@ -53,7 +54,7 @@ pub async fn interactive_prover( // Create prover and connect to verifier. let prover = Prover::new( ProverConfig::builder() - .id(id) + .id(options.id) .server_dns(server_domain) .build() .unwrap(), @@ -63,8 +64,8 @@ pub async fn interactive_prover( .unwrap(); // Connect to TLS Server. - debug!("Connect to websocket proxy {}", websocket_proxy_url); - let (_, client_ws_stream) = WsMeta::connect(websocket_proxy_url, None) + debug!("Connect to websocket proxy {}", options.websocket_proxy_url); + let (_, client_ws_stream) = WsMeta::connect(options.websocket_proxy_url, None) .await .expect_throw("assume the client ws connection succeeds"); let (mpc_tls_connection, prover_fut) = @@ -93,15 +94,24 @@ pub async fn interactive_prover( spawn_local(handled_connection_fut); // MPC-TLS: Send Request and wait for Response. - let request = Request::builder() - .uri(uri.clone()) + let mut req = Request::builder() + .uri(url.clone()) + .method("GET") .header("Host", server_domain) .header("Connection", "close") - .header("Secret", SECRET) - .method("GET") - .body(Empty::::new()) - .unwrap(); - let response = request_sender.send_request(request).await.unwrap(); + .header("Secret", SECRET); + + for (key, value) in options.headers { + info!("adding header: {} - {}", key.as_str(), value.as_str()); + req = req.header(key.as_str(), value.as_str()); + } + + let req_with_body = req.body(Full::new(Bytes::default())); + + let unwrapped_request = req_with_body + .map_err(|e| JsValue::from_str(&format!("Could not build request: {:?}", e)))?; + + let response = request_sender.send_request(unwrapped_request).await.unwrap(); assert!(response.status() == StatusCode::OK); diff --git a/wasm/prover/src/request_opt.rs b/wasm/prover/src/request_opt.rs index 2fcbebb..1ac6c4b 100644 --- a/wasm/prover/src/request_opt.rs +++ b/wasm/prover/src/request_opt.rs @@ -27,3 +27,12 @@ pub struct VerifyResult { pub sent: String, pub recv: String, } + +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct InteractiveRequestOptions { + pub headers: HashMap, + pub id: String, + pub verifier_proxy_url: String, + pub websocket_proxy_url: String, +} From f801e164b956703499301498fd2f4c77a7c582d7 Mon Sep 17 00:00:00 2001 From: yuroitaki <25913766+yuroitaki@users.noreply.github.com> Date: Tue, 3 Sep 2024 10:59:44 +0800 Subject: [PATCH 10/14] Update hyper and tlsn version for interactive verifier. --- interactive-demo/prover-rs/Cargo.toml | 26 +++--- interactive-demo/prover-rs/src/main.rs | 3 +- interactive-demo/verifier-rs/Cargo.toml | 35 +++---- .../verifier-rs/src/axum_websocket.rs | 93 +++++++++++-------- interactive-demo/verifier-rs/src/lib.rs | 27 ++++-- 5 files changed, 103 insertions(+), 81 deletions(-) diff --git a/interactive-demo/prover-rs/Cargo.toml b/interactive-demo/prover-rs/Cargo.toml index 3230baf..16b39b0 100644 --- a/interactive-demo/prover-rs/Cargo.toml +++ b/interactive-demo/prover-rs/Cargo.toml @@ -4,8 +4,13 @@ version = "0.1.0" edition = "2021" [dependencies] -tracing = "0.1.40" -tracing-subscriber = { version ="0.3.18", features = ["env-filter"] } +async-tungstenite = { version = "0.25", features = ["tokio-runtime"] } +futures = "0.3" +http = "1.1" +http-body-util = "0.1" +hyper = {version = "1.1", features = ["client", "http1"]} +hyper-util = {version = "0.1", features = ["full"]} +regex = "1.10.3" tokio = {version = "1", features = [ "rt", "rt-multi-thread", @@ -15,17 +20,10 @@ tokio = {version = "1", features = [ "fs", ]} tokio-util = { version = "0.7", features = ["compat"] } -http = "0.2.9" -hyper-util = {version = "0.1", features = ["full"]} -http-body-util = "0.1" -hyper = {version = "1.1", features = ["client", "http1"]} +tracing = "0.1.40" +tracing-subscriber = { version ="0.3.18", features = ["env-filter"] } uuid = { version = "1.4.1", features = ["v4", "fast-rng"] } -regex = "1.10.3" -futures = "0.3" -async-tungstenite = { version = "0.22.2", features = ["tokio-runtime"] } -ws_stream_tungstenite = { version = "0.10.0", features = ["tokio_io"] } +ws_stream_tungstenite = { version = "0.13", features = ["tokio_io"] } -tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-core" } -tlsn-prover = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-prover", features = [ - "tracing", -] } +tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.6", package = "tlsn-core" } +tlsn-prover = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.6", package = "tlsn-prover" } diff --git a/interactive-demo/prover-rs/src/main.rs b/interactive-demo/prover-rs/src/main.rs index f11feb1..565a74f 100644 --- a/interactive-demo/prover-rs/src/main.rs +++ b/interactive-demo/prover-rs/src/main.rs @@ -1,5 +1,4 @@ use async_tungstenite::{tokio::connect_async_with_config, tungstenite::protocol::WebSocketConfig}; -use futures::AsyncWriteExt; use http_body_util::Empty; use hyper::{body::Bytes, Request, StatusCode, Uri}; use hyper_util::rt::TokioIo; @@ -107,7 +106,7 @@ async fn prover( .await .unwrap(); - let connection_task = tokio::spawn(connection.without_shutdown()); + tokio::spawn(connection); // MPC-TLS: Send Request and wait for Response. info!("Send Request and wait for Response"); diff --git a/interactive-demo/verifier-rs/Cargo.toml b/interactive-demo/verifier-rs/Cargo.toml index ff9d399..355fc39 100644 --- a/interactive-demo/verifier-rs/Cargo.toml +++ b/interactive-demo/verifier-rs/Cargo.toml @@ -4,6 +4,19 @@ version = "0.1.0" edition = "2021" [dependencies] +async-trait = "0.1.67" +async-tungstenite = { version = "0.25", features = ["tokio-native-tls"] } +axum = { version = "0.7", features = ["ws"] } +axum-core = "0.4" +base64 = "0.21.0" +eyre = "0.6.12" +futures-util = "0.3.28" +http = { version = "1.1" } +http-body-util = { version = "0.1" } +hyper = { version = "1.1", features = ["client", "http1", "server"] } +hyper-util = { version = "0.1", features = ["full"] } +serde = { version = "1.0.147", features = ["derive"] } +sha1 = "0.10" tokio = {version = "1", features = [ "rt", "rt-multi-thread", @@ -13,23 +26,11 @@ tokio = {version = "1", features = [ "fs", ]} tokio-util = { version = "0.7", features = ["compat"] } +tower = { version = "0.4.12", features = ["make"] } +tower-service = { version = "0.3" } tracing = "0.1.40" -eyre = "0.6.12" tracing-subscriber = { version ="0.3.18", features = ["env-filter"] } -hyper = { version = "0.14", features = ["client", "http1", "server", "tcp"] } -axum = { version = "0.6.18", features = ["ws"] } -serde = { version = "1.0.147", features = ["derive"] } -futures-util = "0.3.28" -http = "0.2.9" -sha1 = "0.10" -async-trait = "0.1.67" -async-tungstenite = { version = "0.22.2", features = ["tokio-native-tls"] } -axum-core = "0.3.4" -base64 = "0.21.0" -tower = { version = "0.4.12", features = ["make"] } -ws_stream_tungstenite = { version = "0.10.0", features = ["tokio_io"] } +ws_stream_tungstenite = { version = "0.13", features = ["tokio_io"] } -tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-core" } -tlsn-verifier = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.4", package = "tlsn-verifier", features = [ - "tracing", -] } +tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.6", package = "tlsn-core" } +tlsn-verifier = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.6", package = "tlsn-verifier" } diff --git a/interactive-demo/verifier-rs/src/axum_websocket.rs b/interactive-demo/verifier-rs/src/axum_websocket.rs index eea2358..1889acd 100644 --- a/interactive-demo/verifier-rs/src/axum_websocket.rs +++ b/interactive-demo/verifier-rs/src/axum_websocket.rs @@ -1,4 +1,4 @@ -//! The following code is adapted from https://github.com/tokio-rs/axum/blob/axum-v0.6.19/axum/src/extract/ws.rs +//! The following code is adapted from https://github.com/tokio-rs/axum/blob/axum-v0.7.3/axum/src/extract/ws.rs //! where we swapped out tokio_tungstenite (https://docs.rs/tokio-tungstenite/latest/tokio_tungstenite/) //! with async_tungstenite (https://docs.rs/async-tungstenite/latest/async_tungstenite/) so that we can use //! ws_stream_tungstenite (https://docs.rs/ws_stream_tungstenite/latest/ws_stream_tungstenite/index.html) @@ -66,9 +66,7 @@ //! } //! } //! } -//! # async { -//! # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap(); -//! # }; +//! # let _: Router = app; //! ``` //! //! # Passing data and/or state to an `on_upgrade` callback @@ -97,9 +95,7 @@ //! let app = Router::new() //! .route("/ws", get(handler)) //! .with_state(AppState { /* ... */ }); -//! # async { -//! # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap(); -//! # }; +//! # let _: Router = app; //! ``` //! //! # Read and write concurrently @@ -128,7 +124,6 @@ //! ``` //! //! [`StreamExt::split`]: https://docs.rs/futures/0.3.17/futures/stream/trait.StreamExt.html#method.split - #![allow(unused)] use self::rejection::*; @@ -141,13 +136,8 @@ use async_tungstenite::{ }, WebSocketStream, }; -use axum::{ - body::{self, Bytes}, - extract::FromRequestParts, - response::Response, - Error, -}; - +use axum::{body::Bytes, extract::FromRequestParts, response::Response, Error}; +use axum_core::body::Body; use futures_util::{ sink::{Sink, SinkExt}, stream::{Stream, StreamExt}, @@ -157,7 +147,7 @@ use http::{ request::Parts, Method, StatusCode, }; -use hyper::upgrade::{OnUpgrade, Upgraded}; +use hyper_util::rt::TokioIo; use sha1::{Digest, Sha1}; use std::{ borrow::Cow, @@ -175,12 +165,12 @@ use tracing::error; /// /// See the [module docs](self) for an example. #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -pub struct WebSocketUpgrade { +pub struct WebSocketUpgrade { config: WebSocketConfig, /// The chosen protocol sent in the `Sec-WebSocket-Protocol` header of the response. protocol: Option, sec_websocket_key: HeaderValue, - on_upgrade: OnUpgrade, + on_upgrade: hyper::upgrade::OnUpgrade, on_failed_upgrade: F, sec_websocket_protocol: Option, } @@ -197,9 +187,33 @@ impl std::fmt::Debug for WebSocketUpgrade { } impl WebSocketUpgrade { - /// Set the size of the internal message send queue. - pub fn max_send_queue(mut self, max: usize) -> Self { - self.config.max_send_queue = Some(max); + /// The target minimum size of the write buffer to reach before writing the data + /// to the underlying stream. + /// + /// The default value is 128 KiB. + /// + /// If set to `0` each message will be eagerly written to the underlying stream. + /// It is often more optimal to allow them to buffer a little, hence the default value. + /// + /// Note: [`flush`](SinkExt::flush) will always fully write the buffer regardless. + pub fn write_buffer_size(mut self, size: usize) -> Self { + self.config.write_buffer_size = size; + self + } + + /// The max size of the write buffer in bytes. Setting this can provide backpressure + /// in the case the write buffer is filling up due to write errors. + /// + /// The default value is unlimited. + /// + /// Note: The write buffer only builds up past [`write_buffer_size`](Self::write_buffer_size) + /// when writes to the underlying stream are failing. So the **write buffer can not + /// fill up if you are not observing write errors even if not flushing**. + /// + /// Note: Should always be at least [`write_buffer_size + 1 message`](Self::write_buffer_size) + /// and probably a little more depending on error handling strategy. + pub fn max_write_buffer_size(mut self, max: usize) -> Self { + self.config.max_write_buffer_size = max; self } @@ -249,9 +263,7 @@ impl WebSocketUpgrade { /// // ... /// }) /// } - /// # async { - /// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap(); - /// # }; + /// # let _: Router = app; /// ``` pub fn protocols(mut self, protocols: I) -> Self where @@ -308,7 +320,7 @@ impl WebSocketUpgrade { /// ``` pub fn on_failed_upgrade(self, callback: C) -> WebSocketUpgrade where - C: OnFailedUpdgrade, + C: OnFailedUpgrade, { WebSocketUpgrade { config: self.config, @@ -322,12 +334,12 @@ impl WebSocketUpgrade { /// Finalize upgrading the connection and call the provided callback with /// the stream. - #[must_use = "to setup the WebSocket connection, this response must be returned"] + #[must_use = "to set up the WebSocket connection, this response must be returned"] pub fn on_upgrade(self, callback: C) -> Response where C: FnOnce(WebSocket) -> Fut + Send + 'static, Fut: Future + Send + 'static, - F: OnFailedUpdgrade, + F: OnFailedUpgrade, { let on_upgrade = self.on_upgrade; let config = self.config; @@ -344,6 +356,8 @@ impl WebSocketUpgrade { return; } }; + let upgraded = TokioIo::new(upgraded); + let socket = WebSocketStream::from_raw_socket( // NOTARY_MODIFICATION: Need to use TokioAdapter to wrap Upgraded which doesn't implement futures crate's AsyncRead and AsyncWrite TokioAdapter::new(upgraded), @@ -376,19 +390,19 @@ impl WebSocketUpgrade { builder = builder.header(header::SEC_WEBSOCKET_PROTOCOL, protocol); } - builder.body(body::boxed(body::Empty::new())).unwrap() + builder.body(Body::empty()).unwrap() } } /// What to do when a connection upgrade fails. /// /// See [`WebSocketUpgrade::on_failed_upgrade`] for more details. -pub trait OnFailedUpdgrade: Send + 'static { +pub trait OnFailedUpgrade: Send + 'static { /// Call the callback. fn call(self, error: Error); } -impl OnFailedUpdgrade for F +impl OnFailedUpgrade for F where F: FnOnce(Error) + Send + 'static, { @@ -397,20 +411,20 @@ where } } -/// The default `OnFailedUpdgrade` used by `WebSocketUpgrade`. +/// The default `OnFailedUpgrade` used by `WebSocketUpgrade`. /// /// It simply ignores the error. #[non_exhaustive] #[derive(Debug)] -pub struct DefaultOnFailedUpdgrade; +pub struct DefaultOnFailedUpgrade; -impl OnFailedUpdgrade for DefaultOnFailedUpdgrade { +impl OnFailedUpgrade for DefaultOnFailedUpgrade { #[inline] fn call(self, _error: Error) {} } #[async_trait] -impl FromRequestParts for WebSocketUpgrade +impl FromRequestParts for WebSocketUpgrade where S: Send + Sync, { @@ -441,7 +455,7 @@ where let on_upgrade = parts .extensions - .remove::() + .remove::() .ok_or(ConnectionNotUpgradable)?; let sec_websocket_protocol = parts.headers.get(header::SEC_WEBSOCKET_PROTOCOL).cloned(); @@ -452,11 +466,12 @@ where sec_websocket_key, on_upgrade, sec_websocket_protocol, - on_failed_upgrade: DefaultOnFailedUpdgrade, + on_failed_upgrade: DefaultOnFailedUpgrade, }) } } +/// NOTARY_MODIFICATION: Made this function public to be used in service.rs pub fn header_eq(headers: &HeaderMap, key: HeaderName, value: &'static str) -> bool { if let Some(header) = headers.get(&key) { header.as_bytes().eq_ignore_ascii_case(value.as_bytes()) @@ -484,13 +499,13 @@ fn header_contains(headers: &HeaderMap, key: HeaderName, value: &'static str) -> /// See [the module level documentation](self) for more details. #[derive(Debug)] pub struct WebSocket { - inner: WebSocketStream>, + inner: WebSocketStream>>, protocol: Option, } impl WebSocket { - /// Consume `self` and get the inner [`async_tungstenite::WebSocketStream`]. - pub fn into_inner(self) -> WebSocketStream> { + /// NOTARY_MODIFICATION: Consume `self` and get the inner [`async_tungstenite::WebSocketStream`]. + pub fn into_inner(self) -> WebSocketStream>> { self.inner } diff --git a/interactive-demo/verifier-rs/src/lib.rs b/interactive-demo/verifier-rs/src/lib.rs index abc95f8..d288cb3 100644 --- a/interactive-demo/verifier-rs/src/lib.rs +++ b/interactive-demo/verifier-rs/src/lib.rs @@ -1,8 +1,13 @@ -use axum::{extract::State, response::IntoResponse, routing::get, Router}; +use axum::{ + extract::{Request, State}, + response::IntoResponse, + routing::get, + Router, +}; use axum_websocket::{WebSocket, WebSocketUpgrade}; use eyre::eyre; -use http::Request; -use hyper::server::conn::Http; +use hyper::{body::Incoming, server::conn::http1}; +use hyper_util::rt::TokioIo; use std::{ net::{IpAddr, SocketAddr}, sync::Arc, @@ -14,7 +19,7 @@ use tokio::{ net::TcpListener, }; use tokio_util::compat::TokioAsyncReadCompatExt; -use tower::MakeService; +use tower_service::Service; use tracing::{debug, error, info}; use ws_stream_tungstenite::WsStream; @@ -45,14 +50,13 @@ pub async fn run_server( info!("Listening for TCP traffic at {}", verifier_address); - let protocol = Arc::new(Http::new()); + let protocol = Arc::new(http1::Builder::new()); let router = Router::new() .route("/verify", get(ws_handler)) .with_state(VerifierGlobals { server_domain: server_domain.to_string(), verification_session_id: verification_session_id.to_string(), }); - let mut app = router.into_make_service(); loop { let stream = match listener.accept().await { @@ -64,14 +68,19 @@ pub async fn run_server( }; debug!("Received a prover's TCP connection"); + let tower_service = router.clone(); let protocol = protocol.clone(); - let service = MakeService::<_, Request>::make_service(&mut app, &stream); tokio::spawn(async move { info!("Accepted prover's TCP connection",); + // Reference: https://github.com/tokio-rs/axum/blob/5201798d4e4d4759c208ef83e30ce85820c07baa/examples/low-level-rustls/src/main.rs#L67-L80 + let io = TokioIo::new(stream); + let hyper_service = hyper::service::service_fn(move |request: Request| { + tower_service.clone().call(request) + }); + // Serve different requests using the same hyper protocol and axum router let _ = protocol - // Can unwrap because it's infallible - .serve_connection(stream, service.await.unwrap()) + .serve_connection(io, hyper_service) // use with_upgrades to upgrade connection to websocket for websocket clients // and to extract tcp connection for tcp clients .with_upgrades() From 7551015519a5b50189854d4bb0c8d4e0ee6d038f Mon Sep 17 00:00:00 2001 From: Hendrik Eeckhaut Date: Thu, 5 Sep 2024 21:01:05 +0200 Subject: [PATCH 11/14] feat: interactive prover in TypeScript --- .vscode/settings.json | 4 +- interactive-demo/README copy.md | 29 ++ interactive-demo/README.md | 38 ++ interactive-demo/main.rs | 76 +++ interactive-demo/prover-rs/Cargo.toml | 7 +- interactive-demo/prover-rs/src/main.rs | 101 ++-- interactive-demo/prover-ts/README.md | 20 - interactive-demo/prover-ts/app.tsx | 89 +++- interactive-demo/prover-ts/package.json | 2 +- interactive-demo/prover-ts/tsconfig.json | 11 +- interactive-demo/prover-ts/worker.ts | 9 + interactive-demo/verifier-rs/Cargo.toml | 8 +- interactive-demo/verifier-rs/README.md | 4 - .../verifier-rs/src/axum_websocket.rs | 3 +- interactive-demo/verifier-rs/src/lib.rs | 52 +- interactive-demo/verifier-rs/src/main.rs | 14 +- src/lib.ts | 10 +- wasm/pkg/package.json | 7 +- wasm/pkg/tlsn_wasm.d.ts | 203 +++++--- wasm/pkg/tlsn_wasm.js | 472 ++++++++++++------ wasm/pkg/tlsn_wasm_bg.wasm | Bin 9107802 -> 9180453 bytes wasm/pkg/tlsn_wasm_bg.wasm.d.ts | 46 +- 22 files changed, 811 insertions(+), 394 deletions(-) create mode 100644 interactive-demo/README copy.md create mode 100644 interactive-demo/README.md create mode 100644 interactive-demo/main.rs delete mode 100644 interactive-demo/prover-ts/README.md create mode 100644 interactive-demo/prover-ts/worker.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index e753d5a..581e977 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,6 @@ { "rust-analyzer.linkedProjects": [ - "wasm/prover/Cargo.toml", "interactive-demo/verifier-rs/Cargo.toml", "interactive-demo/prover-rs/Cargo.toml" ], - "rust-analyzer.cargo.target": "wasm32-unknown-unknown" -} +} \ No newline at end of file diff --git a/interactive-demo/README copy.md b/interactive-demo/README copy.md new file mode 100644 index 0000000..5b52c4b --- /dev/null +++ b/interactive-demo/README copy.md @@ -0,0 +1,29 @@ +# Interactive Verifier: Verifying Data from an API in Rust + +This example demonstrates how to use TLSNotary in a simple interactive session between a Prover and a Verifier. It involves the Verifier first verifying the MPC-TLS session and then confirming the correctness of the data. + +In this example, the Verifier connects to and proves data to the verifier. + +# Run example on a single computer + +You can run both the verifier and prover with: +```sh +cargo run -release --example interactive_networked +``` + +# Run example on two different computers + +To run the example on two different computers, start the verifier first on machine 1: +```sh +cd verifier +cargo run --release +``` +Note: make sure port `9816` is open if you run a firewall. + +Next, on machine 2: +1. Update the (ip address of the verifier on machine 1)[file:./prover/src/main.rs] +2. Run: +```sh +cd prover +cargo run --release +``` diff --git a/interactive-demo/README.md b/interactive-demo/README.md new file mode 100644 index 0000000..330de72 --- /dev/null +++ b/interactive-demo/README.md @@ -0,0 +1,38 @@ +# Test Rust Prover + +1. Start the verifier: +```bash +cd verifier-rs; cargo run --release +``` +2. Run the prover: +```bash +cd prover-rs; cargo run --release +``` + +# Test Browser Prover +1. Start the verifier: +```bash +cd verifier-rs; cargo run --release +``` +2. Since a web browser doesn't have the ability to make TCP connection, we need to use a websocket proxy server to access . +```bash +cargo install wstcp + +wstcp --bind-addr 127.0.0.1:55688 swapi.dev:443 +``` +3. Run the prover + 1. Build tlsn-js + ```bash + cd .. + npm i + npm run build + npm link + ``` + 2. Build demo prover-ts + ```bash + cd prover-ts + npm i + npm link + npm run dev + ``` + 3. Open and click **Start Prover** \ No newline at end of file diff --git a/interactive-demo/main.rs b/interactive-demo/main.rs new file mode 100644 index 0000000..56b7fee --- /dev/null +++ b/interactive-demo/main.rs @@ -0,0 +1,76 @@ +use std::{ + io::{BufRead, BufReader}, + path::Path, + process::{Child, Command, Stdio}, + thread, + time::Duration, +}; + +fn main() -> std::io::Result<()> { + let examples_folder = Path::new(env!("CARGO_MANIFEST_DIR")); + let verifier_dir = examples_folder.join(Path::new("interactive-networked/verifier")); + let prover_dir = examples_folder.join(Path::new("interactive-networked/prover")); + + const SLEEP_TIME_SECS: u64 = 2; // allow the verifier some extra seconds to start and stop + + // Run the verifier in the background + println!("Starting the verifier..."); + let mut verifier = run(&verifier_dir, "cargo", &["run", "--release"], "VERIFIER")?; + + // Allow the verifier some time to start + thread::sleep(Duration::from_secs(SLEEP_TIME_SECS)); + + // Run the prover in the foreground + println!("Starting the prover..."); + let prover_status = run(&prover_dir, "cargo", &["run", "--release"], "PROVER")?.wait()?; + + if prover_status.success() { + println!("Prover finished successfully."); + } else { + eprintln!("Prover finished with errors."); + } + + // Allow the verifier some time to finish the verification + thread::sleep(Duration::from_secs(SLEEP_TIME_SECS)); + + // Stop the verifier after the prover finishes + println!("Stopping the verifier..."); + verifier.kill()?; + println!("Verifier stopped. Script finished."); + + Ok(()) +} + +fn run(working_dir: &Path, cmd: &str, args: &[&str], prefix: &str) -> std::io::Result { + let mut process = Command::new(cmd) + .args(args) + .current_dir(working_dir) + .stdout(Stdio::piped()) // Capture stdout + .stderr(Stdio::piped()) // Capture stderr + .spawn()?; + + // Helper function to handle reading from a stream and prefixing its output + fn handle_output(stream: R, prefix: String, print_fn: F) + where + F: Fn(String) + Send + 'static, + { + thread::spawn(move || { + BufReader::new(stream) + .lines() + .map_while(Result::ok) + .for_each(|line| print_fn(format!("[{}] {}", prefix, line))); + }); + } + + // Prefix stdout + if let Some(stdout) = process.stdout.take() { + handle_output(stdout, prefix.to_string(), |line| println!("{}", line)); + } + + // Prefix stderr + if let Some(stderr) = process.stderr.take() { + handle_output(stderr, prefix.to_string(), |line| eprintln!("{}", line)); + } + + Ok(process) +} diff --git a/interactive-demo/prover-rs/Cargo.toml b/interactive-demo/prover-rs/Cargo.toml index 16b39b0..079dddc 100644 --- a/interactive-demo/prover-rs/Cargo.toml +++ b/interactive-demo/prover-rs/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "prover" +name = "interactive-networked-prover" version = "0.1.0" edition = "2021" @@ -25,5 +25,6 @@ tracing-subscriber = { version ="0.3.18", features = ["env-filter"] } uuid = { version = "1.4.1", features = ["v4", "fast-rng"] } ws_stream_tungstenite = { version = "0.13", features = ["tokio_io"] } -tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.6", package = "tlsn-core" } -tlsn-prover = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.6", package = "tlsn-prover" } +tlsn-core = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.7", package = "tlsn-core" } +tlsn-prover = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.7", package = "tlsn-prover" } +tlsn-common = { git = "https://github.com/tlsnotary/tlsn.git", tag = "v0.1.0-alpha.7", package = "tlsn-common" } \ No newline at end of file diff --git a/interactive-demo/prover-rs/src/main.rs b/interactive-demo/prover-rs/src/main.rs index 565a74f..3633585 100644 --- a/interactive-demo/prover-rs/src/main.rs +++ b/interactive-demo/prover-rs/src/main.rs @@ -3,24 +3,27 @@ use http_body_util::Empty; use hyper::{body::Bytes, Request, StatusCode, Uri}; use hyper_util::rt::TokioIo; use regex::Regex; -use tlsn_core::Direction; -use tlsn_prover::tls::{state::Prove, Prover, ProverConfig}; +use tlsn_common::config::ProtocolConfig; +use tlsn_core::transcript::Idx; +use tlsn_prover::{state::Prove, Prover, ProverConfig}; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_util::compat::{FuturesAsyncReadCompatExt, TokioAsyncReadCompatExt}; use tracing::{debug, info}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; use ws_stream_tungstenite::WsStream; -const TRACING_FILTER: &str = "DEBUG"; +const TRACING_FILTER: &str = "INFO"; const VERIFIER_HOST: &str = "localhost"; const VERIFIER_PORT: u16 = 9816; +// Maximum number of bytes that can be sent from prover to server +const MAX_SENT_DATA: usize = 1 << 12; +// Maximum number of bytes that can be received by prover from server +const MAX_RECV_DATA: usize = 1 << 14; const SECRET: &str = "TLSNotary's private key 🤡"; /// Make sure the following url's domain is the same as SERVER_DOMAIN on the verifier side const SERVER_URL: &str = "https://swapi.dev/api/people/1"; -/// Make sure this is the same on the verifier side -const VERIFICATION_SESSION_ID: &str = "interactive-verifier-demo"; #[tokio::main] async fn main() { @@ -29,21 +32,10 @@ async fn main() { .with(tracing_subscriber::fmt::layer()) .init(); - run_prover( - VERIFIER_HOST, - VERIFIER_PORT, - SERVER_URL, - VERIFICATION_SESSION_ID, - ) - .await; + run_prover(VERIFIER_HOST, VERIFIER_PORT, SERVER_URL).await; } -async fn run_prover( - verifier_host: &str, - verifier_port: u16, - server_uri: &str, - verification_session_id: &str, -) { +async fn run_prover(verifier_host: &str, verifier_port: u16, server_uri: &str) { info!("Sending websocket request..."); let request = http::Request::builder() .uri(format!("ws://{}:{}/verify", verifier_host, verifier_port,)) @@ -62,15 +54,11 @@ async fn run_prover( info!("Websocket connection established!"); let verifier_ws_socket = WsStream::new(verifier_ws_stream); - prover(verifier_ws_socket, server_uri, verification_session_id).await; + prover(verifier_ws_socket, server_uri).await; info!("Proving is successful!"); } -async fn prover( - verifier_socket: T, - uri: &str, - id: &str, -) { +async fn prover(verifier_socket: T, uri: &str) { debug!("Starting proving..."); let uri = uri.parse::().unwrap(); @@ -79,10 +67,18 @@ async fn prover( let server_port = uri.port_u16().unwrap_or(443); // Create prover and connect to verifier. + // + // Perform the setup phase with the verifier. let prover = Prover::new( ProverConfig::builder() - .id(id) - .server_dns(server_domain) + .server_name(server_domain) + .protocol_config( + ProtocolConfig::builder() + .max_sent_data(MAX_SENT_DATA) + .max_recv_data(MAX_RECV_DATA) + .build() + .unwrap(), + ) .build() .unwrap(), ) @@ -91,13 +87,18 @@ async fn prover( .unwrap(); // Connect to TLS Server. - info!("Connect to TLS Server"); let tls_client_socket = tokio::net::TcpStream::connect((server_domain, server_port)) .await .unwrap(); + + // Pass server connection into the prover. let (mpc_tls_connection, prover_fut) = prover.connect(tls_client_socket.compat()).await.unwrap(); + + // Wrap the connection in a TokioIo compatibility layer to use it with hyper. let mpc_tls_connection = TokioIo::new(mpc_tls_connection.compat()); + + // Spawn the Prover to run in the background. let prover_task = tokio::spawn(prover_fut); // MPC-TLS Handshake. @@ -123,55 +124,49 @@ async fn prover( debug!("TLS response: {:?}", response); assert!(response.status() == StatusCode::OK); - // Close TLS Connection. - // let tls_connection = connection_task.await.unwrap().unwrap().io.into_inner(); - // debug!("TLS connection: {:?}", tls_connection); - // tls_connection.compat().close().await.unwrap(); - // info!("TLS Connection closed"); - // Create proof for the Verifier. - info!("Create proof for the Verifier"); let mut prover = prover_task.await.unwrap().unwrap().start_prove(); - redact_and_reveal_sent_data(&mut prover); - redact_and_reveal_received_data(&mut prover); - prover.prove().await.unwrap(); + + let idx_sent = redact_and_reveal_sent_data(&mut prover); + let idx_recv = redact_and_reveal_received_data(&mut prover); + + // Reveal parts of the transcript + prover.prove_transcript(idx_sent, idx_recv).await.unwrap(); // Finalize. - info!("Finalize prover"); prover.finalize().await.unwrap() } /// Redacts and reveals received data to the verifier. -fn redact_and_reveal_received_data(prover: &mut Prover) { - let recv_transcript_len = prover.recv_transcript().data().len(); +fn redact_and_reveal_received_data(prover: &mut Prover) -> Idx { + let recv_transcript = prover.transcript().received(); + let recv_transcript_len = recv_transcript.len(); // Get the homeworld from the received data. - let received_string = String::from_utf8(prover.recv_transcript().data().to_vec()).unwrap(); + let received_string = String::from_utf8(recv_transcript.to_vec()).unwrap(); debug!("Received data: {}", received_string); let re = Regex::new(r#""homeworld"\s?:\s?"(.*?)""#).unwrap(); let homeworld_match = re.captures(&received_string).unwrap().get(1).unwrap(); // Reveal everything except for the homeworld. - _ = prover.reveal(0..homeworld_match.start(), Direction::Received); - _ = prover.reveal( - homeworld_match.end()..recv_transcript_len, - Direction::Received, - ); + let start = homeworld_match.start(); + let end = homeworld_match.end(); + Idx::new([0..start, end..recv_transcript_len]) } /// Redacts and reveals sent data to the verifier. -fn redact_and_reveal_sent_data(prover: &mut Prover) { - let sent_transcript_len = prover.sent_transcript().data().len(); +fn redact_and_reveal_sent_data(prover: &mut Prover) -> Idx { + let sent_transcript = prover.transcript().sent(); + let sent_transcript_len = sent_transcript.len(); - let sent_string = String::from_utf8(prover.sent_transcript().data().to_vec()).unwrap(); + let sent_string: String = String::from_utf8(sent_transcript.to_vec()).unwrap(); let secret_start = sent_string.find(SECRET).unwrap(); debug!("Send data: {}", sent_string); // Reveal everything except for the SECRET. - _ = prover.reveal(0..secret_start, Direction::Sent); - _ = prover.reveal( + Idx::new([ + 0..secret_start, secret_start + SECRET.len()..sent_transcript_len, - Direction::Sent, - ); + ]) } diff --git a/interactive-demo/prover-ts/README.md b/interactive-demo/prover-ts/README.md deleted file mode 100644 index 9faac9c..0000000 --- a/interactive-demo/prover-ts/README.md +++ /dev/null @@ -1,20 +0,0 @@ -TODO - -1. Start Verifier -2. Start websocket proxy -3. Start app - - -Since a web browser doesn't have the ability to make TCP connection, we need to use a websocket proxy server. - -To run your own websockify proxy **locally**, run: -```sh -git clone https://github.com/novnc/websockify && cd websockify -./docker/build.sh -docker run -it --rm -p 55688:80 novnc/websockify 80 swapi.dev:443 -``` - -Run a local websocket proxy -cargo install wstcp - -wstcp $(dig swapi.dev +short):443 --bind-addr 127.0.0.1:55688 \ No newline at end of file diff --git a/interactive-demo/prover-ts/app.tsx b/interactive-demo/prover-ts/app.tsx index aac0cbe..03ea1fb 100644 --- a/interactive-demo/prover-ts/app.tsx +++ b/interactive-demo/prover-ts/app.tsx @@ -1,9 +1,15 @@ import React, { ReactElement, useCallback, useEffect, useState } from 'react'; import { createRoot } from 'react-dom/client'; -import { interactive_prove, prove, verify } from 'tlsn-js'; -import { Proof } from 'tlsn-js/build/types'; +import * as Comlink from 'comlink'; import { Watch } from 'react-loader-spinner'; +import { + Prover as TProver +} from 'tlsn-js'; +const { init, Prover, NotarizedSession, TlsProof }: any = Comlink.wrap( + new Worker(new URL('./worker.ts', import.meta.url)), +); +import { Method } from 'tlsn-js/wasm/pkg'; const container = document.getElementById('root'); const root = createRoot(container!); @@ -12,21 +18,76 @@ root.render(); function App(): ReactElement { const [processing, setProcessing] = useState(false); const [result, setResult] = useState(null); + const [proofHex, setProofHex] = useState(null); const onClick = useCallback(async () => { setProcessing(true); - const result = await interactive_prove('https://swapi.dev/api/people/1', { - headers: { - RTT: '125', - 'Sec-GPC': '1', - }, - id: "interactive-verifier-demo", - verifierProxyUrl: 'ws://localhost:9816', - websocketProxyUrl: 'wss://notary.pse.dev/proxy?token=swapi.dev', //'ws://localhost:55688', - }); - setResult(result); - setProcessing(false); + let url = "https://swapi.dev/api/people/1"; + let method: Method = 'GET'; + let headers = { + 'secret': "TLSNotary's private key" + }; + let body = null; + // let websocketProxyUrl = 'wss://notary.pse.dev/proxy?token=swapi.dev'; + let websocketProxyUrl = 'ws://localhost:55688'; + let verifierProxyUrl = 'ws://localhost:9816/verify'; + const hostname = new URL(url).hostname; + + console.time('setup'); + + await init({ loggingLevel: 'Debug' }); + + console.log("Setting up Prover for", hostname) + const prover = await new Prover({ serverDns: hostname }) as TProver; + console.log("Setting up Prover: 1/2") + await prover.setup(verifierProxyUrl); + console.log("Setting up Prover: done") + + console.timeEnd('setup'); + + console.time('request'); + console.log("Sending request to proxy") + const resp = await prover.sendRequest( + `${websocketProxyUrl}?token=${hostname}`, { url, method, headers, body, } + ); + console.log("Response:", resp); + + console.log("Wait for transcript") + const transcript = await prover.transcript(); + console.log("Transcript:", transcript); + + console.timeEnd('request'); + + console.time('reveal'); + const reveal = { + sent: [ + transcript.ranges.sent.info!, + transcript.ranges.sent.headers!['connection'], + transcript.ranges.sent.headers!['host'], + ...transcript.ranges.sent.lineBreaks, + ], + recv: [ + transcript.ranges.recv.info, + transcript.ranges.recv.headers['server'], + transcript.ranges.recv.headers['date'], + transcript.ranges.recv.json!['name'], + transcript.ranges.recv.json!['eye_color'], + transcript.ranges.recv.json!['gender'], + ...transcript.ranges.recv.lineBreaks, + ], + }; + console.log("Start reveal:", reveal); + await prover.reveal(reveal); + console.timeEnd('reveal'); + + console.log("Ready"); + + console.log("Unredacted data:", { sent: transcript.sent, received: transcript.recv }) + + setResult("Unredacted data successfully revealed to Verifier."); + + setProcessing(false); }, [setResult, setProcessing]); return ( @@ -34,7 +95,9 @@ function App(): ReactElement {

TLSNotary interactive prover demo

Before clicking the start button, make sure the interactive verifier is running:
cd interactive-demo/verifier; cargo run --release
+ You also need a websocket proxy.
+