├── zk ├── sp1 │ ├── .gitignore │ ├── rust-toolchain │ ├── script │ │ ├── data │ │ │ ├── intel_root_ca_crl.der │ │ │ ├── pck_platform_crl.der │ │ │ ├── Intel_SGX_Provisioning_Certification_RootCA.cer │ │ │ ├── identity_tdx.json │ │ │ ├── signing_cert.pem │ │ │ └── tcbinfo-tdx-v3.json │ │ ├── build.rs │ │ ├── Cargo.toml │ │ └── src │ │ │ └── bin │ │ │ └── dcap.rs │ ├── program │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ ├── Cargo.toml │ └── README.md └── risc0 │ ├── .gitignore │ ├── methods │ ├── src │ │ └── lib.rs │ ├── Cargo.toml │ ├── build.rs │ └── guest │ │ ├── Cargo.toml │ │ ├── src │ │ └── main.rs │ │ └── Cargo.lock │ ├── .env.example │ ├── rust-toolchain.toml │ ├── host │ ├── data │ │ ├── signing_cert.der │ │ ├── intel_root_crl.der │ │ ├── pck_platform_crl.der │ │ ├── Intel_SGX_Provisioning_Certification_RootCA.cer │ │ ├── intel_root_crl.hex │ │ ├── identity_tdx.json │ │ ├── signing_cert.hex │ │ ├── tcbinfo-tdx-v3.json │ │ └── pck_platform_crl.hex │ ├── Cargo.toml │ └── src │ │ └── main.rs │ ├── Cargo.toml │ └── README.md ├── tdx ├── examples │ ├── testdata │ │ ├── sgx_v3_quote.bin │ │ └── tdx_v4_quote.bin │ ├── attestation.rs │ ├── fmspc.rs │ └── inspect.rs ├── Makefile ├── build.rs ├── src │ ├── pccs │ │ ├── mod.rs │ │ ├── pcs.rs │ │ ├── fmspc_tcb.rs │ │ └── enclave_id.rs │ ├── error.rs │ ├── utils.rs │ ├── device.rs │ └── lib.rs ├── Cargo.toml └── README.md ├── .gitignore ├── Cargo.toml ├── Dockerfile ├── README.md └── LICENSE /zk/sp1/.gitignore: -------------------------------------------------------------------------------- 1 | elf/ -------------------------------------------------------------------------------- /zk/risc0/.gitignore: -------------------------------------------------------------------------------- 1 | profiles -------------------------------------------------------------------------------- /zk/risc0/methods/src/lib.rs: -------------------------------------------------------------------------------- 1 | include!(concat!(env!("OUT_DIR"), "/methods.rs")); 2 | -------------------------------------------------------------------------------- /zk/sp1/rust-toolchain: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "1.81.0" 3 | components = ["llvm-tools", "rustc-dev"] -------------------------------------------------------------------------------- /zk/risc0/.env.example: -------------------------------------------------------------------------------- 1 | BONSAI_API_KEY="" # see form linked above 2 | BONSAI_API_URL="" # provided with your api key -------------------------------------------------------------------------------- /zk/risc0/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "stable" 3 | components = ["rustfmt", "rust-src"] 4 | profile = "minimal" 5 | -------------------------------------------------------------------------------- /zk/risc0/host/data/signing_cert.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/zk/risc0/host/data/signing_cert.der -------------------------------------------------------------------------------- /tdx/examples/testdata/sgx_v3_quote.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/tdx/examples/testdata/sgx_v3_quote.bin -------------------------------------------------------------------------------- /tdx/examples/testdata/tdx_v4_quote.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/tdx/examples/testdata/tdx_v4_quote.bin -------------------------------------------------------------------------------- /zk/risc0/host/data/intel_root_crl.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/zk/risc0/host/data/intel_root_crl.der -------------------------------------------------------------------------------- /tdx/Makefile: -------------------------------------------------------------------------------- 1 | cbindings: 2 | mkdir -p c 3 | cargo build --features clib --release 4 | cp target/release/libtdx.so c/libtdx.so 5 | 6 | .PHONY: cbindings -------------------------------------------------------------------------------- /zk/risc0/host/data/pck_platform_crl.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/zk/risc0/host/data/pck_platform_crl.der -------------------------------------------------------------------------------- /zk/sp1/script/data/intel_root_ca_crl.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/zk/sp1/script/data/intel_root_ca_crl.der -------------------------------------------------------------------------------- /zk/sp1/script/data/pck_platform_crl.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/zk/sp1/script/data/pck_platform_crl.der -------------------------------------------------------------------------------- /zk/sp1/program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | version = "0.1.0" 3 | name = "dcap-sp1-guest-program" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | dcap-rs.workspace = true 8 | sp1-zkvm.workspace = true 9 | -------------------------------------------------------------------------------- /zk/risc0/host/data/Intel_SGX_Provisioning_Certification_RootCA.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/zk/risc0/host/data/Intel_SGX_Provisioning_Certification_RootCA.cer -------------------------------------------------------------------------------- /zk/sp1/script/data/Intel_SGX_Provisioning_Certification_RootCA.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/automata-network/tdx-attestation-sdk/HEAD/zk/sp1/script/data/Intel_SGX_Provisioning_Certification_RootCA.cer -------------------------------------------------------------------------------- /zk/risc0/methods/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "methods" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [build-dependencies] 7 | risc0-build = { version = "^2.2.0", features = ["unstable"]} 8 | 9 | [package.metadata.risc0] 10 | methods = ["guest"] 11 | -------------------------------------------------------------------------------- /zk/risc0/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = ["host", "methods"] 4 | 5 | # Always optimize; building and running the guest takes much longer without optimization. 6 | [profile.dev] 7 | opt-level = 3 8 | 9 | [profile.release] 10 | debug = 1 11 | lto = true 12 | -------------------------------------------------------------------------------- /zk/risc0/host/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "host" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | methods = { path = "../methods" } 8 | risc0-zkvm = { version = "^2.2.0" } 9 | tracing-subscriber = { version = "0.3", features = ["env-filter"] } 10 | serde = "1.0" 11 | hex = "0.4" 12 | dcap-rs = { git = "https://github.com/automata-network/dcap-rs.git", rev="d847b8f75a493640c4881bdf67775250b6baefab" } 13 | serde_json = "1.0" 14 | -------------------------------------------------------------------------------- /zk/sp1/script/build.rs: -------------------------------------------------------------------------------- 1 | use sp1_build::{build_program_with_args, BuildArgs}; 2 | use sp1_sdk::SP1_CIRCUIT_VERSION; 3 | 4 | fn main() { 5 | build_program_with_args( 6 | "../program", 7 | BuildArgs { 8 | output_directory: Some("../elf".to_string()), 9 | elf_name: Some("dcap-sp1-guest-program-elf".to_string()), 10 | docker: true, 11 | tag: SP1_CIRCUIT_VERSION.to_string(), 12 | ..Default::default() 13 | }, 14 | ) 15 | } -------------------------------------------------------------------------------- /tdx/examples/attestation.rs: -------------------------------------------------------------------------------- 1 | use tdx::Tdx; 2 | 3 | fn main() { 4 | // Initialise a TDX object 5 | let tdx = Tdx::new(); 6 | 7 | // Retrieve an attestation report with default options passed to the hardware device 8 | let (report, _) = tdx.get_attestation_report().unwrap(); 9 | 10 | println!("Attestation Report: {:?}", report); 11 | 12 | // Verify the attestation report 13 | tdx.verify_attestation_report(&report).unwrap(); 14 | 15 | println!("Verification successful!"); 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 7 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 8 | Cargo.lock 9 | !clis/dcap-sp1-cli/Cargo.lock 10 | !zk/risc0/Cargo.lock 11 | !zk/risc0/methods/guest/Cargo.lock 12 | !zk/sp1/Cargo.lock 13 | 14 | # These are backup files generated by rustfmt 15 | **/*.rs.bk 16 | 17 | # Misc 18 | .DS_Store 19 | **/*.env -------------------------------------------------------------------------------- /zk/risc0/host/data/intel_root_crl.hex: -------------------------------------------------------------------------------- 1 | 308201203081C8020101300A06082A8648CE3D0403023068311A301806035504030C11496E74656C2053475820526F6F74204341311A3018060355040A0C11496E74656C20436F72706F726174696F6E3114301206035504070C0B53616E746120436C617261310B300906035504080C024341310B3009060355040613025553170D3235303332303131323135375A170D3236303430333131323135375AA02F302D300A0603551D140403020101301F0603551D2304183016801422650CD65A9D3489F383B49552BF501B392706AC300A06082A8648CE3D0403020347003044022030C9FCE1438DA0A94E4FFFDD46C9650E393BE6E5A7862D4E4E73527932D04AF302206539EFE3F734C3D7DF20D9DFC4630E1C7FF0439A0F8ECE101F15B5EAFF9B4F33 -------------------------------------------------------------------------------- /zk/sp1/script/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | version = "0.1.0" 3 | name = "dcap-script" 4 | edition = "2021" 5 | default-run = "dcap" 6 | 7 | [[bin]] 8 | name = "dcap" 9 | path = "src/bin/dcap.rs" 10 | 11 | [dependencies] 12 | dcap-rs = { workspace = true } 13 | sp1-sdk = { workspace = true } 14 | serde_json = { version = "1.0", default-features = false, features = ["alloc"] } 15 | serde = { version = "1.0", default-features = false, features = ["derive"] } 16 | clap = { version = "4.0", features = ["derive", "env"] } 17 | tracing = "0.1.40" 18 | hex = "0.4.3" 19 | 20 | [build-dependencies] 21 | sp1-build = "^5.0.0" 22 | sp1-sdk.workspace = true -------------------------------------------------------------------------------- /zk/risc0/host/data/identity_tdx.json: -------------------------------------------------------------------------------- 1 | {"enclaveIdentity":{"id":"TD_QE","version":2,"issueDate":"2025-06-04T09:40:18Z","nextUpdate":"2025-07-04T09:40:18Z","tcbEvaluationDataNumber":17,"miscselect":"00000000","miscselectMask":"FFFFFFFF","attributes":"11000000000000000000000000000000","attributesMask":"FBFFFFFFFFFFFFFF0000000000000000","mrsigner":"DC9E2A7C6F948F17474E34A7FC43ED030F7C1563F1BABDDF6340C82E0E54A8C5","isvprodid":2,"tcbLevels":[{"tcb":{"isvsvn":4},"tcbDate":"2024-03-13T00:00:00Z","tcbStatus":"UpToDate"}]},"signature":"182c2576c96697f002cc71f062cfd3f895cb39dc767050432600c2a095e576854c86ba4c41f7f36ead28142be9f6bf358d21d69463a8a720ee62785509c537c2"} -------------------------------------------------------------------------------- /zk/sp1/script/data/identity_tdx.json: -------------------------------------------------------------------------------- 1 | {"enclaveIdentity":{"id":"TD_QE","version":2,"issueDate":"2025-02-15T02:09:37Z","nextUpdate":"2025-03-17T02:09:37Z","tcbEvaluationDataNumber":17,"miscselect":"00000000","miscselectMask":"FFFFFFFF","attributes":"11000000000000000000000000000000","attributesMask":"FBFFFFFFFFFFFFFF0000000000000000","mrsigner":"DC9E2A7C6F948F17474E34A7FC43ED030F7C1563F1BABDDF6340C82E0E54A8C5","isvprodid":2,"tcbLevels":[{"tcb":{"isvsvn":4},"tcbDate":"2024-03-13T00:00:00Z","tcbStatus":"UpToDate"}]},"signature":"9f14a5762519a73476fc3944bfb318a9f14afa622546a55ee25ae93cdb91756f4b9b15e4d7e65d5da2dd7d5cf8123895507c29d329dabc26c95efe28bb6e32d9"} -------------------------------------------------------------------------------- /tdx/build.rs: -------------------------------------------------------------------------------- 1 | extern crate cbindgen; 2 | 3 | use std::env; 4 | 5 | fn main() { 6 | let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); 7 | let bindings_filename = format!("{}/c/tdx.h", &crate_dir); 8 | 9 | let clib_enabled = env::var_os("CARGO_FEATURE_CLIB").is_some(); 10 | if clib_enabled { 11 | // Build the C bindings header. 12 | cbindgen::Builder::new() 13 | .with_crate(&crate_dir) 14 | .with_language(cbindgen::Language::C) 15 | .generate() 16 | .expect("Unable to generate C bindings") 17 | .write_to_file(&bindings_filename); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tdx/src/pccs/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod enclave_id; 2 | pub mod fmspc_tcb; 3 | pub mod pcs; 4 | 5 | // Chain Defaults 6 | pub const DEFAULT_RPC_URL: &str = "https://1rpc.io/ata/testnet"; 7 | 8 | // PCCS addresses 9 | // TCB Eval Number = 18 (Standard until 2026-05-14) 10 | pub const ENCLAVE_ID_DAO_ADDRESS: &str = "6eE9602b90E8C451FfBCc8d5Dc9C8A3BF0A4fA56"; 11 | pub const FMSPC_TCB_DAO_ADDRESS: &str = "62E8Cd513B12F248804123f7ed12A0601B79FBAc"; 12 | pub const PCS_DAO_ADDRESS: &str = "B270cD8550DA117E3accec36A90c4b0b48daD342"; 13 | 14 | pub fn remove_prefix_if_found(h: &str) -> &str { 15 | if h.starts_with("0x") { 16 | &h[2..] 17 | } else { 18 | &h 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tdx/examples/fmspc.rs: -------------------------------------------------------------------------------- 1 | use tdx::Tdx; 2 | use tdx::utils::get_pck_fmspc_and_issuer; 3 | 4 | fn main() { 5 | // Initialise a TDX object 6 | let tdx = Tdx::new(); 7 | 8 | // Retrieve an attestation report with default options passed to the hardware device 9 | let (report, _) = tdx.get_attestation_report().unwrap(); 10 | // println!("Attestation Report: {:?}", report); 11 | 12 | let (fmspc, _) = get_pck_fmspc_and_issuer(&report); 13 | println!("FMSPC: {:?}", fmspc.to_uppercase()); 14 | if report.header.tee_type == 0 { 15 | println!("Platform: SGX"); 16 | } else { 17 | println!("Platform: TDX"); 18 | } 19 | println!("Version: {}", report.header.version); 20 | } -------------------------------------------------------------------------------- /zk/risc0/methods/build.rs: -------------------------------------------------------------------------------- 1 | use risc0_build::{embed_methods_with_options, DockerOptionsBuilder, GuestOptionsBuilder}; 2 | use std::collections::HashMap; 3 | use std::path::PathBuf; 4 | 5 | fn main() { 6 | let manifest_dir = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()); 7 | let mut builder = GuestOptionsBuilder::default(); 8 | if std::env::var("RISC0_USE_DOCKER").is_ok() { 9 | let docker_options = DockerOptionsBuilder::default() 10 | .root_dir(manifest_dir.join("../")) 11 | .build() 12 | .unwrap(); 13 | 14 | builder.use_docker(docker_options); 15 | } 16 | let guest_options = builder.build().unwrap(); 17 | embed_methods_with_options(HashMap::from([("dcap_guest", guest_options)])); 18 | } 19 | -------------------------------------------------------------------------------- /zk/risc0/methods/guest/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dcap_guest" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [workspace] 7 | 8 | [dependencies] 9 | risc0-zkvm = { version = "^2.2.0", default-features = false, features = ["std", "unstable"] } 10 | dcap-rs = { git = "https://github.com/automata-network/dcap-rs.git", rev="d847b8f75a493640c4881bdf67775250b6baefab" } 11 | hex = "0.4" 12 | chrono = "0.4" 13 | serde_json = { version = "1.0" } 14 | 15 | [patch.crates-io] 16 | sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" } 17 | crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.2-risczero.0" } 18 | p256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "p256/v0.13.2-risczero.1" } 19 | -------------------------------------------------------------------------------- /zk/sp1/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "program", 4 | "script", 5 | ] 6 | resolver = "2" 7 | 8 | [workspace.dependencies] 9 | dcap-rs = { git = "https://github.com/automata-network/dcap-rs.git", rev="d847b8f75a493640c4881bdf67775250b6baefab" } 10 | sp1-sdk = { version = "^5.0.0" } 11 | sp1-zkvm = { version = "^5.0.0" } 12 | 13 | [patch.crates-io] 14 | sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "patch-sha2-0.10.8-sp1-4.0.0" } 15 | crypto-bigint = { git = "https://github.com/sp1-patches/RustCrypto-bigint", tag = "patch-0.5.5-sp1-4.0.0" } 16 | p256 = { git = "https://github.com/sp1-patches/elliptic-curves", tag = "patch-p256-13.2-sp1-5.0.0" } 17 | sha3-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha3", tag = "patch-sha3-0.10.8-sp1-4.0.0" } 18 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = [ 4 | "tdx" 5 | ] 6 | exclude = [ 7 | "clis/dcap-bonsai-cli", 8 | "clis/dcap-sp1-cli", 9 | "zk/risc0", 10 | "zk/sp1" 11 | ] 12 | 13 | [workspace.package] 14 | name = "automata-tdx-attestation-sdk" 15 | version = "0.1.0" 16 | edition = "2021" 17 | authors = ["Automata Team"] 18 | homepage = "https://www.ata.network/" 19 | license = "Apache-2.0" 20 | 21 | [workspace.dependencies] 22 | dcap-rs = { git = "https://github.com/automata-network/dcap-rs.git", rev="d847b8f75a493640c4881bdf67775250b6baefab" } 23 | 24 | base64-url = "3.0.0" 25 | hex = "0.4.3" 26 | rand = "0.8.5" 27 | serde = "1.0.217" 28 | ureq = { version = "2.12.1", features = ["json"] } 29 | alloy = "1.0.20" 30 | anyhow = "1.0.97" 31 | chrono = "0.4.40" 32 | tokio = { version = "1.44.1", features = ["rt-multi-thread"] } 33 | x509-parser = "0.15.1" 34 | clap = { version = "4.0", features = ["derive", "env"] } 35 | -------------------------------------------------------------------------------- /zk/sp1/script/data/signing_cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICizCCAjKgAwIBAgIUfjiC1ftVKUpASY5FhAPpFJG99FUwCgYIKoZIzj0EAwIw 3 | aDEaMBgGA1UEAwwRSW50ZWwgU0dYIFJvb3QgQ0ExGjAYBgNVBAoMEUludGVsIENv 4 | cnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExCzAJ 5 | BgNVBAYTAlVTMB4XDTE4MDUyMTEwNTAxMFoXDTI1MDUyMTEwNTAxMFowbDEeMBwG 6 | A1UEAwwVSW50ZWwgU0dYIFRDQiBTaWduaW5nMRowGAYDVQQKDBFJbnRlbCBDb3Jw 7 | b3JhdGlvbjEUMBIGA1UEBwwLU2FudGEgQ2xhcmExCzAJBgNVBAgMAkNBMQswCQYD 8 | VQQGEwJVUzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABENFG8xzydWRfK92bmGv 9 | P+mAh91PEyV7Jh6FGJd5ndE9aBH7R3E4A7ubrlh/zN3C4xvpoouGlirMba+W2lju 10 | ypajgbUwgbIwHwYDVR0jBBgwFoAUImUM1lqdNInzg7SVUr9QGzknBqwwUgYDVR0f 11 | BEswSTBHoEWgQ4ZBaHR0cHM6Ly9jZXJ0aWZpY2F0ZXMudHJ1c3RlZHNlcnZpY2Vz 12 | LmludGVsLmNvbS9JbnRlbFNHWFJvb3RDQS5kZXIwHQYDVR0OBBYEFH44gtX7VSlK 13 | QEmORYQD6RSRvfRVMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8EAjAAMAoGCCqG 14 | SM49BAMCA0cAMEQCIB9C8wOAN/ImxDtGACV246KcqjagZOR0kyctyBrsGGJVAiAj 15 | ftbrNGsGU8YH211dRiYNoPPu19Zp/ze8JmhujB0oBw== 16 | -----END CERTIFICATE----- 17 | -------------------------------------------------------------------------------- /tdx/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tdx" 3 | version = "0.2.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | name = "tdx" 8 | crate-type = ["rlib", "cdylib"] 9 | 10 | [features] 11 | default = ["configfs", "tpm"] 12 | configfs = ["dep:coco-provider", "coco-provider/configfs"] 13 | tpm = ["dep:coco-provider", "coco-provider/tpm"] 14 | clib = ["dep:once_cell", "configfs", "tpm"] 15 | coco-provider = ["dep:coco-provider"] 16 | 17 | [build-dependencies] 18 | cbindgen = "0.29.0" 19 | 20 | [profile.release] 21 | lto = true 22 | 23 | [dependencies] 24 | dcap-rs.workspace = true 25 | rand.workspace = true 26 | ureq.workspace = true 27 | base64-url.workspace = true 28 | serde.workspace = true 29 | hex.workspace = true 30 | alloy.workspace = true 31 | anyhow.workspace = true 32 | chrono.workspace = true 33 | tokio.workspace = true 34 | x509-parser.workspace = true 35 | clap.workspace = true 36 | 37 | once_cell = { version = "1.20.2", optional=true } 38 | coco-provider = { git = "https://github.com/automata-network/coco-provider-sdk", optional = true, default-features = false } 39 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Use Ubuntu 22.04 as base image (supported for TDX on both GCP and Azure) 2 | FROM ubuntu:22.04 3 | 4 | # Set environment variables to avoid interactive prompts during installation 5 | ENV DEBIAN_FRONTEND=noninteractive 6 | 7 | # Install system dependencies 8 | RUN apt-get update && apt-get install -y \ 9 | build-essential \ 10 | pkg-config \ 11 | libtss2-dev \ 12 | libssl-dev \ 13 | curl \ 14 | && rm -rf /var/lib/apt/lists/* 15 | 16 | # Install Rust and set to nightly 17 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly 18 | ENV PATH="/root/.cargo/bin:${PATH}" 19 | 20 | # The TDX device will be mounted at /sys/kernel/config/tsm/report at runtime 21 | 22 | # Set working directory 23 | WORKDIR /app 24 | 25 | # Copy the project files 26 | COPY . . 27 | 28 | # Build the attestation, fmspc and inspect example 29 | RUN cargo build --example attestation 30 | RUN cargo build --example fmspc 31 | RUN cargo build --example inspect 32 | 33 | # Set the entrypoint to run the fmspc example 34 | ENTRYPOINT ["./target/debug/examples/fmspc"] 35 | -------------------------------------------------------------------------------- /tdx/src/pccs/pcs.rs: -------------------------------------------------------------------------------- 1 | use super::{DEFAULT_RPC_URL, PCS_DAO_ADDRESS}; 2 | use alloy::{primitives::Address, providers::ProviderBuilder, sol}; 3 | use anyhow::Result; 4 | 5 | sol! { 6 | #[sol(rpc)] 7 | interface IPCSDao { 8 | #[derive(Debug)] 9 | enum CA { 10 | ROOT, 11 | PROCESSOR, 12 | PLATFORM, 13 | SIGNING 14 | } 15 | 16 | #[derive(Debug)] 17 | function getCertificateById(CA ca) external view returns (bytes memory cert, bytes memory crl); 18 | } 19 | } 20 | 21 | pub async fn get_certificate_by_id(ca_id: IPCSDao::CA) -> Result<(Vec, Vec)> { 22 | let rpc_url = DEFAULT_RPC_URL.parse().expect("Failed to parse RPC URL"); 23 | let provider = ProviderBuilder::new().connect_http(rpc_url); 24 | 25 | let pcs_dao_address_slice = hex::decode(PCS_DAO_ADDRESS).expect("invalid address hex"); 26 | let pcs_dao_contract = IPCSDao::new(Address::from_slice(&pcs_dao_address_slice), &provider); 27 | 28 | let call_builder = pcs_dao_contract.getCertificateById(ca_id); 29 | 30 | let call_return = call_builder.call().await?; 31 | 32 | let cert = call_return.cert.to_vec(); 33 | let crl = call_return.crl.to_vec(); 34 | 35 | Ok((cert, crl)) 36 | } 37 | -------------------------------------------------------------------------------- /zk/risc0/host/data/signing_cert.hex: -------------------------------------------------------------------------------- 1 | 3082028d30820232a00302010202147e3882d5fb55294a40498e458403e91491bdf455300a06082a8648ce3d0403023068311a301806035504030c11496e74656c2053475820526f6f74204341311a3018060355040a0c11496e74656c20436f72706f726174696f6e3114301206035504070c0b53616e746120436c617261310b300906035504080c024341310b3009060355040613025553301e170d3235303530363039323530305a170d3332303530363039323530305a306c311e301c06035504030c15496e74656c2053475820544342205369676e696e67311a3018060355040a0c11496e74656c20436f72706f726174696f6e3114301206035504070c0b53616e746120436c617261310b300906035504080c024341310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d0301070342000443451bcc73c9d5917caf766e61af3fe98087dd4f13257b261e851897799dd13d6811fb47713803bb9bae587fccddc2e31be9a28b86962acc6daf96da58eeca96a381b53081b2301f0603551d2304183016801422650cd65a9d3489f383b49552bf501b392706ac30520603551d1f044b30493047a045a043864168747470733a2f2f6365727469666963617465732e7472757374656473657276696365732e696e74656c2e636f6d2f496e74656c534758526f6f7443412e646572301d0603551d0e041604147e3882d5fb55294a40498e458403e91491bdf455300e0603551d0f0101ff0404030206c0300c0603551d130101ff04023000300a06082a8648ce3d0403020349003046022100dd9a646e028dea08ef130b522824c213028384c38765804047cd2cf54ee3124c022100a553a8e92de7df9ca343b79b7842fafe456f4d058d859c81ebb71228ce50ba39 -------------------------------------------------------------------------------- /tdx/examples/inspect.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use clap::Parser; 4 | use dcap_rs::types::quotes::{QuoteHeader, version_3::QuoteV3, version_4::QuoteV4}; 5 | use dcap_rs::utils::cert::{parse_certchain, parse_pem}; 6 | use tdx::utils::{extract_fmspc_from_extension, get_pck_fmspc_and_issuer}; 7 | 8 | #[derive(Parser)] 9 | struct Opt { 10 | #[clap(long)] 11 | report: PathBuf, 12 | } 13 | 14 | fn main() -> anyhow::Result<()> { 15 | let opt = Opt::parse(); 16 | let report_path = opt.report; 17 | let report = std::fs::read(&report_path)?; 18 | let header = QuoteHeader::from_bytes(&report[0..48]); 19 | if header.version == 3 { 20 | let quote_v3 = QuoteV3::from_bytes(&report); 21 | let fmspc = get_pck_fmspc_from_v3_quote("e_v3); 22 | println!("FMSPC: {:?}", fmspc.to_uppercase()); 23 | println!("Platform: SGX"); 24 | println!("Version: V3"); 25 | } else if header.version == 4 { 26 | let quote_v4 = QuoteV4::from_bytes(&report); 27 | let (fmspc, _) = get_pck_fmspc_and_issuer("e_v4); 28 | println!("FMSPC: {:?}", fmspc.to_uppercase()); 29 | if quote_v4.header.tee_type == 0 { 30 | println!("Platform: SGX"); 31 | } else { 32 | println!("Platform: TDX"); 33 | } 34 | println!("Version: V4"); 35 | } else { 36 | eprintln!("Unsupported quote version: {}", header.version); 37 | } 38 | Ok(()) 39 | } 40 | 41 | fn get_pck_fmspc_from_v3_quote(quote: &QuoteV3) -> String { 42 | let pem = parse_pem("e.signature.qe_cert_data.cert_data).expect("Failed to parse cert data"); 43 | let cert_chain = parse_certchain(&pem); 44 | let pck = &cert_chain[0]; 45 | let fmspc_slice = extract_fmspc_from_extension(pck); 46 | let fmspc = hex::encode(fmspc_slice); 47 | fmspc 48 | } 49 | -------------------------------------------------------------------------------- /zk/risc0/README.md: -------------------------------------------------------------------------------- 1 | # Automata DCAP Risc Zero Rust Sample Project 2 | 3 | Leveraging from the Risc Zero Rust Starter Template, this is the Risc Zero Sample Project to perform the Intel SGX / Intel TDX Quote Verification, including the host and guest program. 4 | 5 | ## Quick Start 6 | 7 | First, make sure [rustup] is installed. The 8 | [`rust-toolchain.toml`][rust-toolchain] file will be used by `cargo` to 9 | automatically install the correct version. 10 | 11 | To build all methods and execute the method within the zkVM, run the following 12 | command: 13 | 14 | ```bash 15 | cargo run 16 | ``` 17 | 18 | ### Executing the project locally in development mode 19 | 20 | During development, faster iteration upon code changes can be achieved by leveraging [dev-mode], we strongly suggest activating it during your early development phase. Furthermore, you might want to get insights into the execution statistics of your project, and this can be achieved by specifying the environment variable `RUST_LOG="[executor]=info"` before running your project. 21 | 22 | Put together, the command to run your project in development mode while getting execution statistics is: 23 | 24 | ```bash 25 | RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run 26 | ``` 27 | 28 | ## Directory Structure 29 | 30 | It is possible to organize the files for these components in various ways. 31 | However, in this starter template we use a standard directory structure for zkVM 32 | applications, which we think is a good starting point for your applications. 33 | 34 | ```text 35 | project_name 36 | ├── Cargo.toml 37 | ├── host 38 | │ ├── Cargo.toml 39 | │ └── src 40 | │ └── main.rs <-- [Host code goes here] 41 | └── methods 42 | ├── Cargo.toml 43 | ├── build.rs 44 | ├── guest 45 | │ ├── Cargo.toml 46 | │ └── src 47 | │ └── bin 48 | │ └── method_name.rs <-- [Guest code goes here] 49 | └── src 50 | └── lib.rs 51 | ``` 52 | -------------------------------------------------------------------------------- /tdx/src/pccs/fmspc_tcb.rs: -------------------------------------------------------------------------------- 1 | use super::{remove_prefix_if_found, DEFAULT_RPC_URL, FMSPC_TCB_DAO_ADDRESS}; 2 | use anyhow::Result; 3 | 4 | use alloy::{ 5 | primitives::{Address, U256}, 6 | providers::ProviderBuilder, 7 | sol, 8 | }; 9 | 10 | sol! { 11 | #[sol(rpc)] 12 | interface IFmspcTcbDao { 13 | #[derive(Debug)] 14 | struct TcbInfoJsonObj { 15 | string tcbInfoStr; 16 | bytes signature; 17 | } 18 | 19 | #[derive(Debug)] 20 | function getTcbInfo(uint256 tcbType, string calldata fmspc, uint256 version) returns (TcbInfoJsonObj memory tcbObj); 21 | } 22 | } 23 | 24 | pub async fn get_tcb_info(tcb_type: u8, fmspc: &str, version: u32) -> Result> { 25 | let rpc_url = DEFAULT_RPC_URL.parse().expect("Failed to parse RPC URL"); 26 | let provider = ProviderBuilder::new().connect_http(rpc_url); 27 | 28 | let fmspc_tcb_dao_address_slice = 29 | hex::decode(FMSPC_TCB_DAO_ADDRESS).expect("Invalid address hex"); 30 | let fmspc_tcb_dao_contract = 31 | IFmspcTcbDao::new(Address::from_slice(&fmspc_tcb_dao_address_slice), &provider); 32 | 33 | let call_builder = fmspc_tcb_dao_contract.getTcbInfo( 34 | U256::from(tcb_type), 35 | String::from(fmspc), 36 | U256::from(version), 37 | ); 38 | 39 | let call_return = call_builder.call().await?; 40 | let tcb_info_str = call_return.tcbInfoStr; 41 | let signature_bytes = call_return.signature; 42 | 43 | if tcb_info_str.len() == 0 || signature_bytes.len() == 0 { 44 | return Err(anyhow::Error::msg(format!( 45 | "TCBInfo for FMSPC: {}; Version: {} is missing and must be upserted to on-chain pccs", 46 | fmspc, version 47 | ))); 48 | } 49 | 50 | let signature = signature_bytes.to_string(); 51 | 52 | let ret_str = format!( 53 | "{{\"tcbInfo\": {}, \"signature\": \"{}\"}}", 54 | tcb_info_str, 55 | remove_prefix_if_found(signature.as_str()) 56 | ); 57 | 58 | let ret = ret_str.into_bytes(); 59 | Ok(ret) 60 | } 61 | -------------------------------------------------------------------------------- /tdx/src/pccs/enclave_id.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | 3 | use super::{remove_prefix_if_found, DEFAULT_RPC_URL, ENCLAVE_ID_DAO_ADDRESS}; 4 | use alloy::{ 5 | primitives::{Address, U256}, 6 | providers::ProviderBuilder, 7 | sol, 8 | }; 9 | 10 | sol! { 11 | #[sol(rpc)] 12 | interface IEnclaveIdentityDao { 13 | #[derive(Debug)] 14 | struct EnclaveIdentityJsonObj { 15 | string identityStr; 16 | bytes signature; 17 | } 18 | 19 | #[derive(Debug)] 20 | function getEnclaveIdentity(uint256 id, uint256 version) returns (EnclaveIdentityJsonObj memory enclaveIdObj); 21 | } 22 | } 23 | 24 | pub async fn get_enclave_identity(version: u32) -> Result> { 25 | let rpc_url = DEFAULT_RPC_URL.parse().expect("Failed to parse RPC URL"); 26 | let provider = ProviderBuilder::new().connect_http(rpc_url); 27 | 28 | let enclave_id_dao_address_slice = 29 | hex::decode(ENCLAVE_ID_DAO_ADDRESS).expect("Invalid address hex"); 30 | 31 | let enclave_id_dao_contract = IEnclaveIdentityDao::new( 32 | Address::from_slice(&enclave_id_dao_address_slice), 33 | &provider, 34 | ); 35 | 36 | // EnclaveIdType::TDQE 37 | let enclave_id_type_uint256 = U256::from(2); 38 | 39 | let call_builder = 40 | enclave_id_dao_contract.getEnclaveIdentity(enclave_id_type_uint256, U256::from(version)); 41 | 42 | let call_return = call_builder.call().await?; 43 | 44 | let identity_str = call_return.identityStr; 45 | let signature_bytes = call_return.signature; 46 | 47 | if identity_str.len() == 0 || signature_bytes.len() == 0 { 48 | return Err(anyhow::Error::msg(format!( 49 | "QEIdentity for TDX; Version: {} is missing and must be upserted to on-chain pccs", 50 | version 51 | ))); 52 | } 53 | 54 | let signature = signature_bytes.to_string(); 55 | 56 | let ret_str = format!( 57 | "{{\"enclaveIdentity\": {}, \"signature\": \"{}\"}}", 58 | identity_str, 59 | remove_prefix_if_found(signature.as_str()) 60 | ); 61 | 62 | let ret = ret_str.into_bytes(); 63 | Ok(ret) 64 | } 65 | -------------------------------------------------------------------------------- /tdx/src/error.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Display; 2 | 3 | use coco_provider::error::CocoError; 4 | 5 | pub type Result = std::result::Result; 6 | 7 | #[derive(Debug, Clone, Eq, PartialEq)] 8 | pub enum TdxError { 9 | Anyhow(String), 10 | ConfigOptions(String), 11 | Cpu(String), 12 | Dcap(String), 13 | Firmware(String), 14 | Http(String), 15 | IO(String), 16 | SSL(String), 17 | Tpm(String), 18 | X509(String), 19 | Unknown, 20 | } 21 | 22 | impl Display for TdxError { 23 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 24 | match self { 25 | TdxError::Anyhow(err) => write!(f, "Anyhow: {}", err), 26 | TdxError::ConfigOptions(err) => write!(f, "ConfigOptions: {}", err), 27 | TdxError::Cpu(err) => write!(f, "Cpu: {}", err), 28 | TdxError::Dcap(err) => write!(f, "Dcap: {}", err), 29 | TdxError::Firmware(err) => write!(f, "Firmware: {}", err), 30 | TdxError::Http(err) => write!(f, "Http: {}", err), 31 | TdxError::IO(err) => write!(f, "IO: {}", err), 32 | TdxError::SSL(err) => write!(f, "SSL: {}", err), 33 | TdxError::Tpm(err) => write!(f, "Tpm: {}", err), 34 | TdxError::X509(err) => write!(f, "X509: {}", err), 35 | TdxError::Unknown => write!(f, "Unknown"), 36 | } 37 | } 38 | } 39 | 40 | impl std::error::Error for TdxError {} 41 | 42 | impl From for TdxError { 43 | fn from(err: CocoError) -> Self { 44 | TdxError::Firmware(format!("{:?}", err)) 45 | } 46 | } 47 | 48 | impl From for TdxError { 49 | fn from(err: base64_url::base64::DecodeError) -> Self { 50 | TdxError::IO(format!("{:?}", err)) 51 | } 52 | } 53 | 54 | impl From for TdxError { 55 | fn from(err: std::io::Error) -> Self { 56 | TdxError::IO(format!("{:?}", err)) 57 | } 58 | } 59 | 60 | impl From for TdxError { 61 | fn from(err: ureq::Error) -> Self { 62 | TdxError::Http(format!("{:?}", err)) 63 | } 64 | } 65 | 66 | impl From<&str> for TdxError { 67 | fn from(err: &str) -> Self { 68 | TdxError::Firmware(err.to_string()) 69 | } 70 | } 71 | 72 | impl From for TdxError { 73 | fn from(err: anyhow::Error) -> Self { 74 | TdxError::Anyhow(err.to_string()) 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /tdx/src/utils.rs: -------------------------------------------------------------------------------- 1 | use crate::CA; 2 | use dcap_rs::types::quotes::version_4::QuoteV4; 3 | use dcap_rs::types::quotes::QeReportCertData; 4 | use dcap_rs::utils::cert::{get_x509_issuer_cn, parse_certchain, parse_pem}; 5 | use rand::RngCore; 6 | use x509_parser::oid_registry::asn1_rs::{oid, FromDer, OctetString, Oid, Sequence}; 7 | use x509_parser::prelude::*; 8 | 9 | /// Generates 64 bytes of random data 10 | /// Always guaranted to return something (ie, unwrap() can be safely called) 11 | pub fn generate_random_data() -> Option<[u8; 64]> { 12 | let mut data = [0u8; 64]; 13 | rand::thread_rng().fill_bytes(&mut data); 14 | Some(data) 15 | } 16 | 17 | pub fn get_pck_fmspc_and_issuer(quote: &QuoteV4) -> (String, CA) { 18 | let raw_cert_data = QeReportCertData::from_bytes("e.signature.qe_cert_data.cert_data); 19 | 20 | let pem = parse_pem(&raw_cert_data.qe_cert_data.cert_data).expect("Failed to parse cert data"); 21 | // Cert Chain: 22 | // [0]: pck -> 23 | // [1]: pck ca -> 24 | // [2]: root ca 25 | let cert_chain = parse_certchain(&pem); 26 | let pck = &cert_chain[0]; 27 | 28 | let pck_issuer = get_x509_issuer_cn(pck); 29 | 30 | let pck_ca = match pck_issuer.as_str() { 31 | "Intel SGX PCK Platform CA" => CA::PLATFORM, 32 | "Intel SGX PCK Processor CA" => CA::PROCESSOR, 33 | _ => panic!("Unknown PCK Issuer"), 34 | }; 35 | 36 | let fmspc_slice = extract_fmspc_from_extension(pck); 37 | let fmspc = hex::encode(fmspc_slice); 38 | 39 | (fmspc, pck_ca) 40 | } 41 | 42 | pub fn extract_fmspc_from_extension<'a>(cert: &'a X509Certificate<'a>) -> [u8; 6] { 43 | let sgx_extensions_bytes = cert 44 | .get_extension_unique(&oid!(1.2.840 .113741 .1 .13 .1)) 45 | .unwrap() 46 | .unwrap() 47 | .value; 48 | 49 | let (_, sgx_extensions) = Sequence::from_der(sgx_extensions_bytes).unwrap(); 50 | 51 | let mut fmspc = [0; 6]; 52 | 53 | let mut i = sgx_extensions.content.as_ref(); 54 | 55 | while i.len() > 0 { 56 | let (j, current_sequence) = Sequence::from_der(i).unwrap(); 57 | i = j; 58 | let (j, current_oid) = Oid::from_der(current_sequence.content.as_ref()).unwrap(); 59 | match current_oid.to_id_string().as_str() { 60 | "1.2.840.113741.1.13.1.4" => { 61 | let (k, fmspc_bytes) = OctetString::from_der(j).unwrap(); 62 | assert_eq!(k.len(), 0); 63 | fmspc.copy_from_slice(fmspc_bytes.as_ref()); 64 | break; 65 | } 66 | _ => continue, 67 | } 68 | } 69 | 70 | fmspc 71 | } 72 | -------------------------------------------------------------------------------- /zk/sp1/README.md: -------------------------------------------------------------------------------- 1 | # Automata DCAP SP1 Project 2 | 3 | Leveraging from the [SP1](https://github.com/succinctlabs/sp1) project template, we introduce the Automata DCAP SP1 project to perform the Intel SGX / Intel TDX Quote Verification, including the host and guest program. 4 | 5 | ## Requirements 6 | 7 | - [Rust](https://rustup.rs/) 8 | - [SP1](https://docs.succinct.xyz/getting-started/install.html) 9 | - [Docker](https://docs.docker.com/get-started/get-docker/) 10 | 11 | ## Running the Project 12 | 13 | There are four main steps to run this project: build a program, execute a program, generate a core proof, and 14 | generate an EVM-compatible proof. 15 | 16 | ### Build the Program 17 | 18 | To build the program, run the following command: 19 | 20 | ```sh 21 | cd program 22 | cargo prove build 23 | ``` 24 | 25 | ### Execute the Program and Generate the Proof 26 | 27 | > [!WARNING] 28 | > You will need at least 128 GB of RAM to generate a Groth16 or PLONK proof if you want to perform the calculation locally. 29 | 30 | To generate a proof that is small enough to be verified on-chain and verifiable by the EVM: 31 | 32 | ```sh 33 | cd script 34 | cargo run --release 35 | ``` 36 | 37 | This will generate a Groth16 proof. If you want to generate a PLONK proof, use the `plonk()` method as shown below. 38 | 39 | ```rust 40 | let proof = client.prove(&pk, stdin.clone()).plonk().run().unwrap(); 41 | ``` 42 | 43 | These commands will also generate fixtures that can be used to test the verification of SP1 zkVM proofs 44 | inside Solidity. 45 | 46 | Pay attention, if you want to use [Automata DCAP Attestation](https://github.com/automata-network/automata-dcap-attestation) to perform the on-chain verification, we recommend using [dcap-sp1-cli](/clis/dcap-sp1-cli) to generate the zkVM proofs with the same Verification Key. 47 | 48 | ### Retrieve the Verification Key 49 | 50 | To retrieve your `programVKey` for your on-chain contract, run the following command: 51 | 52 | ```sh 53 | cargo prove vkey --elf elf/dcap-sp1-guest-program-elf 54 | ``` 55 | 56 | ## Using the Prover Network 57 | 58 | We highly recommend using the Succinct prover network for any non-trivial programs or benchmarking purposes. For more information, see the [setup guide](https://docs.succinct.xyz/docs/generating-proofs/prover-network/usage). 59 | 60 | To get started, copy the example environment file: 61 | 62 | ```sh 63 | cp .env.example .env 64 | ``` 65 | 66 | Then, set the `SP1_PROVER` environment variable to `network` and set the `NETWORK_PRIVATE_KEY` 67 | environment variable to your whitelisted private key. 68 | 69 | For example, to generate an EVM-compatible proof using the prover network, run the following 70 | command: 71 | 72 | ```sh 73 | SP1_PROVER=network NETWORK_PRIVATE_KEY=... cargo run --release 74 | ``` 75 | -------------------------------------------------------------------------------- /zk/risc0/host/data/tcbinfo-tdx-v3.json: -------------------------------------------------------------------------------- 1 | {"tcbInfo":{"id":"TDX","version":3,"issueDate":"2025-06-05T03:43:45Z","nextUpdate":"2025-07-05T03:43:45Z","fmspc":"90C06F000000","pceId":"0000","tcbType":0,"tcbEvaluationDataNumber":17,"tdxModule":{"mrsigner":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","attributes":"0000000000000000","attributesMask":"FFFFFFFFFFFFFFFF"},"tdxModuleIdentities":[{"id":"TDX_03","mrsigner":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","attributes":"0000000000000000","attributesMask":"FFFFFFFFFFFFFFFF","tcbLevels":[{"tcb":{"isvsvn":3},"tcbDate":"2024-03-13T00:00:00Z","tcbStatus":"UpToDate"}]},{"id":"TDX_01","mrsigner":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","attributes":"0000000000000000","attributesMask":"FFFFFFFFFFFFFFFF","tcbLevels":[{"tcb":{"isvsvn":4},"tcbDate":"2024-03-13T00:00:00Z","tcbStatus":"UpToDate"},{"tcb":{"isvsvn":2},"tcbDate":"2023-08-09T00:00:00Z","tcbStatus":"OutOfDate"}]}],"tcbLevels":[{"tcb":{"sgxtcbcomponents":[{"svn":2,"category":"BIOS","type":"Early Microcode Update"},{"svn":2,"category":"OS/VMM","type":"SGX Late Microcode Update"},{"svn":2,"category":"OS/VMM","type":"TXT SINIT"},{"svn":2,"category":"BIOS"},{"svn":3,"category":"BIOS"},{"svn":1,"category":"BIOS"},{"svn":0},{"svn":5,"category":"OS/VMM","type":"SEAMLDR ACM"},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0}],"pcesvn":13,"tdxtcbcomponents":[{"svn":5,"category":"OS/VMM","type":"TDX Module"},{"svn":0,"category":"OS/VMM","type":"TDX Module"},{"svn":2,"category":"OS/VMM","type":"TDX Late Microcode Update"},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0}]},"tcbDate":"2024-03-13T00:00:00Z","tcbStatus":"UpToDate"},{"tcb":{"sgxtcbcomponents":[{"svn":2,"category":"BIOS","type":"Early Microcode Update"},{"svn":2,"category":"OS/VMM","type":"SGX Late Microcode Update"},{"svn":2,"category":"OS/VMM","type":"TXT SINIT"},{"svn":2,"category":"BIOS"},{"svn":3,"category":"BIOS"},{"svn":1,"category":"BIOS"},{"svn":0},{"svn":5,"category":"OS/VMM","type":"SEAMLDR ACM"},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0}],"pcesvn":5,"tdxtcbcomponents":[{"svn":5,"category":"OS/VMM","type":"TDX Module"},{"svn":0,"category":"OS/VMM","type":"TDX Module"},{"svn":2,"category":"OS/VMM","type":"TDX Late Microcode Update"},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0}]},"tcbDate":"2018-01-04T00:00:00Z","tcbStatus":"OutOfDate","advisoryIDs":["INTEL-SA-00106","INTEL-SA-00115","INTEL-SA-00135","INTEL-SA-00203","INTEL-SA-00220","INTEL-SA-00233","INTEL-SA-00270","INTEL-SA-00293","INTEL-SA-00320","INTEL-SA-00329","INTEL-SA-00381","INTEL-SA-00389","INTEL-SA-00477","INTEL-SA-00837"]}]},"signature":"a4c32be31be23ed7bd805429d80bb4ca597987e4ad0beac18172d4cc677f972d803c8696d667164a4a2e41bc29cfd980df0ad444f978a34b62b08d37b8495f7b"} -------------------------------------------------------------------------------- /zk/sp1/script/data/tcbinfo-tdx-v3.json: -------------------------------------------------------------------------------- 1 | {"tcbInfo":{"id":"TDX","version":3,"issueDate":"2025-02-15T03:05:10Z","nextUpdate":"2025-03-17T03:05:10Z","fmspc":"90C06F000000","pceId":"0000","tcbType":0,"tcbEvaluationDataNumber":17,"tdxModule":{"mrsigner":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","attributes":"0000000000000000","attributesMask":"FFFFFFFFFFFFFFFF"},"tdxModuleIdentities":[{"id":"TDX_03","mrsigner":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","attributes":"0000000000000000","attributesMask":"FFFFFFFFFFFFFFFF","tcbLevels":[{"tcb":{"isvsvn":3},"tcbDate":"2024-03-13T00:00:00Z","tcbStatus":"UpToDate"}]},{"id":"TDX_01","mrsigner":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","attributes":"0000000000000000","attributesMask":"FFFFFFFFFFFFFFFF","tcbLevels":[{"tcb":{"isvsvn":4},"tcbDate":"2024-03-13T00:00:00Z","tcbStatus":"UpToDate"},{"tcb":{"isvsvn":2},"tcbDate":"2023-08-09T00:00:00Z","tcbStatus":"OutOfDate"}]}],"tcbLevels":[{"tcb":{"sgxtcbcomponents":[{"svn":2,"category":"BIOS","type":"Early Microcode Update"},{"svn":2,"category":"OS/VMM","type":"SGX Late Microcode Update"},{"svn":2,"category":"OS/VMM","type":"TXT SINIT"},{"svn":2,"category":"BIOS"},{"svn":3,"category":"BIOS"},{"svn":1,"category":"BIOS"},{"svn":0},{"svn":5,"category":"OS/VMM","type":"SEAMLDR ACM"},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0}],"pcesvn":13,"tdxtcbcomponents":[{"svn":5,"category":"OS/VMM","type":"TDX Module"},{"svn":0,"category":"OS/VMM","type":"TDX Module"},{"svn":2,"category":"OS/VMM","type":"TDX Late Microcode Update"},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0}]},"tcbDate":"2024-03-13T00:00:00Z","tcbStatus":"UpToDate"},{"tcb":{"sgxtcbcomponents":[{"svn":2,"category":"BIOS","type":"Early Microcode Update"},{"svn":2,"category":"OS/VMM","type":"SGX Late Microcode Update"},{"svn":2,"category":"OS/VMM","type":"TXT SINIT"},{"svn":2,"category":"BIOS"},{"svn":3,"category":"BIOS"},{"svn":1,"category":"BIOS"},{"svn":0},{"svn":5,"category":"OS/VMM","type":"SEAMLDR ACM"},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0}],"pcesvn":5,"tdxtcbcomponents":[{"svn":5,"category":"OS/VMM","type":"TDX Module"},{"svn":0,"category":"OS/VMM","type":"TDX Module"},{"svn":2,"category":"OS/VMM","type":"TDX Late Microcode Update"},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0},{"svn":0}]},"tcbDate":"2018-01-04T00:00:00Z","tcbStatus":"OutOfDate","advisoryIDs":["INTEL-SA-00106","INTEL-SA-00115","INTEL-SA-00135","INTEL-SA-00203","INTEL-SA-00220","INTEL-SA-00233","INTEL-SA-00270","INTEL-SA-00293","INTEL-SA-00320","INTEL-SA-00329","INTEL-SA-00381","INTEL-SA-00389","INTEL-SA-00477","INTEL-SA-00837"]}]},"signature":"c1b19da64b40db0d7dec11e37691e1e585a82379b1fc50d11c830418d6d12d4b7d5fe3fb761c55d173194a206fa8ae24f5ccbc62b8e1f2603d79b49535766908"} -------------------------------------------------------------------------------- /tdx/src/device.rs: -------------------------------------------------------------------------------- 1 | use crate::error::Result; 2 | use crate::utils::generate_random_data; 3 | use coco_provider::{ 4 | coco::{CocoDeviceType, ReportRequest}, 5 | get_coco_provider, CocoProvider, 6 | }; 7 | use dcap_rs::types::quotes::version_4::QuoteV4; 8 | use serde::Deserialize; 9 | 10 | const IMDS_QUOTE_URL: &str = "http://169.254.169.254/acc/tdquote"; 11 | 12 | pub struct DeviceOptions { 13 | /// 64 bytes of data to use for the request 14 | /// Only applicable when the device is configfs or legacy. 15 | /// If the device is a TPM, the report_data will be provided by the device instead. 16 | /// Defaults to randomly generating 64 bytes if `None` provided. 17 | pub report_data: Option<[u8; 64]>, 18 | } 19 | pub struct Device { 20 | options: DeviceOptions, 21 | provider: CocoProvider, 22 | } 23 | 24 | #[derive(Clone, Debug, Deserialize)] 25 | struct QuoteResponse { 26 | quote: String, 27 | } 28 | 29 | impl Device { 30 | pub fn default() -> Result { 31 | let options = DeviceOptions { report_data: None }; 32 | let provider = get_coco_provider()?; 33 | if provider.device_type == CocoDeviceType::Mock { 34 | return Err("Mock device is not supported!".into()); 35 | } 36 | Ok(Device { options, provider }) 37 | } 38 | 39 | pub fn new(options: DeviceOptions) -> Result { 40 | let provider = get_coco_provider()?; 41 | if provider.device_type == CocoDeviceType::Mock { 42 | return Err("Mock device is not supported!".into()); 43 | } 44 | Ok(Device { options, provider }) 45 | } 46 | 47 | pub fn get_attestation_report(&self) -> Result<(QuoteV4, Option>)> { 48 | let (raw_report, var_data) = self.get_attestation_report_raw()?; 49 | Ok((QuoteV4::from_bytes(&raw_report), var_data)) 50 | } 51 | 52 | pub fn get_attestation_report_raw(&self) -> Result<(Vec, Option>)> { 53 | let report_data = match self.provider.device_type { 54 | CocoDeviceType::Tpm => { 55 | if !self.options.report_data.is_none() { 56 | return Err("report_data cannot be provided for TPM!".into()); 57 | } 58 | None 59 | } 60 | _ => self.options.report_data.or_else(generate_random_data), 61 | }; 62 | let req = ReportRequest { 63 | report_data, 64 | vmpl: None, 65 | }; 66 | let response = self.provider.device.get_report(&req)?; 67 | // If the provider is a TPM, we still need to turn the td_report into a signed quote. 68 | // This can be done by sending the td_report to the IMDS. 69 | if self.provider.device_type == CocoDeviceType::Tpm { 70 | // Get the quote from the IMDS. 71 | let td_report = response.report; 72 | let quote_response: QuoteResponse = ureq::post(IMDS_QUOTE_URL) 73 | .send_json(ureq::json!({ 74 | "report": base64_url::encode(&td_report), 75 | }))? 76 | .into_json()?; 77 | let quote = base64_url::decode("e_response.quote)?; 78 | return Ok((quote, response.var_data)); 79 | } 80 | // Otherwise we can just return the quote from the TPM as it is. 81 | Ok((response.report, response.var_data)) 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /zk/risc0/host/data/pck_platform_crl.hex: -------------------------------------------------------------------------------- 1 | 30820a6230820a08020101300a06082a8648ce3d04030230703122302006035504030c19496e74656c205347582050434b20506c6174666f726d204341311a3018060355040a0c11496e74656c20436f72706f726174696f6e3114301206035504070c0b53616e746120436c617261310b300906035504080c024341310b3009060355040613025553170d3235303630343039313933315a170d3235303730343039313933315a30820934303302146fc34e5023e728923435d61aa4b83c618166ad35170d3235303630343039313933315a300c300a0603551d1504030a01013034021500efae6e9715fca13b87e333e8261ed6d990a926ad170d3235303630343039313933315a300c300a0603551d1504030a01013034021500fd608648629cba73078b4d492f4b3ea741ad08cd170d3235303630343039313933315a300c300a0603551d1504030a010130340215008af924184e1d5afddd73c3d63a12f5e8b5737e56170d3235303630343039313933315a300c300a0603551d1504030a01013034021500b1257978cfa9ccdd0759abf8c5ca72fae3a78a9b170d3235303630343039313933315a300c300a0603551d1504030a01013033021474fea614a972be0e2843f2059835811ed872f9b3170d3235303630343039313933315a300c300a0603551d1504030a01013034021500f9c4ef56b3ab48d577e108baedf4bf88014214b9170d3235303630343039313933315a300c300a0603551d1504030a010130330214071de0778f9e5fc4f2878f30d6b07c9a30e6b30b170d3235303630343039313933315a300c300a0603551d1504030a01013034021500cde2424f972cea94ff239937f4d80c25029dd60b170d3235303630343039313933315a300c300a0603551d1504030a0101303302146c3319e5109b64507d3cf1132ce00349ef527319170d3235303630343039313933315a300c300a0603551d1504030a01013034021500df08d756b66a7497f43b5bb58ada04d3f4f7a937170d3235303630343039313933315a300c300a0603551d1504030a01013033021428af485b6cf67e409a39d5cb5aee4598f7a8fa7b170d3235303630343039313933315a300c300a0603551d1504030a01013034021500fb8b2daec092cada8aa9bc4ff2f1c20d0346668c170d3235303630343039313933315a300c300a0603551d1504030a01013034021500cd4850ac52bdcc69a6a6f058c8bc57bbd0b5f864170d3235303630343039313933315a300c300a0603551d1504030a01013034021500994dd3666f5275fb805f95dd02bd50cb2679d8ad170d3235303630343039313933315a300c300a0603551d1504030a0101303302140702136900252274d9035eedf5457462fad0ef4c170d3235303630343039313933315a300c300a0603551d1504030a01013033021461f2bf73e39b4e04aa27d801bd73d24319b5bf80170d3235303630343039313933315a300c300a0603551d1504030a0101303302143992be851b96902eff38959e6c2eff1b0651a4b5170d3235303630343039313933315a300c300a0603551d1504030a0101303302140fda43a00b68ea79b7c2deaeac0b498bdfb2af90170d3235303630343039313933315a300c300a0603551d1504030a010130330214639f139a5040fdcff191e8a4fb1bf086ed603971170d3235303630343039313933315a300c300a0603551d1504030a01013034021500959d533f9249dc1e513544cdc830bf19b7f1f301170d3235303630343039313933315a300c300a0603551d1504030a0101303302147ae37748a9f912f4c63ba7ab07c593ce1d1d1181170d3235303630343039313933315a300c300a0603551d1504030a01013033021413884b33269938c195aa170fca75da177538df0b170d3235303630343039313933315a300c300a0603551d1504030a0101303402150085d3c9381b77a7e04d119c9e5ad6749ff3ffab87170d3235303630343039313933315a300c300a0603551d1504030a0101303402150093887ca4411e7a923bd1fed2819b2949f201b5b4170d3235303630343039313933315a300c300a0603551d1504030a0101303302142498dc6283930996fd8bf23a37acbe26a3bed457170d3235303630343039313933315a300c300a0603551d1504030a010130340215008a66f1a749488667689cc3903ac54c662b712e73170d3235303630343039313933315a300c300a0603551d1504030a01013034021500afc13610bdd36cb7985d106481a880d3a01fda07170d3235303630343039313933315a300c300a0603551d1504030a01013034021500efe04b2c33d036aac96ca673bf1e9a47b64d5cbb170d3235303630343039313933315a300c300a0603551d1504030a0101303402150083d9ac8d8bb509d1c6c809ad712e8430559ed7f3170d3235303630343039313933315a300c300a0603551d1504030a0101303302147931fd50b5071c1bbfc5b7b6ded8b45b9d8b8529170d3235303630343039313933315a300c300a0603551d1504030a0101303302141fa20e2970bde5d57f7b8ddf8339484e1f1d0823170d3235303630343039313933315a300c300a0603551d1504030a0101303302141e87b2c3b32d8d23e411cef34197b95af0c8adf5170d3235303630343039313933315a300c300a0603551d1504030a010130340215009afd2ee90a473550a167d996911437c7502d1f09170d3235303630343039313933315a300c300a0603551d1504030a0101303302144481b0f11728a13b696d3ea9c770a0b15ec58dda170d3235303630343039313933315a300c300a0603551d1504030a01013034021500a7859f57982ef0e67d37bc8ef2ef5ac835ff1aa9170d3235303630343039313933315a300c300a0603551d1504030a010130340215009d67753b81e47090aea763fbec4c4549bcdb9933170d3235303630343039313933315a300c300a0603551d1504030a01013033021434bfbb7a1d9c568147e118b614f7b76ed3ef68df170d3235303630343039313933315a300c300a0603551d1504030a0101303302142c3cc6fe9279db1516d5ce39f2a898cda5a175e1170d3235303630343039313933315a300c300a0603551d1504030a010130330214717948687509234be979e4b7dce6f31bef64b68c170d3235303630343039313933315a300c300a0603551d1504030a010130340215009d76ef2c39c136e8658b6e7396b1d7445a27631f170d3235303630343039313933315a300c300a0603551d1504030a01013034021500c3e025fca995f36f59b48467939e3e34e6361a6f170d3235303630343039313933315a300c300a0603551d1504030a010130340215008c5f6b3257da05b17429e2e61ba965d67330606a170d3235303630343039313933315a300c300a0603551d1504030a01013034021500a17c51722ec1e0c3278fe8bdf052059cbec4e648170d3235303630343039313933315a300c300a0603551d1504030a0101a02f302d300a0603551d140403020101301f0603551d23041830168014956f5dcdbd1be1e94049c9d4f433ce01570bde54300a06082a8648ce3d0403020348003045022100c660c13d1c03e0c07e2fe2ae59fad9c6f06e6751babf526a23e40cffe978d46802206754f660e28572a046484f57e21ef2937a874d54b70e5beb72a13cc51d0b1de9 -------------------------------------------------------------------------------- /zk/sp1/program/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_main] 2 | sp1_zkvm::entrypoint!(main); 3 | 4 | use dcap_rs::types::{ 5 | collaterals::IntelCollateral, quotes::version_3::QuoteV3, quotes::version_4::QuoteV4, 6 | VerifiedOutput, 7 | }; 8 | use dcap_rs::utils::cert::{hash_crl_keccak256, hash_x509_keccak256}; 9 | use dcap_rs::utils::quotes::version_3::verify_quote_dcapv3; 10 | use dcap_rs::utils::quotes::version_4::verify_quote_dcapv4; 11 | use dcap_rs::utils::tcbinfo::{get_tcbinfov2_content_hash, get_tcbinfov3_content_hash}; 12 | use dcap_rs::utils::enclave_identity::get_enclave_identityv2_content_hash; 13 | 14 | pub fn main() { 15 | // Read the input 16 | let input = sp1_zkvm::io::read_vec(); 17 | 18 | // TODO: currently current_time does nothing since it can be spoofed by the host 19 | // we can obtain an attested time from a trusted source that is bound to the input values and verify it 20 | 21 | // deserialize the input 22 | // read the fixed portion first 23 | let current_time: u64 = u64::from_le_bytes(input[..8].try_into().unwrap()); 24 | let quote_len = u32::from_le_bytes(input[8..12].try_into().unwrap()) as usize; 25 | let intel_collaterals_bytes_len = 26 | u32::from_le_bytes(input[12..16].try_into().unwrap()) as usize; 27 | 28 | // read the variable length fields 29 | let mut offset = 16 as usize; // timestamp + quote_len + collateral_len 30 | let quote_slice = &input[offset..offset + quote_len]; 31 | offset += quote_len; 32 | let intel_collaterals_slice = &input[offset..offset + intel_collaterals_bytes_len]; 33 | offset += intel_collaterals_bytes_len; 34 | assert!(offset == input.len()); 35 | 36 | let intel_collaterals = IntelCollateral::from_bytes(&intel_collaterals_slice); 37 | 38 | // check either only platform or processor crls is provided. not both 39 | let sgx_platform_crl_is_found = (&intel_collaterals.get_sgx_pck_platform_crl()).is_some(); 40 | let sgx_processor_crl_is_found = (&intel_collaterals.get_sgx_pck_processor_crl()).is_some(); 41 | assert!( 42 | sgx_platform_crl_is_found != sgx_processor_crl_is_found, 43 | "platform or processor crls only" 44 | ); 45 | 46 | let verified_output: VerifiedOutput; 47 | 48 | let quote_version = u16::from_le_bytes(input[16..18].try_into().unwrap()); 49 | match quote_version { 50 | 3 => { 51 | let quote = QuoteV3::from_bytes("e_slice); 52 | verified_output = verify_quote_dcapv3("e, &intel_collaterals, current_time); 53 | } 54 | 4 => { 55 | let quote = QuoteV4::from_bytes("e_slice); 56 | verified_output = verify_quote_dcapv4("e, &intel_collaterals, current_time); 57 | } 58 | _ => { 59 | panic!("Unsupported quote version"); 60 | } 61 | } 62 | 63 | // write public output to the journal 64 | let serial_output = verified_output.to_bytes(); 65 | 66 | let tcb_content_hash = match quote_version { 67 | 3 => { 68 | let tcb_info_v2 = intel_collaterals.get_tcbinfov2(); 69 | get_tcbinfov2_content_hash(&tcb_info_v2) 70 | }, 71 | 4 => { 72 | let tcb_info_v3 = intel_collaterals.get_tcbinfov3(); 73 | get_tcbinfov3_content_hash(&tcb_info_v3) 74 | }, 75 | _ => panic!("Unsupported Quote Version") 76 | }; 77 | 78 | let qeidentity = intel_collaterals.get_qeidentityv2(); 79 | let qeidentity_content_hash = get_enclave_identityv2_content_hash(&qeidentity); 80 | 81 | let sgx_intel_root_ca_cert_hash = 82 | hash_x509_keccak256(&intel_collaterals.get_sgx_intel_root_ca()); 83 | 84 | let sgx_tcb_signing_cert_hash = hash_x509_keccak256(&intel_collaterals.get_sgx_tcb_signing()); 85 | 86 | let sgx_intel_root_ca_crl_hash = 87 | hash_crl_keccak256(&intel_collaterals.get_sgx_intel_root_ca_crl().unwrap()); 88 | 89 | let sgx_pck_crl; 90 | if sgx_platform_crl_is_found { 91 | sgx_pck_crl = intel_collaterals.get_sgx_pck_platform_crl().unwrap(); 92 | } else { 93 | sgx_pck_crl = intel_collaterals.get_sgx_pck_processor_crl().unwrap(); 94 | } 95 | 96 | let sgx_pck_crl_hash = hash_crl_keccak256(&sgx_pck_crl); 97 | 98 | // the journal output has the following format: 99 | // serial_output_len (2 bytes) 100 | // serial_output (VerifiedOutput) 101 | // current_time (8 bytes) 102 | // tcbinfo_content_hash 103 | // qeidentity_content_hash 104 | // sgx_intel_root_ca_cert_hash 105 | // sgx_tcb_signing_cert_hash 106 | // sgx_tcb_intel_root_ca_crl_hash 107 | // sgx_pck_platform_crl_hash or sgx_pck_processor_crl_hash 108 | let journal_len = serial_output.len() + 226; 109 | let mut output: Vec = Vec::with_capacity(journal_len); 110 | let output_len: u16 = serial_output.len() as u16; 111 | 112 | output.extend_from_slice(&output_len.to_be_bytes()); 113 | output.extend_from_slice(&serial_output); 114 | output.extend_from_slice(¤t_time.to_be_bytes()); 115 | output.extend_from_slice(&tcb_content_hash); 116 | output.extend_from_slice(&qeidentity_content_hash); 117 | output.extend_from_slice(&sgx_intel_root_ca_cert_hash); 118 | output.extend_from_slice(&sgx_tcb_signing_cert_hash); 119 | output.extend_from_slice(&sgx_intel_root_ca_crl_hash); 120 | output.extend_from_slice(&sgx_pck_crl_hash); 121 | 122 | sp1_zkvm::io::commit_slice(&output); 123 | } 124 | -------------------------------------------------------------------------------- /zk/risc0/methods/guest/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_main] 2 | use std::io::Read; 3 | 4 | use risc0_zkvm::guest::env::{self}; 5 | 6 | use dcap_rs::types::{ 7 | collaterals::IntelCollateral, quotes::version_3::QuoteV3, quotes::version_4::QuoteV4, 8 | VerifiedOutput, 9 | }; 10 | use dcap_rs::utils::cert::{hash_crl_keccak256, hash_x509_keccak256}; 11 | use dcap_rs::utils::quotes::version_3::verify_quote_dcapv3; 12 | use dcap_rs::utils::quotes::version_4::verify_quote_dcapv4; 13 | use dcap_rs::utils::tcbinfo::{get_tcbinfov2_content_hash, get_tcbinfov3_content_hash}; 14 | use dcap_rs::utils::enclave_identity::get_enclave_identityv2_content_hash; 15 | 16 | risc0_zkvm::guest::entry!(main); 17 | 18 | fn main() { 19 | // read the values passed from host 20 | let mut input = Vec::new(); 21 | env::stdin().read_to_end(&mut input).unwrap(); 22 | 23 | // TODO: currently current_time does nothing since it can be spoofed by the host 24 | // we can obtain an attested time from a trusted source that is bound to the input values and verify it 25 | 26 | // deserialize the input 27 | // read the fixed portion first 28 | let current_time: u64 = u64::from_le_bytes(input[..8].try_into().unwrap()); 29 | let quote_len = u32::from_le_bytes(input[8..12].try_into().unwrap()) as usize; 30 | let intel_collaterals_bytes_len = 31 | u32::from_le_bytes(input[12..16].try_into().unwrap()) as usize; 32 | 33 | // read the variable length fields 34 | let mut offset = 16 as usize; // timestamp + quote_len + collateral_len 35 | let quote_slice = &input[offset..offset + quote_len]; 36 | offset += quote_len; 37 | let intel_collaterals_slice = &input[offset..offset + intel_collaterals_bytes_len]; 38 | offset += intel_collaterals_bytes_len; 39 | assert!(offset == input.len()); 40 | 41 | let intel_collaterals = IntelCollateral::from_bytes(&intel_collaterals_slice); 42 | 43 | // check either only platform or processor crls is provided. not both 44 | let sgx_platform_crl_is_found = (&intel_collaterals.get_sgx_pck_platform_crl()).is_some(); 45 | let sgx_processor_crl_is_found = (&intel_collaterals.get_sgx_pck_processor_crl()).is_some(); 46 | assert!( 47 | sgx_platform_crl_is_found != sgx_processor_crl_is_found, 48 | "platform or processor crls only" 49 | ); 50 | 51 | let verified_output: VerifiedOutput; 52 | 53 | let quote_version = u16::from_le_bytes(input[16..18].try_into().unwrap()); 54 | match quote_version { 55 | 3 => { 56 | let quote = QuoteV3::from_bytes("e_slice); 57 | verified_output = verify_quote_dcapv3("e, &intel_collaterals, current_time); 58 | } 59 | 4 => { 60 | let quote = QuoteV4::from_bytes("e_slice); 61 | verified_output = verify_quote_dcapv4("e, &intel_collaterals, current_time); 62 | } 63 | _ => { 64 | panic!("Unsupported quote version"); 65 | } 66 | } 67 | 68 | // write public output to the journal 69 | let serial_output = verified_output.to_bytes(); 70 | 71 | let tcb_content_hash = match quote_version { 72 | 3 => { 73 | let tcb_info_v2 = intel_collaterals.get_tcbinfov2(); 74 | get_tcbinfov2_content_hash(&tcb_info_v2) 75 | }, 76 | 4 => { 77 | let tcb_info_v3 = intel_collaterals.get_tcbinfov3(); 78 | get_tcbinfov3_content_hash(&tcb_info_v3) 79 | }, 80 | _ => panic!("Unsupported Quote Version") 81 | }; 82 | 83 | let qeidentity = intel_collaterals.get_qeidentityv2(); 84 | let qeidentity_content_hash = get_enclave_identityv2_content_hash(&qeidentity); 85 | 86 | let sgx_intel_root_ca_cert_hash = 87 | hash_x509_keccak256(&intel_collaterals.get_sgx_intel_root_ca()); 88 | 89 | let sgx_tcb_signing_cert_hash = hash_x509_keccak256(&intel_collaterals.get_sgx_tcb_signing()); 90 | 91 | let sgx_intel_root_ca_crl_hash = 92 | hash_crl_keccak256(&intel_collaterals.get_sgx_intel_root_ca_crl().unwrap()); 93 | 94 | let sgx_pck_crl; 95 | if sgx_platform_crl_is_found { 96 | sgx_pck_crl = intel_collaterals.get_sgx_pck_platform_crl().unwrap(); 97 | } else { 98 | sgx_pck_crl = intel_collaterals.get_sgx_pck_processor_crl().unwrap(); 99 | } 100 | 101 | let sgx_pck_crl_hash = hash_crl_keccak256(&sgx_pck_crl); 102 | 103 | // the journal output has the following format: 104 | // serial_output_len (2 bytes) 105 | // serial_output (VerifiedOutput) 106 | // current_time (8 bytes) 107 | // tcbinfo_content_hash 108 | // qeidentity_content_hash 109 | // sgx_intel_root_ca_cert_hash 110 | // sgx_tcb_signing_cert_hash 111 | // sgx_tcb_intel_root_ca_crl_hash 112 | // sgx_pck_platform_crl_hash or sgx_pck_processor_crl_hash 113 | let journal_len = serial_output.len() + 226; 114 | let mut journal_output: Vec = Vec::with_capacity(journal_len); 115 | let output_len: u16 = serial_output.len() as u16; 116 | 117 | journal_output.extend_from_slice(&output_len.to_be_bytes()); 118 | journal_output.extend_from_slice(&serial_output); 119 | journal_output.extend_from_slice(¤t_time.to_be_bytes()); 120 | journal_output.extend_from_slice(&tcb_content_hash); 121 | journal_output.extend_from_slice(&qeidentity_content_hash); 122 | journal_output.extend_from_slice(&sgx_intel_root_ca_cert_hash); 123 | journal_output.extend_from_slice(&sgx_tcb_signing_cert_hash); 124 | journal_output.extend_from_slice(&sgx_intel_root_ca_crl_hash); 125 | journal_output.extend_from_slice(&sgx_pck_crl_hash); 126 | 127 | env::commit_slice(&journal_output); 128 | } 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | # Automata TDX Attestation SDK 10 | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) 11 | 12 | ## Overview 13 | 14 | Automata TDX Attestation SDK is the most-feature complete SDK for Intel TDX development, it consists of two parts: 15 | 16 | * TDX package: it helps developers to generate the Intel TDX Quote in different cloud service providers (CSP). 17 | * Risc0 and Succinct ZK host and guest programs. 18 | 19 | ### Environment Preparation 20 | Refer to [TDX package](tdx/README.md) to setup the Intel TDX CVM in different cloud service providers (CSP). 21 | 22 | ## Intel TDX Quote Generation 23 | Use [TDX package](tdx/README.md) to generate the Intel TDX Quote, you can find an example in [tdx_attestation](tdx/examples/attestation.rs). 24 | 25 | ## Intel TDX Quote Verification 26 | ### Verify Attestation on-chain 27 | In [Automata DCAP Attestation](https://github.com/automata-network/automata-dcap-attestation), We provide two ways to verify the Intel TDX quote on-chain: 28 | 29 | ```solidity 30 | function verifyAndAttestOnChain(bytes calldata rawQuote) 31 | ``` 32 | It accepts the raw quote hex string to perform the on-chain verification, all collaterals will be fetched from the [Automata on-chain PCCS](https://github.com/automata-network/automata-on-chain-pccs). 33 | 34 | ```solidity 35 | function verifyAndAttestWithZKProof(bytes calldata output, ZkCoProcessorType zkCoprocessor, bytes calldata proofBytes) 36 | ``` 37 | The first parameter represents the output of the zkVM, the second one is the zkVM type, and the third one is its corresponding proof. It supports two kinds of ZK technologies to perform the on-chain verification: 38 | 39 | * [Risc0](https://github.com/risc0/risc0) 40 | - output: the journal of the Risc0 zkVM output 41 | - zkCoprocessor: 1 42 | - proofBytes: the seal of the Risc0 zkVM output 43 | 44 | * [SP1](https://github.com/succinctlabs/sp1) 45 | - output: the execution result of the SP1 Prover output 46 | - zkCoprocessor: 2 47 | - proofBytes: the proof of the SP1 Prover output 48 | 49 | The on-chain verification contract has been deployed to Automata Testnet at [0x95175096a9B74165BE0ac84260cc14Fc1c0EF5FF](https://explorer-testnet.ata.network/address/0x95175096a9B74165BE0ac84260cc14Fc1c0EF5FF). 50 | 51 | The [ImageID](https://dev.risczero.com/terminology#image-id) currently used for the DCAP RiscZero Guest Program is `6f661ba5aaed148dbd2ae6217a47be56b3d713f37c65cc5ea3b006a9525bc807`. 52 | 53 | The [VKEY](https://docs.succinct.xyz/verification/onchain/solidity-sdk.html?#finding-your-program-vkey) currently used for the DCAP SP1 Program is 54 | `0021feaf3f6c78429dac7756fac5cfed39b606e34603443409733e13a1cf06cc`. 55 | 56 | An useful DCAP zkVM clis can be found at [Automata DCAP zkVM CLI](https://github.com/automata-network/automata-dcap-zkvm-cli). 57 | 58 | ### Verify Attestation off-chain 59 | Please follow the Intel official DCAP repo [SGXDataCenterAttestationPrimitives](https://github.com/intel/SGXDataCenterAttestationPrimitives) to perform the off-chain verification. 60 | 61 | ## ZK Optimization 62 | ### Risc0 63 | To get started, you need to have the following installed: 64 | 65 | * [Rust](https://doc.rust-lang.org/cargo/getting-started/installation.html) 66 | * [Foundry](https://getfoundry.sh/) 67 | * [RISC Zero](https://dev.risczero.com/api/zkvm/install) 68 | 69 | #### Configuring Bonsai 70 | 71 | ***Note:*** *To request an API key [complete the form here](https://bonsai.xyz/apply).* 72 | 73 | With the Bonsai proving service, you can produce a [Groth16 SNARK proof] that is verifiable on-chain. 74 | You can get started by setting the following environment variables with your API key and associated URL. 75 | 76 | ```bash 77 | export BONSAI_API_KEY="YOUR_API_KEY" # see form linked above 78 | export BONSAI_API_URL="BONSAI_URL" # provided with your api key 79 | ``` 80 | 81 | ### Succinct 82 | To get started, you need to have the following installed: 83 | 84 | * [Rust](https://doc.rust-lang.org/cargo/getting-started/installation.html) 85 | * [SP1](https://docs.succinct.xyz/getting-started/install.html) 86 | * [Docker](https://docs.docker.com/get-started/get-docker/) 87 | 88 | ***Note:*** *To request an whitelisted address, [complete the form here](https://docs.google.com/forms/d/e/1FAIpQLSd-X9uH7G0bvXH_kjptnQtNil8L4dumrVPpFE4t8Ci1XT1GaQ/viewform).* 89 | 90 | With the SP1 Proving Network, you can produce a [Groth16 SNARK proof] or [Plonk SNARK proof] that is verifiable on-chain. 91 | You can get started by setting the following environment variables with your whitelisted address and associated Proving Network. 92 | 93 | ```bash 94 | export SP1_PROVER=network 95 | export SP1_PRIVATE_KEY="" 96 | ``` 97 | 98 | ## Acknowledgements 99 | We would like to acknowledge the projects below whose previous work has been instrumental in making this project a reality. 100 | 101 | * [Risc0](https://github.com/risc0/risc0): The Risc0 ZK Optimization to reduce the gas cost to verify the Intel TDX Quote on-chain. 102 | * [SP1](https://github.com/succinctlabs/sp1): The Succinct ZK Optimization to reduce the gas cost to verify the Intel TDX Quote on-chain. It supports Groth16 and Plonk proofs. 103 | 104 | ## Disclaimer 105 | This project is under development. All source code and features are not production ready. 106 | -------------------------------------------------------------------------------- /tdx/README.md: -------------------------------------------------------------------------------- 1 | ## Intel TDX Quote Generation SDK 2 | 3 | ## Getting Started 4 | 5 | ### Hardware Requirements 6 | The following cloud service providers (CSP) have support for Intel TDX: 7 | 8 | ### GCP 9 | - Instance Type: c3-standard-* family 10 | - Operating System: containerOS, RHEL0, SLES-15-sp5, Ubuntu 22.04 11 | - Supported Zones: asia-southeast-1-{a,b,c}, europe-west4-{a,b}, us-central1-{a,b,c} 12 | - For more information on supported operating systems, please check out the following article on GCP: [supported configurations](https://cloud.google.com/confidential-computing/confidential-vm/docs/supported-configurations#intel-tdx) 13 | - Currently, TDX enabled VMs can only be created via gcloud or Rest API, please check out this article on how to do so: [create an instance](https://cloud.google.com/confidential-computing/confidential-vm/docs/create-a-confidential-vm-instance#gcloud) 14 | 15 | #### Azure 16 | - Instance Type: DCesv6-series, DCedsv6-series, ECesv6-series, ECedsv6-series 17 | - Operating System: Ubuntu 24.04 Server (Confidential VM)- x64 Gen 2 image, Ubuntu 22.04 Server (Confidential VM) - x64 Gen 2 image. 18 | - Supported Region: West Europe, East US, West US, West US 3 19 | 20 | #### Others 21 | - If you wish to use a CSP that is not listed above or run your own host, please ensure that the CSP or host is running the following specs: 22 | - Linux Kernel >= 6.7 23 | - Virtual Machine (VM) runs under KVM hypervisor 24 | - VM has access to `/sys/kernel/config/tsm/report` and able to create a temporary directory with sudo (eg. `sudo mkdir /sys/kernel/config/tsm/report/testing123`). 25 | > If you receive the error `mkdir: cannot create directory ‘testing123’: No such device or address`, it means that ConfigFS is not supported on your VM. 26 | 27 | ### Download Dependencies 28 | ```bash 29 | sudo apt install build-essential pkg-config libtss2-dev 30 | ``` 31 | ### Getting Started with Rust 32 | 33 | First, install Rust, and select the default toolchain as nightly. 34 | ```bash 35 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 36 | source "$HOME/.cargo/env" 37 | ``` 38 | 39 | To get a quick introduction on how to generate and verify an attestation report, we have an example at `examples/attestation.rs`. To run the example: 40 | ```bash 41 | cargo build --example attestation 42 | sudo ./target/debug/examples/attestation 43 | ``` 44 | The example should successfully generate and verify an attestation report on any TDX enabled virtual machine and display the result on stdout. 45 | 46 | ### Getting Started with Docker 47 | 48 | First, install Docker in your machine, then build the docker image with [Dockerfile](../Dockerfile), or use our pre-built docker images at [packages](https://github.com/automata-network/tdx-attestation-sdk/pkgs/container/tdx-attestation-sdk). 49 | ```bash 50 | docker build -t tdx-attestation . 51 | ``` 52 | The image contains three examples as mentioned in the previous session, and it uses FMSPC as the default entrypoint, you can override it with another when executing the docker container by using `--entrypoint `. 53 | ```bash 54 | sudo docker run --privileged --rm --network host --device=/dev/tpm0 --device=/dev/tpmrm0 -v /sys/kernel/config:/sys/kernel/config --group-add $(getent group tss | cut -d: -f3) tdx-attestation:latest 55 | ``` 56 | 57 | ## Rust API Usage 58 | 59 | ### Initialize Tdx object 60 | 61 | In order to run the next few steps, first initialize a Tdx object: 62 | 63 | ```rust 64 | use tdx::Tdx; 65 | 66 | ... 67 | 68 | 69 | let tdx = Tdx::new(); 70 | ``` 71 | 72 | ### Generate Attestation 73 | To generate an attestation with default options, you can do so like this: 74 | ```rust 75 | let (report, _) = tdx.get_attestation_report()?; 76 | ``` 77 | 78 | If you wish to customise options for the attestation report, you can do something like this: 79 | 80 | ```rust 81 | use tdx::device::DeviceOptions; 82 | 83 | ... 84 | 85 | tdx.get_attestation_report_with_options( 86 | DeviceOptions { 87 | report_data: Some([0; 64]), 88 | } 89 | )?; 90 | ``` 91 | 92 | For details on the struct options, please check out the comments in the struct. 93 | 94 | ### Verify Attestation 95 | #### Verify Attestation on-chain 96 | In [Automata DCAP Attestation](https://github.com/automata-network/automata-dcap-attestation), We provide two ways to verify the Intel TDX quote on-chain: 97 | 98 | ```solidity 99 | function verifyAndAttestOnChain(bytes calldata rawQuote) 100 | ``` 101 | It accepts the raw quote hex string to perform the on-chain verification, all collaterals will be fetched from the [Automata on-chain PCCS](https://github.com/automata-network/automata-on-chain-pccs). 102 | 103 | ```solidity 104 | function verifyAndAttestWithZKProof(bytes calldata output, ZkCoProcessorType zkCoprocessor, bytes calldata proofBytes) 105 | ``` 106 | The first parameter represents the output of the zkVM, the second one is the zkVM type, and the third one is its corresponding proof. It supports two kinds of ZK technologies to perform the on-chain verification: 107 | 108 | * [Risc0](https://github.com/risc0/risc0) 109 | - output: the journal of the Risc0 zkVM output 110 | - zkCoprocessor: 1 111 | - proofBytes: the seal of the Risc0 zkVM output 112 | 113 | * [SP1](https://github.com/succinctlabs/sp1) 114 | - output: the execution result of the SP1 Prover output 115 | - zkCoprocessor: 2 116 | - proofBytes: the proof of the SP1 Prover output 117 | 118 | #### Verify Attestation off-chain 119 | Please follow Intel official DCAP repo [SGXDataCenterAttestationPrimitives](https://github.com/intel/SGXDataCenterAttestationPrimitives) to perform the off-chain verification. 120 | 121 | ## Debug tools 122 | 123 | * `attestation`: It generates and verifies an attestation report on any TDX enabled virtual machine. 124 | ```bash 125 | cargo build --example attestation 126 | sudo ./target/debug/examples/attestation 127 | ``` 128 | * `fmspc`: It fetches the FMSPC in any TDX enabled virtual machine. 129 | ```bash 130 | cargo build --example fmspc 131 | sudo ./target/debug/examples/fmspc 132 | ``` 133 | * `inspect`: Given a SGX / TDX DCAP quote, it analyses the FMSPC, platform and version and prints them on stdout. 134 | ```bash 135 | cargo build --example inspect 136 | sudo ./target/debug/examples/inspect --report tdx/examples/testdata/tdx_v4_quote.bin 137 | sudo ./target/debug/examples/inspect --report tdx/examples/testdata/sgx_v3_quote.bin 138 | ``` 139 | -------------------------------------------------------------------------------- /tdx/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod device; 2 | pub mod error; 3 | pub mod pccs; 4 | pub mod utils; 5 | 6 | use dcap_rs::types::collaterals::IntelCollateral; 7 | use dcap_rs::types::quotes::version_4::QuoteV4; 8 | use dcap_rs::utils::quotes::version_4::verify_quote_dcapv4; 9 | use error::{Result, TdxError}; 10 | use pccs::enclave_id::get_enclave_identity; 11 | use pccs::fmspc_tcb::get_tcb_info; 12 | use pccs::pcs::{get_certificate_by_id, IPCSDao::CA}; 13 | use std::panic; 14 | use tokio::runtime::Runtime; 15 | use utils::get_pck_fmspc_and_issuer; 16 | 17 | pub struct Tdx; 18 | 19 | impl Tdx { 20 | pub fn new() -> Self { 21 | Tdx 22 | } 23 | 24 | /// Retrieve an Attestation Report. 25 | /// 26 | /// Returns: 27 | /// - A tuple containing the attestation report and the optional var data. 28 | /// - The attestation report is a `QuoteV4` struct. 29 | /// - The var data is an optional `Vec` containing the var data. 30 | /// Var data is only available if the device resides on an Azure Confidential VM. 31 | /// Var data provided by Azure can be used to verify the contents of the attestation report's report_data 32 | pub fn get_attestation_report(&self) -> Result<(QuoteV4, Option>)> { 33 | let device = device::Device::default()?; 34 | device.get_attestation_report() 35 | } 36 | 37 | /// Retrieve an Attestation Report with options. 38 | /// When available, users can pass in a 64 byte report data when requesting an attestation report. 39 | /// This cannot be used on Azure Confidential VM. 40 | pub fn get_attestation_report_with_options( 41 | &self, 42 | options: device::DeviceOptions, 43 | ) -> Result<(QuoteV4, Option>)> { 44 | let device = device::Device::new(options)?; 45 | device.get_attestation_report() 46 | } 47 | 48 | /// Retrieve an Attestation Report in raw bytes. 49 | /// 50 | /// Returns: 51 | /// - A tuple containing the attestation report and the optional var data. 52 | /// - The attestation report is raw bytes that can be used with dcap-rs's QuoteV4::from_bytes(). 53 | /// - The var data is an optional `Vec` containing the var data. 54 | /// Var data is only available if the device resides on an Azure Confidential VM. 55 | /// Var data provided by Azure can be used to verify the contents of the attestation report's report_data 56 | pub fn get_attestation_report_raw(&self) -> Result<(Vec, Option>)> { 57 | let device = device::Device::default()?; 58 | device.get_attestation_report_raw() 59 | } 60 | 61 | /// Retrieve an Attestation Report (as raw bytes) with options. 62 | /// When available, users can pass in a 64 byte report data when requesting an attestation report. 63 | /// This cannot be used on Azure Confidential VM. 64 | pub fn get_attestation_report_raw_with_options( 65 | &self, 66 | options: device::DeviceOptions, 67 | ) -> Result<(Vec, Option>)> { 68 | let device = device::Device::new(options)?; 69 | device.get_attestation_report_raw() 70 | } 71 | 72 | /// This function verifies the chain of trust for the attestation report. 73 | pub fn verify_attestation_report(&self, report: &QuoteV4) -> Result<()> { 74 | // First retrieve all the required collaterals. 75 | let rt = Runtime::new().unwrap(); 76 | let (root_ca, root_ca_crl) = rt.block_on(get_certificate_by_id(CA::ROOT))?; 77 | if root_ca.is_empty() || root_ca_crl.is_empty() { 78 | return Err(TdxError::Http("Root CA or CRL is empty".to_string())); 79 | } 80 | 81 | let (fmspc, pck_type) = get_pck_fmspc_and_issuer(report); 82 | // tcb_type: 0: SGX, 1: TDX 83 | // version: TDX uses TcbInfoV3 84 | let tcb_info = rt.block_on(get_tcb_info(1, &fmspc, 3))?; 85 | 86 | let quote_version = report.header.version; 87 | let qe_identity = rt.block_on(get_enclave_identity(quote_version as u32))?; 88 | 89 | let (signing_ca, _) = rt.block_on(get_certificate_by_id(CA::SIGNING))?; 90 | if signing_ca.is_empty() { 91 | return Err(TdxError::Http("Signing CA is empty".to_string())); 92 | } 93 | 94 | let (_, pck_crl) = rt.block_on(get_certificate_by_id(pck_type))?; 95 | if pck_crl.is_empty() { 96 | return Err(TdxError::Http("PCK CRL is empty".to_string())); 97 | } 98 | 99 | // Pass all the collaterals into a struct for verifying the quote. 100 | let current_time = chrono::Utc::now().timestamp() as u64; 101 | let mut collaterals = IntelCollateral::new(); 102 | 103 | collaterals.set_tcbinfo_bytes(&tcb_info); 104 | collaterals.set_qeidentity_bytes(&qe_identity); 105 | collaterals.set_intel_root_ca_der(&root_ca); 106 | collaterals.set_sgx_tcb_signing_der(&signing_ca); 107 | collaterals.set_sgx_intel_root_ca_crl_der(&root_ca_crl); 108 | match pck_type { 109 | CA::PLATFORM => { 110 | collaterals.set_sgx_platform_crl_der(&pck_crl); 111 | } 112 | CA::PROCESSOR => { 113 | collaterals.set_sgx_processor_crl_der(&pck_crl); 114 | } 115 | _ => { 116 | return Err(TdxError::Http("Unknown PCK Type".to_string())); 117 | } 118 | } 119 | 120 | match panic::catch_unwind(|| verify_quote_dcapv4(report, &collaterals, current_time)) { 121 | Ok(_) => Ok(()), 122 | Err(e) => Err(TdxError::Dcap(format!("DCAP Error: {:?}", e))), 123 | } 124 | } 125 | } 126 | 127 | #[cfg(feature = "clib")] 128 | pub mod c { 129 | use once_cell::sync::Lazy; 130 | use std::ptr::copy_nonoverlapping; 131 | use std::sync::Mutex; 132 | 133 | use super::device::DeviceOptions; 134 | use super::Tdx; 135 | 136 | static ATTESTATION_REPORT: Lazy>> = Lazy::new(|| Mutex::new(Vec::new())); 137 | static VAR_DATA: Lazy>> = Lazy::new(|| Mutex::new(Vec::new())); 138 | 139 | /// Use this function to generate the attestation report with default settings. 140 | /// Returns the size of the report, which you can use to malloc a buffer of suitable size 141 | /// before you call get_attestation_report_raw(). 142 | #[no_mangle] 143 | pub extern "C" fn tdx_generate_attestation_report() -> usize { 144 | let tdx = Tdx::new(); 145 | 146 | let (report_bytes, var_data) = tdx.get_attestation_report_raw().unwrap(); 147 | let report_len = report_bytes.len(); 148 | let var_data_len = var_data.as_ref().map_or(0, |v| v.len()); 149 | match ATTESTATION_REPORT.lock() { 150 | Ok(mut t) => { 151 | *t = report_bytes; 152 | } 153 | Err(e) => { 154 | panic!("Error: {:?}", e); 155 | } 156 | } 157 | 158 | if var_data_len > 0 { 159 | match VAR_DATA.lock() { 160 | Ok(mut t) => { 161 | *t = var_data.unwrap(); 162 | } 163 | Err(e) => { 164 | panic!("Error: {:?}", e); 165 | } 166 | } 167 | } 168 | report_len 169 | } 170 | 171 | /// Use this function to generate the attestation report with options. 172 | /// Returns the size of the report, which you can use to malloc a buffer of suitable size 173 | /// before you call get_attestation_report_raw(). 174 | #[no_mangle] 175 | pub extern "C" fn tdx_generate_attestation_report_with_options(report_data: *mut u8) -> usize { 176 | let tdx = Tdx::new(); 177 | let mut rust_report_data: [u8; 64] = [0; 64]; 178 | unsafe { 179 | copy_nonoverlapping(report_data, rust_report_data.as_mut_ptr(), 64); 180 | } 181 | let device_options = DeviceOptions { 182 | report_data: Some(rust_report_data), 183 | }; 184 | let (report_bytes, var_data) = tdx 185 | .get_attestation_report_raw_with_options(device_options) 186 | .unwrap(); 187 | let report_len = report_bytes.len(); 188 | let var_data_len = var_data.as_ref().map_or(0, |v| v.len()); 189 | match ATTESTATION_REPORT.lock() { 190 | Ok(mut t) => { 191 | *t = report_bytes; 192 | } 193 | Err(e) => { 194 | panic!("Error: {:?}", e); 195 | } 196 | } 197 | 198 | if var_data_len > 0 { 199 | match VAR_DATA.lock() { 200 | Ok(mut t) => { 201 | *t = var_data.unwrap(); 202 | } 203 | Err(e) => { 204 | panic!("Error: {:?}", e); 205 | } 206 | } 207 | } 208 | report_len 209 | } 210 | 211 | /// Ensure that generate_attestation_report() is called first to get the size of buf. 212 | /// Use this size to malloc enough space for the attestation report that will be transferred. 213 | #[no_mangle] 214 | pub extern "C" fn tdx_get_attestation_report_raw(buf: *mut u8) { 215 | let bytes = match ATTESTATION_REPORT.lock() { 216 | Ok(t) => t.clone(), 217 | Err(e) => { 218 | panic!("Error: {:?}", e); 219 | } 220 | }; 221 | if bytes.len() == 0 { 222 | panic!("Error: No attestation report found! Please call generate_attestation_report() first."); 223 | } 224 | 225 | unsafe { 226 | copy_nonoverlapping(bytes.as_ptr(), buf, bytes.len()); 227 | } 228 | } 229 | 230 | /// Retrieve the length of var_data. Please call this only after you have called 231 | /// generate_attestation_report(). If var_data is empty, this function will return 0. 232 | #[no_mangle] 233 | pub extern "C" fn tdx_get_var_data_len() -> usize { 234 | let length = match VAR_DATA.lock() { 235 | Ok(t) => t.len(), 236 | Err(e) => { 237 | panic!("Error: {:?}", e); 238 | } 239 | }; 240 | length 241 | } 242 | 243 | /// Retrieve var_data. Please call this only after you have called 244 | /// get_var_data_len() to malloc a buffer of an appropriate size. 245 | #[no_mangle] 246 | pub extern "C" fn tdx_get_var_data(buf: *mut u8) { 247 | let bytes = match VAR_DATA.lock() { 248 | Ok(t) => t.clone(), 249 | Err(e) => { 250 | panic!("Error: {:?}", e); 251 | } 252 | }; 253 | if bytes.len() == 0 { 254 | panic!("Error: No var data found! Please call generate_attestation_report() first."); 255 | } 256 | 257 | unsafe { 258 | copy_nonoverlapping(bytes.as_ptr(), buf, bytes.len()); 259 | } 260 | } 261 | } 262 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /zk/sp1/script/src/bin/dcap.rs: -------------------------------------------------------------------------------- 1 | use dcap_rs::types::{collaterals::IntelCollateral, VerifiedOutput}; 2 | use sp1_sdk::{utils, HashableKey, ProverClient, SP1Stdin, include_elf}; 3 | 4 | pub const DCAP_ELF: &[u8] = include_elf!("dcap-sp1-guest-program"); 5 | 6 | fn main() { 7 | utils::setup_logger(); 8 | 9 | let v4_quote = hex::decode("040002008100000000000000939a7233f79c4ca9940a0db3957f060728fa333a41ec7e302625d24f400f3f2400000000040102000000000000000000000000009790d89a10210ec6968a773cee2ca05b5aa97309f36727a968527be4606fc19e6f73acce350946c9d46a9bf7a63f843000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000080e702060000000000f2dd2696f69b950645832bdc095ffd11247eeff687eeacdb57a58d2ddb9a9f94fea40c961e19460c00ffa31420ecbc180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000998204508d58dcbfebe5e11c48669f7a921ac2da744dfb7d014ecdff2acdff1c9f665fdad52aadacf296a1df9909eb2383d100224f1716aeb431f7cb3cf028197dbd872487f27b0f6329ab17647dc9953c7014109818634f879e6550bc60f93eecfc42ff4d49278bfdbb0c77e570f4490cff10a2ee1ac11fbd2c2b49fa6cfa3cf1a1cb755c72522dd8a689e9d47906a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000278e753482976c8a7351fe2113609c7350d491cdae3d449eefc202fa41b2ad6840239cc2ba084c2d594b4e6dabeae0fcbf71c96daf0d0c9ecf0e9810c0457900cc10000079d2386455606243552b2b6f5d04ce8b99657b8b9bf25e348b925805f5c4ae2cc1e5ccff090592bb5e55ce99be1693ba9b67cc879d6fd1b0edc9524d161b2ca97aac15abe68a4571ae7d0d0de5765ecb2b76c89890e38a66fd861e76f2608e40fdf39a81de66f69bdc7ab862b59fac83dbdc28162b3b002c55b963578aa6e33b0600461000000202181a03ff0005000000000000000000000000000000000000000000000000000000000000000000000000000000001500000000000000e70000000000000086fc4e0ec2c5ddcebac97062c0a0142a97c18a7a755147bcbc3fe17d6529781d0000000000000000000000000000000000000000000000000000000000000000dc9e2a7c6f948f17474e34a7fc43ed030f7c1563f1babddf6340c82e0e54a8c50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099cb765d61aa180a03b3b47f229cdaf6f637878298f7cabb4ac0d3b8cadb2a4d000000000000000000000000000000000000000000000000000000000000000029412e75597cda6a12e47037f72b5aa49e3380698d7d838099da88f3854de1c5c147bd31ca67804aa1f04773c9450a27da34de6ca7f4c7f55dc393532ee92fa12000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f05005e0e00002d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d49494538444343424a616741774942416749554554536676464e524551574669324759572b506b34684b2f35596b77436759494b6f5a497a6a3045417749770a634445694d434147413155454177775a535735305a577767553064594946424453794251624746305a6d397962534244515445614d42674741315545436777520a535735305a577767513239796347397959585270623234784644415342674e564241634d43314e68626e526849454e7359584a684d51737743515944565151490a44414a445154454c4d416b474131554542684d4356564d774868634e4d6a51774e4449354d6a45314d6a49315768634e4d7a45774e4449354d6a45314d6a49310a576a42774d534977494159445651514444426c4a626e526c624342545231676755454e4c49454e6c636e52705a6d6c6a5958526c4d526f77474159445651514b0a4442464a626e526c6243424462334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e560a4241674d416b4e424d517377435159445651514745774a56557a425a4d424d4742797147534d34394167454743437147534d343941774548413049414244456f0a55684e526c5830545a54707071637338316838374d35684c2f6f7356654d53512b594e506636497961476e6c4e5a704a384b713657414d2f304565643554474c0a623053564a566e7372716e5362674f343071716a67674d4d4d4949444344416642674e5648534d4547444157674253566231334e765276683655424a796454300a4d383442567776655644427242674e56485238455a4442694d47436758714263686c706f64485277637a6f764c32467761533530636e567a6447566b633256790a646d6c6a5a584d75615735305a577775593239744c334e6e6543396a5a584a3061575a7059324630615739754c3359304c33426a61324e796244396a595431770a624746305a6d397962535a6c626d4e765a476c755a7a316b5a584977485159445652304f424259454645346b4a624b444e64644f717933447779394d55744e640a6a5878694d41344741315564447745422f775145417749477744414d42674e5648524d4241663845416a41414d4949434f51594a4b6f5a496876684e415130420a424949434b6a4343416959774867594b4b6f5a496876684e41513042415151516978544b4d66734f6c6b6d4742492b7a747a6c4a647a434341574d47436971470a534962345451454e41514977676746544d42414743797147534962345451454e41514942416745434d42414743797147534962345451454e41514943416745430a4d42414743797147534962345451454e41514944416745434d42414743797147534962345451454e41514945416745434d42414743797147534962345451454e0a41514946416745444d42414743797147534962345451454e41514947416745424d42414743797147534962345451454e41514948416745414d424147437971470a534962345451454e41514949416745444d42414743797147534962345451454e4151494a416745414d42414743797147534962345451454e4151494b416745410a4d42414743797147534962345451454e4151494c416745414d42414743797147534962345451454e4151494d416745414d42414743797147534962345451454e0a4151494e416745414d42414743797147534962345451454e4151494f416745414d42414743797147534962345451454e41514950416745414d424147437971470a534962345451454e41514951416745414d42414743797147534962345451454e415149524167454e4d42384743797147534962345451454e41514953424241430a41674943417745414177414141414141414141414d42414743697147534962345451454e41514d45416741414d42514743697147534962345451454e415151450a42704441627741414144415042676f71686b69472b45304244514546436745424d42344743697147534962345451454e41515945454a6a4973754b2f6349456f0a42317249566e3247765677775241594b4b6f5a496876684e41513042427a41324d42414743797147534962345451454e415163424151482f4d424147437971470a534962345451454e415163434151482f4d42414743797147534962345451454e415163444151482f4d416f4743437147534d343942414d43413067414d4555430a4946474853786344784143755051754d6c7a653277512f78463949624b354a37376368784a614f6c41537a5441694541725a6d4c62344f4643526c376a4478570a482b4c4554662b71386d62523433597645496d736b42476a4a576f3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436c6a4343416a32674177494241674956414a567658633239472b487051456e4a3150517a7a674658433935554d416f4743437147534d343942414d430a4d476778476a415942674e5642414d4d45556c756447567349464e48574342536232393049454e424d526f77474159445651514b4442464a626e526c624342440a62334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e564241674d416b4e424d5173770a435159445651514745774a56557a4165467730784f4441314d6a45784d4455774d5442614677307a4d7a41314d6a45784d4455774d5442614d484178496a41670a42674e5642414d4d47556c756447567349464e4857434251513073675547786864475a76636d306751304578476a415942674e5642416f4d45556c75644756730a49454e76636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b474131554543417743513045780a437a414a42674e5642415954416c56544d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a304441516344516741454e53422f377432316c58534f0a3243757a7078773734654a423732457944476757357258437478327456544c7136684b6b367a2b5569525a436e71523770734f766771466553786c6d546c4a6c0a65546d693257597a33714f42757a43427544416642674e5648534d4547444157674251695a517a575770303069664f44744a5653763141624f536347724442530a42674e5648523845537a424a4d45656752614244686b466f64485277637a6f764c324e6c636e52705a6d6c6a5958526c63793530636e567a6447566b633256790a646d6c6a5a584d75615735305a577775593239744c306c756447567355306459556d397664454e424c6d526c636a416442674e5648513445466751556c5739640a7a62306234656c4153636e553944504f4156634c336c517744675944565230504151482f42415144416745474d42494741315564457745422f7751494d4159420a4166384341514177436759494b6f5a497a6a30454177494452774177524149675873566b6930772b6936565947573355462f32327561586530594a446a3155650a6e412b546a44316169356343494359623153416d4435786b66545670766f34556f79695359787244574c6d5552344349394e4b7966504e2b0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436a7a4343416a53674177494241674955496d554d316c71644e496e7a6737535655723951477a6b6e42717777436759494b6f5a497a6a3045417749770a614445614d4267474131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e760a636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a0a42674e5642415954416c56544d423458445445344d4455794d5445774e4455784d466f58445451354d54497a4d54497a4e546b314f566f77614445614d4267470a4131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e76636e4276636d46300a615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a42674e56424159540a416c56544d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a3044415163445167414543366e45774d4449595a4f6a2f69505773437a61454b69370a314f694f534c52466857476a626e42564a66566e6b59347533496a6b4459594c304d784f346d717379596a6c42616c54565978465032734a424b357a6c4b4f420a757a43427544416642674e5648534d4547444157674251695a517a575770303069664f44744a5653763141624f5363477244425342674e5648523845537a424a0a4d45656752614244686b466f64485277637a6f764c324e6c636e52705a6d6c6a5958526c63793530636e567a6447566b63325679646d6c6a5a584d75615735300a5a577775593239744c306c756447567355306459556d397664454e424c6d526c636a416442674e564851344546675155496d554d316c71644e496e7a673753560a55723951477a6b6e4271777744675944565230504151482f42415144416745474d42494741315564457745422f7751494d4159424166384341514577436759490a4b6f5a497a6a3045417749445351417752674968414f572f35516b522b533943695344634e6f6f774c7550524c735747662f59693747535839344267775477670a41694541344a306c72486f4d732b586f356f2f7358364f39515778485241765a55474f6452513763767152586171493d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); 10 | 11 | let mut intel_collaterals = IntelCollateral::new(); 12 | intel_collaterals.set_tcbinfo_bytes(include_bytes!("../../data/tcbinfo-tdx-v3.json")); 13 | intel_collaterals.set_qeidentity_bytes(include_bytes!("../../data/identity_tdx.json")); 14 | intel_collaterals.set_intel_root_ca_der(include_bytes!( 15 | "../../data/Intel_SGX_Provisioning_Certification_RootCA.cer" 16 | )); 17 | intel_collaterals.set_sgx_tcb_signing_pem(include_bytes!("../../data/signing_cert.pem")); 18 | intel_collaterals 19 | .set_sgx_intel_root_ca_crl_der(include_bytes!("../../data/intel_root_ca_crl.der")); 20 | intel_collaterals.set_sgx_platform_crl_der(include_bytes!("../../data/pck_platform_crl.der")); 21 | 22 | let intel_collaterals_bytes = intel_collaterals.to_bytes(); 23 | 24 | // get current time in seconds since epoch 25 | // let current_time = std::time::SystemTime::now() 26 | // .duration_since(std::time::UNIX_EPOCH) 27 | // .unwrap() 28 | // .as_secs(); 29 | let current_time = 1739589300u64; 30 | let current_time_bytes = current_time.to_le_bytes(); 31 | 32 | // ZL: perform a simple serialization of the inputs 33 | // [current_time: u64][quote_len: u32][intel_collaterals_len: u32][quote: var][intel_collaterals: var] 34 | let quote_len = v4_quote.len() as u32; 35 | let intel_collaterals_bytes_len = intel_collaterals_bytes.len() as u32; 36 | let total_len = 8 + 4 + 4 + quote_len + intel_collaterals_bytes_len; 37 | 38 | let mut input = Vec::with_capacity(total_len as usize); 39 | input.extend_from_slice(¤t_time_bytes); 40 | input.extend_from_slice("e_len.to_le_bytes()); 41 | input.extend_from_slice(&intel_collaterals_bytes_len.to_le_bytes()); 42 | input.extend_from_slice(&v4_quote); 43 | input.extend_from_slice(&intel_collaterals_bytes); 44 | 45 | let mut stdin = SP1Stdin::new(); 46 | stdin.write_slice(&input); 47 | 48 | let client = ProverClient::from_env(); 49 | 50 | // Execute the program first 51 | let (ret, report) = client.execute(DCAP_ELF, &stdin).run().unwrap(); 52 | println!( 53 | "executed program with {} cycles", 54 | report.total_instruction_count() 55 | ); 56 | // println!("{:?}", report); 57 | 58 | // Generate the proof 59 | let (pk, vk) = client.setup(DCAP_ELF); 60 | // let proof = client.prove(&pk, &stdin).groth16().run().unwrap(); 61 | let proof = client.prove(&pk, &stdin).plonk().run().unwrap(); 62 | 63 | let ret_slice = ret.as_slice(); 64 | let output_len = u16::from_be_bytes([ret_slice[0], ret_slice[1]]) as usize; 65 | let mut output = Vec::with_capacity(output_len); 66 | output.extend_from_slice(&ret_slice[2..2 + output_len]); 67 | 68 | let proof_bytes = proof.bytes(); 69 | 70 | println!("Execution Output: {}", hex::encode(ret_slice)); 71 | println!( 72 | "Proof pub value: {}", 73 | hex::encode(proof.public_values.as_slice()) 74 | ); 75 | println!("VK: {}", vk.bytes32().to_string().as_str()); 76 | println!("Proof: {}", hex::encode(&proof_bytes)); 77 | println!("Proof selector: {}", hex::encode(&proof_bytes[..4])); 78 | 79 | let parsed_output = VerifiedOutput::from_bytes(&output); 80 | println!("{:?}", parsed_output); 81 | 82 | // Verify proof 83 | client.verify(&proof, &vk).expect("Failed to verify proof"); 84 | println!("Successfully verified proof."); 85 | } 86 | -------------------------------------------------------------------------------- /zk/risc0/host/src/main.rs: -------------------------------------------------------------------------------- 1 | // These constants represent the RISC-V ELF and the image ID generated by risc0-build. 2 | // The ELF is used for proving and the ID is used for verification. 3 | use dcap_rs::types::{collaterals::IntelCollateral, VerifiedOutput}; 4 | use methods::{DCAP_GUEST_ELF, DCAP_GUEST_ID}; 5 | use risc0_zkvm::{compute_image_id, default_prover, ExecutorEnv, InnerReceipt, ProverOpts}; 6 | 7 | fn main() { 8 | // Initialize tracing. In order to view logs, run `RUST_LOG=info cargo run` 9 | tracing_subscriber::fmt() 10 | .with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env()) 11 | .init(); 12 | 13 | println!( 14 | "ImageID: {}", 15 | compute_image_id(DCAP_GUEST_ELF).unwrap().to_string() 16 | ); 17 | 18 | // let quote = hex::decode("030002000000000009000e00939a7233f79c4ca9940a0db3957f0607ad04024c9dfb382baf51ca3e5d6cb6e6000000000c0c100fffff0100000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000e700000000000000a4f45c39dac622cb1dd32ddb35a52ec92db41d0fa88a1c911c49e59c534f61cd00000000000000000000000000000000000000000000000000000000000000001bda23eb3a807dfe735ddcebbfa2eac05e04a00df2804296612f770b594180ba0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ca100000e78d2532cbef391dea9a477119bc505b47e187f6f045636cce8bcf41604a099232eee31b3ef3827c442eb5d5981610480deb0625ed4b01c1ac2b0fb43e05efdeab8af342a611fb608193d9a47b8111654172adf2dabd2d428d28ebe094b9baa1f8f7e240b015af174d4f58a6b201946eee2097af02ed554909779ea2d9f3c1020c0c100fffff0100000000000000000000000000000000000000000000000000000000000000000000000000000000001500000000000000e700000000000000192aa50ce1c0cef03ccf89e7b5b16b0d7978f5c2b1edcf774d87702e8154d8bf00000000000000000000000000000000000000000000000000000000000000008c4f5775d796503e96137f77c68a829a0056ac8ded70140b081b094490c57bff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a82754acc7010b3c087c6425ccf47033f711fa44776c6df3cf744864a063657b00000000000000000000000000000000000000000000000000000000000000006cf7ecfde138b32bbf6aec5e260f8bb6277cc2876ea144c3995d2afc0e6baa3525d91884672bf2832c23a6ebf85a165b45af53c836a31168ff7deaec0dd9c82c2000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0500620e00002d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d494945386a4343424a6d674177494241674956414b7750766270377a6f7a50754144646b792b6f526e356f36704d754d416f4743437147534d343942414d430a4d484178496a416742674e5642414d4d47556c756447567349464e4857434251513073675547786864475a76636d306751304578476a415942674e5642416f4d0a45556c756447567349454e76636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155450a4341774351304578437a414a42674e5642415954416c56544d4234584454497a4d4467794e4449784d7a557a4d6c6f5844544d774d4467794e4449784d7a557a0a4d6c6f77634445694d434147413155454177775a535735305a5777675530645949464244537942445a584a3061575a70593246305a5445614d426747413155450a43677752535735305a577767513239796347397959585270623234784644415342674e564241634d43314e68626e526849454e7359584a684d517377435159440a5651514944414a445154454c4d416b474131554542684d4356564d775754415442676371686b6a4f5051494242676771686b6a4f50514d4242774e43414154450a764b6a754b66376969723832686d2b4d5a4151452b6847643349716d53396235634e63484a754b7a5a445970626f35496a344c7a7176704f503830706f4152730a59504233594e355537704d3777644936314b66716f344944446a434341776f77487759445652306a42426777466f41556c5739647a62306234656c4153636e550a3944504f4156634c336c5177617759445652306642475177596a42676f46366758495a616148523063484d364c79396863476b7564484a316333526c5a484e6c0a636e5a705932567a4c6d6c75644756734c6d4e766253397a5a3367765932567964476c6d61574e6864476c76626939324d7939775932746a636d772f593245390a6347786864475a76636d306d5a57356a62325270626d63395a4756794d4230474131556444675157424251695a7667373930317a3171554d3874534c754358580a6571314c6f54414f42674e56485138424166384542414d434273417744415944565230544151482f4241497741444343416a734743537147534962345451454e0a41515343416977776767496f4d42344743697147534962345451454e41514545454358343464705036434c5154772f785543575448306b776767466c42676f710a686b69472b453042445145434d4949425654415142677371686b69472b45304244514543415149424444415142677371686b69472b45304244514543416749420a4444415142677371686b69472b4530424451454341774942417a415142677371686b69472b4530424451454342414942417a415242677371686b69472b4530420a4451454342514943415038774551594c4b6f5a496876684e41513042416759434167442f4d42414743797147534962345451454e41514948416745424d4241470a43797147534962345451454e41514949416745414d42414743797147534962345451454e4151494a416745414d42414743797147534962345451454e4151494b0a416745414d42414743797147534962345451454e4151494c416745414d42414743797147534962345451454e4151494d416745414d42414743797147534962340a5451454e4151494e416745414d42414743797147534962345451454e4151494f416745414d42414743797147534962345451454e41514950416745414d4241470a43797147534962345451454e41514951416745414d42414743797147534962345451454e415149524167454e4d42384743797147534962345451454e415149530a4242414d44414d442f2f38424141414141414141414141414d42414743697147534962345451454e41514d45416741414d42514743697147534962345451454e0a4151514542674267616741414144415042676f71686b69472b45304244514546436745424d42344743697147534962345451454e4151594545424531784169510a72743945363234433159516b497034775241594b4b6f5a496876684e41513042427a41324d42414743797147534962345451454e415163424151482f4d4241470a43797147534962345451454e41516343415145414d42414743797147534962345451454e41516344415145414d416f4743437147534d343942414d43413063410a4d45514349445a6f63514c6478362b4f2b586d4f6b766f6b654133345a617261342b6539534e5877344b68396d5876574169415479695a6e495932474f3466670a4938673342666c4e434f56446e42505270507559377274484e77335470513d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436c6a4343416a32674177494241674956414a567658633239472b487051456e4a3150517a7a674658433935554d416f4743437147534d343942414d430a4d476778476a415942674e5642414d4d45556c756447567349464e48574342536232393049454e424d526f77474159445651514b4442464a626e526c624342440a62334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e564241674d416b4e424d5173770a435159445651514745774a56557a4165467730784f4441314d6a45784d4455774d5442614677307a4d7a41314d6a45784d4455774d5442614d484178496a41670a42674e5642414d4d47556c756447567349464e4857434251513073675547786864475a76636d306751304578476a415942674e5642416f4d45556c75644756730a49454e76636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b474131554543417743513045780a437a414a42674e5642415954416c56544d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a304441516344516741454e53422f377432316c58534f0a3243757a7078773734654a423732457944476757357258437478327456544c7136684b6b367a2b5569525a436e71523770734f766771466553786c6d546c4a6c0a65546d693257597a33714f42757a43427544416642674e5648534d4547444157674251695a517a575770303069664f44744a5653763141624f536347724442530a42674e5648523845537a424a4d45656752614244686b466f64485277637a6f764c324e6c636e52705a6d6c6a5958526c63793530636e567a6447566b633256790a646d6c6a5a584d75615735305a577775593239744c306c756447567355306459556d397664454e424c6d526c636a416442674e5648513445466751556c5739640a7a62306234656c4153636e553944504f4156634c336c517744675944565230504151482f42415144416745474d42494741315564457745422f7751494d4159420a4166384341514177436759494b6f5a497a6a30454177494452774177524149675873566b6930772b6936565947573355462f32327561586530594a446a3155650a6e412b546a44316169356343494359623153416d4435786b66545670766f34556f79695359787244574c6d5552344349394e4b7966504e2b0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436a7a4343416a53674177494241674955496d554d316c71644e496e7a6737535655723951477a6b6e42717777436759494b6f5a497a6a3045417749770a614445614d4267474131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e760a636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a0a42674e5642415954416c56544d423458445445344d4455794d5445774e4455784d466f58445451354d54497a4d54497a4e546b314f566f77614445614d4267470a4131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e76636e4276636d46300a615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a42674e56424159540a416c56544d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a3044415163445167414543366e45774d4449595a4f6a2f69505773437a61454b69370a314f694f534c52466857476a626e42564a66566e6b59347533496a6b4459594c304d784f346d717379596a6c42616c54565978465032734a424b357a6c4b4f420a757a43427544416642674e5648534d4547444157674251695a517a575770303069664f44744a5653763141624f5363477244425342674e5648523845537a424a0a4d45656752614244686b466f64485277637a6f764c324e6c636e52705a6d6c6a5958526c63793530636e567a6447566b63325679646d6c6a5a584d75615735300a5a577775593239744c306c756447567355306459556d397664454e424c6d526c636a416442674e564851344546675155496d554d316c71644e496e7a673753560a55723951477a6b6e4271777744675944565230504151482f42415144416745474d42494741315564457745422f7751494d4159424166384341514577436759490a4b6f5a497a6a3045417749445351417752674968414f572f35516b522b533943695344634e6f6f774c7550524c735747662f59693747535839344267775477670a41694541344a306c72486f4d732b586f356f2f7358364f39515778485241765a55474f6452513763767152586171493d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a00").unwrap(); 19 | 20 | let v4_quote = hex::decode("040002008100000000000000939a7233f79c4ca9940a0db3957f060728fa333a41ec7e302625d24f400f3f2400000000040102000000000000000000000000009790d89a10210ec6968a773cee2ca05b5aa97309f36727a968527be4606fc19e6f73acce350946c9d46a9bf7a63f843000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000080e702060000000000f2dd2696f69b950645832bdc095ffd11247eeff687eeacdb57a58d2ddb9a9f94fea40c961e19460c00ffa31420ecbc180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000998204508d58dcbfebe5e11c48669f7a921ac2da744dfb7d014ecdff2acdff1c9f665fdad52aadacf296a1df9909eb2383d100224f1716aeb431f7cb3cf028197dbd872487f27b0f6329ab17647dc9953c7014109818634f879e6550bc60f93eecfc42ff4d49278bfdbb0c77e570f4490cff10a2ee1ac11fbd2c2b49fa6cfa3cf1a1cb755c72522dd8a689e9d47906a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000278e753482976c8a7351fe2113609c7350d491cdae3d449eefc202fa41b2ad6840239cc2ba084c2d594b4e6dabeae0fcbf71c96daf0d0c9ecf0e9810c0457900cc10000079d2386455606243552b2b6f5d04ce8b99657b8b9bf25e348b925805f5c4ae2cc1e5ccff090592bb5e55ce99be1693ba9b67cc879d6fd1b0edc9524d161b2ca97aac15abe68a4571ae7d0d0de5765ecb2b76c89890e38a66fd861e76f2608e40fdf39a81de66f69bdc7ab862b59fac83dbdc28162b3b002c55b963578aa6e33b0600461000000202181a03ff0005000000000000000000000000000000000000000000000000000000000000000000000000000000001500000000000000e70000000000000086fc4e0ec2c5ddcebac97062c0a0142a97c18a7a755147bcbc3fe17d6529781d0000000000000000000000000000000000000000000000000000000000000000dc9e2a7c6f948f17474e34a7fc43ed030f7c1563f1babddf6340c82e0e54a8c50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099cb765d61aa180a03b3b47f229cdaf6f637878298f7cabb4ac0d3b8cadb2a4d000000000000000000000000000000000000000000000000000000000000000029412e75597cda6a12e47037f72b5aa49e3380698d7d838099da88f3854de1c5c147bd31ca67804aa1f04773c9450a27da34de6ca7f4c7f55dc393532ee92fa12000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f05005e0e00002d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d49494538444343424a616741774942416749554554536676464e524551574669324759572b506b34684b2f35596b77436759494b6f5a497a6a3045417749770a634445694d434147413155454177775a535735305a577767553064594946424453794251624746305a6d397962534244515445614d42674741315545436777520a535735305a577767513239796347397959585270623234784644415342674e564241634d43314e68626e526849454e7359584a684d51737743515944565151490a44414a445154454c4d416b474131554542684d4356564d774868634e4d6a51774e4449354d6a45314d6a49315768634e4d7a45774e4449354d6a45314d6a49310a576a42774d534977494159445651514444426c4a626e526c624342545231676755454e4c49454e6c636e52705a6d6c6a5958526c4d526f77474159445651514b0a4442464a626e526c6243424462334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e560a4241674d416b4e424d517377435159445651514745774a56557a425a4d424d4742797147534d34394167454743437147534d343941774548413049414244456f0a55684e526c5830545a54707071637338316838374d35684c2f6f7356654d53512b594e506636497961476e6c4e5a704a384b713657414d2f304565643554474c0a623053564a566e7372716e5362674f343071716a67674d4d4d4949444344416642674e5648534d4547444157674253566231334e765276683655424a796454300a4d383442567776655644427242674e56485238455a4442694d47436758714263686c706f64485277637a6f764c32467761533530636e567a6447566b633256790a646d6c6a5a584d75615735305a577775593239744c334e6e6543396a5a584a3061575a7059324630615739754c3359304c33426a61324e796244396a595431770a624746305a6d397962535a6c626d4e765a476c755a7a316b5a584977485159445652304f424259454645346b4a624b444e64644f717933447779394d55744e640a6a5878694d41344741315564447745422f775145417749477744414d42674e5648524d4241663845416a41414d4949434f51594a4b6f5a496876684e415130420a424949434b6a4343416959774867594b4b6f5a496876684e41513042415151516978544b4d66734f6c6b6d4742492b7a747a6c4a647a434341574d47436971470a534962345451454e41514977676746544d42414743797147534962345451454e41514942416745434d42414743797147534962345451454e41514943416745430a4d42414743797147534962345451454e41514944416745434d42414743797147534962345451454e41514945416745434d42414743797147534962345451454e0a41514946416745444d42414743797147534962345451454e41514947416745424d42414743797147534962345451454e41514948416745414d424147437971470a534962345451454e41514949416745444d42414743797147534962345451454e4151494a416745414d42414743797147534962345451454e4151494b416745410a4d42414743797147534962345451454e4151494c416745414d42414743797147534962345451454e4151494d416745414d42414743797147534962345451454e0a4151494e416745414d42414743797147534962345451454e4151494f416745414d42414743797147534962345451454e41514950416745414d424147437971470a534962345451454e41514951416745414d42414743797147534962345451454e415149524167454e4d42384743797147534962345451454e41514953424241430a41674943417745414177414141414141414141414d42414743697147534962345451454e41514d45416741414d42514743697147534962345451454e415151450a42704441627741414144415042676f71686b69472b45304244514546436745424d42344743697147534962345451454e41515945454a6a4973754b2f6349456f0a42317249566e3247765677775241594b4b6f5a496876684e41513042427a41324d42414743797147534962345451454e415163424151482f4d424147437971470a534962345451454e415163434151482f4d42414743797147534962345451454e415163444151482f4d416f4743437147534d343942414d43413067414d4555430a4946474853786344784143755051754d6c7a653277512f78463949624b354a37376368784a614f6c41537a5441694541725a6d4c62344f4643526c376a4478570a482b4c4554662b71386d62523433597645496d736b42476a4a576f3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436c6a4343416a32674177494241674956414a567658633239472b487051456e4a3150517a7a674658433935554d416f4743437147534d343942414d430a4d476778476a415942674e5642414d4d45556c756447567349464e48574342536232393049454e424d526f77474159445651514b4442464a626e526c624342440a62334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e564241674d416b4e424d5173770a435159445651514745774a56557a4165467730784f4441314d6a45784d4455774d5442614677307a4d7a41314d6a45784d4455774d5442614d484178496a41670a42674e5642414d4d47556c756447567349464e4857434251513073675547786864475a76636d306751304578476a415942674e5642416f4d45556c75644756730a49454e76636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b474131554543417743513045780a437a414a42674e5642415954416c56544d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a304441516344516741454e53422f377432316c58534f0a3243757a7078773734654a423732457944476757357258437478327456544c7136684b6b367a2b5569525a436e71523770734f766771466553786c6d546c4a6c0a65546d693257597a33714f42757a43427544416642674e5648534d4547444157674251695a517a575770303069664f44744a5653763141624f536347724442530a42674e5648523845537a424a4d45656752614244686b466f64485277637a6f764c324e6c636e52705a6d6c6a5958526c63793530636e567a6447566b633256790a646d6c6a5a584d75615735305a577775593239744c306c756447567355306459556d397664454e424c6d526c636a416442674e5648513445466751556c5739640a7a62306234656c4153636e553944504f4156634c336c517744675944565230504151482f42415144416745474d42494741315564457745422f7751494d4159420a4166384341514177436759494b6f5a497a6a30454177494452774177524149675873566b6930772b6936565947573355462f32327561586530594a446a3155650a6e412b546a44316169356343494359623153416d4435786b66545670766f34556f79695359787244574c6d5552344349394e4b7966504e2b0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436a7a4343416a53674177494241674955496d554d316c71644e496e7a6737535655723951477a6b6e42717777436759494b6f5a497a6a3045417749770a614445614d4267474131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e760a636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a0a42674e5642415954416c56544d423458445445344d4455794d5445774e4455784d466f58445451354d54497a4d54497a4e546b314f566f77614445614d4267470a4131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e76636e4276636d46300a615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a42674e56424159540a416c56544d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a3044415163445167414543366e45774d4449595a4f6a2f69505773437a61454b69370a314f694f534c52466857476a626e42564a66566e6b59347533496a6b4459594c304d784f346d717379596a6c42616c54565978465032734a424b357a6c4b4f420a757a43427544416642674e5648534d4547444157674251695a517a575770303069664f44744a5653763141624f5363477244425342674e5648523845537a424a0a4d45656752614244686b466f64485277637a6f764c324e6c636e52705a6d6c6a5958526c63793530636e567a6447566b63325679646d6c6a5a584d75615735300a5a577775593239744c306c756447567355306459556d397664454e424c6d526c636a416442674e564851344546675155496d554d316c71644e496e7a673753560a55723951477a6b6e4271777744675944565230504151482f42415144416745474d42494741315564457745422f7751494d4159424166384341514577436759490a4b6f5a497a6a3045417749445351417752674968414f572f35516b522b533943695344634e6f6f774c7550524c735747662f59693747535839344267775477670a41694541344a306c72486f4d732b586f356f2f7358364f39515778485241765a55474f6452513763767152586171493d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); 21 | 22 | let mut intel_collaterals = IntelCollateral::new(); 23 | intel_collaterals.set_tcbinfo_bytes(include_bytes!("../data/tcbinfo-tdx-v3.json")); 24 | intel_collaterals.set_qeidentity_bytes(include_bytes!("../data/identity_tdx.json")); 25 | intel_collaterals.set_intel_root_ca_der(include_bytes!( 26 | "../data/Intel_SGX_Provisioning_Certification_RootCA.cer" 27 | )); 28 | intel_collaterals.set_sgx_tcb_signing_der(include_bytes!("../data/signing_cert.der")); 29 | intel_collaterals 30 | .set_sgx_intel_root_ca_crl_der(include_bytes!("../data/intel_root_crl.der")); 31 | intel_collaterals.set_sgx_platform_crl_der(include_bytes!("../data/pck_platform_crl.der")); 32 | 33 | let intel_collaterals_bytes = intel_collaterals.to_bytes(); 34 | 35 | // // get current time in seconds since epoch 36 | // let current_time = std::time::SystemTime::now() 37 | // .duration_since(std::time::UNIX_EPOCH) 38 | // .unwrap() 39 | // .as_secs(); 40 | 41 | let current_time = 1749095100u64; 42 | let current_time_bytes = current_time.to_le_bytes(); 43 | 44 | // ZL: perform a simple serialization of the inputs 45 | // [current_time: u64][quote_len: u32][intel_collaterals_len: u32][quote: var][intel_collaterals: var] 46 | let quote_len = v4_quote.len() as u32; 47 | let intel_collaterals_bytes_len = intel_collaterals_bytes.len() as u32; 48 | let total_len = 8 + 4 + 4 + quote_len + intel_collaterals_bytes_len; 49 | 50 | let mut input = Vec::with_capacity(total_len as usize); 51 | input.extend_from_slice(¤t_time_bytes); 52 | input.extend_from_slice("e_len.to_le_bytes()); 53 | input.extend_from_slice(&intel_collaterals_bytes_len.to_le_bytes()); 54 | input.extend_from_slice(&v4_quote); 55 | input.extend_from_slice(&intel_collaterals_bytes); 56 | 57 | // println!("serialized collaterals: {}", hex::encode(&intel_collaterals_bytes)); 58 | 59 | let env = ExecutorEnv::builder() 60 | .write_slice(input.as_slice()) 61 | .build() 62 | .unwrap(); 63 | 64 | // Obtain the default prover. 65 | let prover = default_prover(); 66 | 67 | let current_time = std::time::Instant::now(); 68 | // Produce a receipt by proving the specified ELF binary. 69 | // let receipt = prover.prove(env, DCAP_GUEST_ELF).unwrap().receipt; 70 | let prover_opts = if std::env::var("BONSAI_API_KEY").is_ok() { 71 | ProverOpts::groth16() 72 | } else { 73 | ProverOpts::default() 74 | }; 75 | let receipt = prover 76 | .prove_with_opts(env, DCAP_GUEST_ELF, &prover_opts) 77 | .unwrap() 78 | .receipt; 79 | let elapsed_time = current_time.elapsed(); 80 | println!("Proving time: {:?}", elapsed_time); 81 | 82 | if let InnerReceipt::Groth16(ref groth16_receipt) = receipt.inner { 83 | println!( 84 | "Groth16 Seal bytes: {}", 85 | hex::encode(groth16_receipt.seal.as_slice()) 86 | ); 87 | println!( 88 | "Output bytes: {}", 89 | hex::encode(receipt.journal.bytes.clone().as_slice()) 90 | ) 91 | } 92 | 93 | // TODO: Implement code for retrieving receipt journal here. 94 | 95 | // Optional: Verify receipt to confirm that recipients will also be able to 96 | // verify your receipt 97 | receipt.verify(DCAP_GUEST_ID).unwrap(); 98 | // For example: 99 | // let _output: Vec = receipt.journal.decode().unwrap(); 100 | let output = receipt.journal.bytes; 101 | 102 | // manually parse the output 103 | let mut offset: usize = 0; 104 | let output_len = u16::from_be_bytes(output[offset..offset + 2].try_into().unwrap()); 105 | offset += 2; 106 | let verified_output = VerifiedOutput::from_bytes(&output[offset..offset + output_len as usize]); 107 | offset += output_len as usize; 108 | let current_time = u64::from_be_bytes(output[offset..offset + 8].try_into().unwrap()); 109 | offset += 8; 110 | let tcbinfo_root_hash = &output[offset..offset + 32]; 111 | offset += 32; 112 | let enclaveidentity_root_hash = &output[offset..offset + 32]; 113 | offset += 32; 114 | let root_cert_hash = &output[offset..offset + 32]; 115 | offset += 32; 116 | let signing_cert_hash = &output[offset..offset + 32]; 117 | offset += 32; 118 | let root_crl_hash = &output[offset..offset + 32]; 119 | offset += 32; 120 | let pck_crl_hash = &output[offset..offset + 32]; 121 | 122 | // println!("Hello, world! I generated a proof of guest execution! \n{:?}.", verified_output); 123 | println!("Verified Output: {:?}", verified_output); 124 | println!("Current time: {}", current_time); 125 | println!("TCB Info Root Hash: {:?}", tcbinfo_root_hash); 126 | println!( 127 | "Enclave Identity Root Hash: {:?}", 128 | enclaveidentity_root_hash 129 | ); 130 | println!("Root Cert Hash: {:?}", root_cert_hash); 131 | println!("Signing Cert Hash: {:?}", signing_cert_hash); 132 | println!("RootCRL Hash: {:?}", root_crl_hash); 133 | println!("PCK CRL Hash: {:?}", pck_crl_hash); 134 | } 135 | -------------------------------------------------------------------------------- /zk/risc0/methods/guest/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.8.11" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 10 | dependencies = [ 11 | "cfg-if", 12 | "once_cell", 13 | "version_check", 14 | "zerocopy", 15 | ] 16 | 17 | [[package]] 18 | name = "allocator-api2" 19 | version = "0.2.21" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" 22 | 23 | [[package]] 24 | name = "alloy-json-abi" 25 | version = "0.8.12" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "b84c506bf264110fa7e90d9924f742f40ef53c6572ea56a0b0bd714a567ed389" 28 | dependencies = [ 29 | "alloy-primitives", 30 | "alloy-sol-type-parser", 31 | "serde", 32 | "serde_json", 33 | ] 34 | 35 | [[package]] 36 | name = "alloy-primitives" 37 | version = "0.8.12" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "9fce5dbd6a4f118eecc4719eaa9c7ffc31c315e6c5ccde3642db927802312425" 40 | dependencies = [ 41 | "alloy-rlp", 42 | "bytes", 43 | "cfg-if", 44 | "const-hex", 45 | "derive_more 1.0.0", 46 | "foldhash", 47 | "hashbrown", 48 | "hex-literal", 49 | "indexmap", 50 | "itoa", 51 | "k256", 52 | "keccak-asm", 53 | "paste", 54 | "proptest", 55 | "rand", 56 | "ruint", 57 | "rustc-hash", 58 | "serde", 59 | "sha3", 60 | "tiny-keccak", 61 | ] 62 | 63 | [[package]] 64 | name = "alloy-rlp" 65 | version = "0.3.9" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" 68 | dependencies = [ 69 | "arrayvec", 70 | "bytes", 71 | ] 72 | 73 | [[package]] 74 | name = "alloy-sol-macro" 75 | version = "0.8.12" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "9343289b4a7461ed8bab8618504c995c049c082b70c7332efd7b32125633dc05" 78 | dependencies = [ 79 | "alloy-sol-macro-expander", 80 | "alloy-sol-macro-input", 81 | "proc-macro-error2", 82 | "proc-macro2", 83 | "quote", 84 | "syn 2.0.87", 85 | ] 86 | 87 | [[package]] 88 | name = "alloy-sol-macro-expander" 89 | version = "0.8.12" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "4222d70bec485ceccc5d8fd4f2909edd65b5d5e43d4aca0b5dcee65d519ae98f" 92 | dependencies = [ 93 | "alloy-sol-macro-input", 94 | "const-hex", 95 | "heck", 96 | "indexmap", 97 | "proc-macro-error2", 98 | "proc-macro2", 99 | "quote", 100 | "syn 2.0.87", 101 | "syn-solidity", 102 | "tiny-keccak", 103 | ] 104 | 105 | [[package]] 106 | name = "alloy-sol-macro-input" 107 | version = "0.8.12" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | checksum = "2e17f2677369571b976e51ea1430eb41c3690d344fef567b840bfc0b01b6f83a" 110 | dependencies = [ 111 | "const-hex", 112 | "dunce", 113 | "heck", 114 | "proc-macro2", 115 | "quote", 116 | "syn 2.0.87", 117 | "syn-solidity", 118 | ] 119 | 120 | [[package]] 121 | name = "alloy-sol-type-parser" 122 | version = "0.8.12" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | checksum = "aa64d80ae58ffaafdff9d5d84f58d03775f66c84433916dc9a64ed16af5755da" 125 | dependencies = [ 126 | "serde", 127 | "winnow", 128 | ] 129 | 130 | [[package]] 131 | name = "alloy-sol-types" 132 | version = "0.8.12" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "6520d427d4a8eb7aa803d852d7a52ceb0c519e784c292f64bb339e636918cf27" 135 | dependencies = [ 136 | "alloy-json-abi", 137 | "alloy-primitives", 138 | "alloy-sol-macro", 139 | "const-hex", 140 | "serde", 141 | ] 142 | 143 | [[package]] 144 | name = "android-tzdata" 145 | version = "0.1.1" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 148 | 149 | [[package]] 150 | name = "android_system_properties" 151 | version = "0.1.5" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 154 | dependencies = [ 155 | "libc", 156 | ] 157 | 158 | [[package]] 159 | name = "anyhow" 160 | version = "1.0.83" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" 163 | 164 | [[package]] 165 | name = "ark-bn254" 166 | version = "0.5.0" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" 169 | dependencies = [ 170 | "ark-ec", 171 | "ark-ff 0.5.0", 172 | "ark-r1cs-std", 173 | "ark-std 0.5.0", 174 | ] 175 | 176 | [[package]] 177 | name = "ark-crypto-primitives" 178 | version = "0.5.0" 179 | source = "registry+https://github.com/rust-lang/crates.io-index" 180 | checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" 181 | dependencies = [ 182 | "ahash", 183 | "ark-crypto-primitives-macros", 184 | "ark-ec", 185 | "ark-ff 0.5.0", 186 | "ark-relations", 187 | "ark-serialize 0.5.0", 188 | "ark-snark", 189 | "ark-std 0.5.0", 190 | "blake2", 191 | "derivative", 192 | "digest 0.10.7", 193 | "fnv", 194 | "merlin", 195 | "sha2", 196 | ] 197 | 198 | [[package]] 199 | name = "ark-crypto-primitives-macros" 200 | version = "0.5.0" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" 203 | dependencies = [ 204 | "proc-macro2", 205 | "quote", 206 | "syn 2.0.87", 207 | ] 208 | 209 | [[package]] 210 | name = "ark-ec" 211 | version = "0.5.0" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" 214 | dependencies = [ 215 | "ahash", 216 | "ark-ff 0.5.0", 217 | "ark-poly", 218 | "ark-serialize 0.5.0", 219 | "ark-std 0.5.0", 220 | "educe", 221 | "fnv", 222 | "hashbrown", 223 | "itertools 0.13.0", 224 | "num-bigint", 225 | "num-integer", 226 | "num-traits", 227 | "zeroize", 228 | ] 229 | 230 | [[package]] 231 | name = "ark-ff" 232 | version = "0.3.0" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" 235 | dependencies = [ 236 | "ark-ff-asm 0.3.0", 237 | "ark-ff-macros 0.3.0", 238 | "ark-serialize 0.3.0", 239 | "ark-std 0.3.0", 240 | "derivative", 241 | "num-bigint", 242 | "num-traits", 243 | "paste", 244 | "rustc_version 0.3.3", 245 | "zeroize", 246 | ] 247 | 248 | [[package]] 249 | name = "ark-ff" 250 | version = "0.4.2" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" 253 | dependencies = [ 254 | "ark-ff-asm 0.4.2", 255 | "ark-ff-macros 0.4.2", 256 | "ark-serialize 0.4.2", 257 | "ark-std 0.4.0", 258 | "derivative", 259 | "digest 0.10.7", 260 | "itertools 0.10.5", 261 | "num-bigint", 262 | "num-traits", 263 | "paste", 264 | "rustc_version 0.4.0", 265 | "zeroize", 266 | ] 267 | 268 | [[package]] 269 | name = "ark-ff" 270 | version = "0.5.0" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" 273 | dependencies = [ 274 | "ark-ff-asm 0.5.0", 275 | "ark-ff-macros 0.5.0", 276 | "ark-serialize 0.5.0", 277 | "ark-std 0.5.0", 278 | "arrayvec", 279 | "digest 0.10.7", 280 | "educe", 281 | "itertools 0.13.0", 282 | "num-bigint", 283 | "num-traits", 284 | "paste", 285 | "zeroize", 286 | ] 287 | 288 | [[package]] 289 | name = "ark-ff-asm" 290 | version = "0.3.0" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" 293 | dependencies = [ 294 | "quote", 295 | "syn 1.0.109", 296 | ] 297 | 298 | [[package]] 299 | name = "ark-ff-asm" 300 | version = "0.4.2" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" 303 | dependencies = [ 304 | "quote", 305 | "syn 1.0.109", 306 | ] 307 | 308 | [[package]] 309 | name = "ark-ff-asm" 310 | version = "0.5.0" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" 313 | dependencies = [ 314 | "quote", 315 | "syn 2.0.87", 316 | ] 317 | 318 | [[package]] 319 | name = "ark-ff-macros" 320 | version = "0.3.0" 321 | source = "registry+https://github.com/rust-lang/crates.io-index" 322 | checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" 323 | dependencies = [ 324 | "num-bigint", 325 | "num-traits", 326 | "quote", 327 | "syn 1.0.109", 328 | ] 329 | 330 | [[package]] 331 | name = "ark-ff-macros" 332 | version = "0.4.2" 333 | source = "registry+https://github.com/rust-lang/crates.io-index" 334 | checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" 335 | dependencies = [ 336 | "num-bigint", 337 | "num-traits", 338 | "proc-macro2", 339 | "quote", 340 | "syn 1.0.109", 341 | ] 342 | 343 | [[package]] 344 | name = "ark-ff-macros" 345 | version = "0.5.0" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" 348 | dependencies = [ 349 | "num-bigint", 350 | "num-traits", 351 | "proc-macro2", 352 | "quote", 353 | "syn 2.0.87", 354 | ] 355 | 356 | [[package]] 357 | name = "ark-groth16" 358 | version = "0.5.0" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" 361 | dependencies = [ 362 | "ark-crypto-primitives", 363 | "ark-ec", 364 | "ark-ff 0.5.0", 365 | "ark-poly", 366 | "ark-relations", 367 | "ark-serialize 0.5.0", 368 | "ark-std 0.5.0", 369 | ] 370 | 371 | [[package]] 372 | name = "ark-poly" 373 | version = "0.5.0" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" 376 | dependencies = [ 377 | "ahash", 378 | "ark-ff 0.5.0", 379 | "ark-serialize 0.5.0", 380 | "ark-std 0.5.0", 381 | "educe", 382 | "fnv", 383 | "hashbrown", 384 | ] 385 | 386 | [[package]] 387 | name = "ark-r1cs-std" 388 | version = "0.5.0" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" 391 | dependencies = [ 392 | "ark-ec", 393 | "ark-ff 0.5.0", 394 | "ark-relations", 395 | "ark-std 0.5.0", 396 | "educe", 397 | "num-bigint", 398 | "num-integer", 399 | "num-traits", 400 | "tracing", 401 | ] 402 | 403 | [[package]] 404 | name = "ark-relations" 405 | version = "0.5.1" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" 408 | dependencies = [ 409 | "ark-ff 0.5.0", 410 | "ark-std 0.5.0", 411 | "tracing", 412 | "tracing-subscriber", 413 | ] 414 | 415 | [[package]] 416 | name = "ark-serialize" 417 | version = "0.3.0" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" 420 | dependencies = [ 421 | "ark-std 0.3.0", 422 | "digest 0.9.0", 423 | ] 424 | 425 | [[package]] 426 | name = "ark-serialize" 427 | version = "0.4.2" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" 430 | dependencies = [ 431 | "ark-std 0.4.0", 432 | "digest 0.10.7", 433 | "num-bigint", 434 | ] 435 | 436 | [[package]] 437 | name = "ark-serialize" 438 | version = "0.5.0" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" 441 | dependencies = [ 442 | "ark-serialize-derive", 443 | "ark-std 0.5.0", 444 | "arrayvec", 445 | "digest 0.10.7", 446 | "num-bigint", 447 | ] 448 | 449 | [[package]] 450 | name = "ark-serialize-derive" 451 | version = "0.5.0" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" 454 | dependencies = [ 455 | "proc-macro2", 456 | "quote", 457 | "syn 2.0.87", 458 | ] 459 | 460 | [[package]] 461 | name = "ark-snark" 462 | version = "0.5.1" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" 465 | dependencies = [ 466 | "ark-ff 0.5.0", 467 | "ark-relations", 468 | "ark-serialize 0.5.0", 469 | "ark-std 0.5.0", 470 | ] 471 | 472 | [[package]] 473 | name = "ark-std" 474 | version = "0.3.0" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" 477 | dependencies = [ 478 | "num-traits", 479 | "rand", 480 | ] 481 | 482 | [[package]] 483 | name = "ark-std" 484 | version = "0.4.0" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" 487 | dependencies = [ 488 | "num-traits", 489 | "rand", 490 | ] 491 | 492 | [[package]] 493 | name = "ark-std" 494 | version = "0.5.0" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" 497 | dependencies = [ 498 | "num-traits", 499 | "rand", 500 | ] 501 | 502 | [[package]] 503 | name = "arrayvec" 504 | version = "0.7.6" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" 507 | 508 | [[package]] 509 | name = "asn1-rs" 510 | version = "0.5.2" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" 513 | dependencies = [ 514 | "asn1-rs-derive", 515 | "asn1-rs-impl", 516 | "displaydoc", 517 | "nom", 518 | "num-traits", 519 | "rusticata-macros", 520 | "thiserror", 521 | "time", 522 | ] 523 | 524 | [[package]] 525 | name = "asn1-rs-derive" 526 | version = "0.4.0" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" 529 | dependencies = [ 530 | "proc-macro2", 531 | "quote", 532 | "syn 1.0.109", 533 | "synstructure", 534 | ] 535 | 536 | [[package]] 537 | name = "asn1-rs-impl" 538 | version = "0.1.0" 539 | source = "registry+https://github.com/rust-lang/crates.io-index" 540 | checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" 541 | dependencies = [ 542 | "proc-macro2", 543 | "quote", 544 | "syn 1.0.109", 545 | ] 546 | 547 | [[package]] 548 | name = "auto_impl" 549 | version = "1.2.0" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" 552 | dependencies = [ 553 | "proc-macro2", 554 | "quote", 555 | "syn 2.0.87", 556 | ] 557 | 558 | [[package]] 559 | name = "autocfg" 560 | version = "1.3.0" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 563 | 564 | [[package]] 565 | name = "base16ct" 566 | version = "0.2.0" 567 | source = "registry+https://github.com/rust-lang/crates.io-index" 568 | checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" 569 | 570 | [[package]] 571 | name = "base64ct" 572 | version = "1.6.0" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" 575 | 576 | [[package]] 577 | name = "bit-set" 578 | version = "0.5.3" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" 581 | dependencies = [ 582 | "bit-vec 0.6.3", 583 | ] 584 | 585 | [[package]] 586 | name = "bit-vec" 587 | version = "0.6.3" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 590 | 591 | [[package]] 592 | name = "bit-vec" 593 | version = "0.8.0" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" 596 | 597 | [[package]] 598 | name = "bitflags" 599 | version = "1.3.2" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 602 | 603 | [[package]] 604 | name = "bitflags" 605 | version = "2.6.0" 606 | source = "registry+https://github.com/rust-lang/crates.io-index" 607 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 608 | 609 | [[package]] 610 | name = "bitvec" 611 | version = "1.0.1" 612 | source = "registry+https://github.com/rust-lang/crates.io-index" 613 | checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 614 | dependencies = [ 615 | "funty", 616 | "radium", 617 | "tap", 618 | "wyz", 619 | ] 620 | 621 | [[package]] 622 | name = "blake2" 623 | version = "0.10.6" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" 626 | dependencies = [ 627 | "digest 0.10.7", 628 | ] 629 | 630 | [[package]] 631 | name = "block" 632 | version = "0.1.6" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" 635 | 636 | [[package]] 637 | name = "block-buffer" 638 | version = "0.10.4" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 641 | dependencies = [ 642 | "generic-array", 643 | ] 644 | 645 | [[package]] 646 | name = "borsh" 647 | version = "1.5.3" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" 650 | dependencies = [ 651 | "borsh-derive", 652 | "cfg_aliases", 653 | ] 654 | 655 | [[package]] 656 | name = "borsh-derive" 657 | version = "1.5.3" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" 660 | dependencies = [ 661 | "once_cell", 662 | "proc-macro-crate", 663 | "proc-macro2", 664 | "quote", 665 | "syn 2.0.87", 666 | ] 667 | 668 | [[package]] 669 | name = "bumpalo" 670 | version = "3.16.0" 671 | source = "registry+https://github.com/rust-lang/crates.io-index" 672 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 673 | 674 | [[package]] 675 | name = "byte-slice-cast" 676 | version = "1.2.2" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" 679 | 680 | [[package]] 681 | name = "bytemuck" 682 | version = "1.21.0" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" 685 | dependencies = [ 686 | "bytemuck_derive", 687 | ] 688 | 689 | [[package]] 690 | name = "bytemuck_derive" 691 | version = "1.8.1" 692 | source = "registry+https://github.com/rust-lang/crates.io-index" 693 | checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" 694 | dependencies = [ 695 | "proc-macro2", 696 | "quote", 697 | "syn 2.0.87", 698 | ] 699 | 700 | [[package]] 701 | name = "byteorder" 702 | version = "1.5.0" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 705 | 706 | [[package]] 707 | name = "bytes" 708 | version = "1.8.0" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" 711 | dependencies = [ 712 | "serde", 713 | ] 714 | 715 | [[package]] 716 | name = "cc" 717 | version = "1.0.97" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" 720 | 721 | [[package]] 722 | name = "cfg-if" 723 | version = "1.0.0" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 726 | 727 | [[package]] 728 | name = "cfg_aliases" 729 | version = "0.2.1" 730 | source = "registry+https://github.com/rust-lang/crates.io-index" 731 | checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" 732 | 733 | [[package]] 734 | name = "chrono" 735 | version = "0.4.38" 736 | source = "registry+https://github.com/rust-lang/crates.io-index" 737 | checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" 738 | dependencies = [ 739 | "android-tzdata", 740 | "iana-time-zone", 741 | "js-sys", 742 | "num-traits", 743 | "wasm-bindgen", 744 | "windows-targets", 745 | ] 746 | 747 | [[package]] 748 | name = "cobs" 749 | version = "0.2.3" 750 | source = "registry+https://github.com/rust-lang/crates.io-index" 751 | checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" 752 | 753 | [[package]] 754 | name = "const-hex" 755 | version = "1.13.1" 756 | source = "registry+https://github.com/rust-lang/crates.io-index" 757 | checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" 758 | dependencies = [ 759 | "cfg-if", 760 | "cpufeatures", 761 | "hex", 762 | "proptest", 763 | "serde", 764 | ] 765 | 766 | [[package]] 767 | name = "const-oid" 768 | version = "0.9.6" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 771 | 772 | [[package]] 773 | name = "core-foundation" 774 | version = "0.9.4" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 777 | dependencies = [ 778 | "core-foundation-sys", 779 | "libc", 780 | ] 781 | 782 | [[package]] 783 | name = "core-foundation-sys" 784 | version = "0.8.6" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 787 | 788 | [[package]] 789 | name = "core-graphics-types" 790 | version = "0.1.3" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" 793 | dependencies = [ 794 | "bitflags 1.3.2", 795 | "core-foundation", 796 | "libc", 797 | ] 798 | 799 | [[package]] 800 | name = "cpufeatures" 801 | version = "0.2.12" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" 804 | dependencies = [ 805 | "libc", 806 | ] 807 | 808 | [[package]] 809 | name = "crunchy" 810 | version = "0.2.2" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 813 | 814 | [[package]] 815 | name = "crypto-bigint" 816 | version = "0.5.2" 817 | source = "git+https://github.com/risc0/RustCrypto-crypto-bigint?tag=v0.5.2-risczero.0#8b30304277cfe553b51a78a0e693f48bbb059eb3" 818 | dependencies = [ 819 | "generic-array", 820 | "getrandom 0.2.15", 821 | "rand_core", 822 | "subtle", 823 | "zeroize", 824 | ] 825 | 826 | [[package]] 827 | name = "crypto-common" 828 | version = "0.1.6" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 831 | dependencies = [ 832 | "generic-array", 833 | "typenum", 834 | ] 835 | 836 | [[package]] 837 | name = "data-encoding" 838 | version = "2.6.0" 839 | source = "registry+https://github.com/rust-lang/crates.io-index" 840 | checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" 841 | 842 | [[package]] 843 | name = "dcap-rs" 844 | version = "0.1.0" 845 | source = "git+https://github.com/automata-network/dcap-rs.git?rev=d847b8f75a493640c4881bdf67775250b6baefab#d847b8f75a493640c4881bdf67775250b6baefab" 846 | dependencies = [ 847 | "alloy-sol-types", 848 | "chrono", 849 | "hex", 850 | "p256", 851 | "serde", 852 | "serde_json", 853 | "sha2", 854 | "sha3", 855 | "time", 856 | "x509-parser", 857 | ] 858 | 859 | [[package]] 860 | name = "dcap_guest" 861 | version = "0.1.0" 862 | dependencies = [ 863 | "chrono", 864 | "dcap-rs", 865 | "hex", 866 | "risc0-zkvm", 867 | "serde_json", 868 | ] 869 | 870 | [[package]] 871 | name = "der" 872 | version = "0.7.9" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" 875 | dependencies = [ 876 | "const-oid", 877 | "pem-rfc7468", 878 | "zeroize", 879 | ] 880 | 881 | [[package]] 882 | name = "der-parser" 883 | version = "8.2.0" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" 886 | dependencies = [ 887 | "asn1-rs", 888 | "displaydoc", 889 | "nom", 890 | "num-bigint", 891 | "num-traits", 892 | "rusticata-macros", 893 | ] 894 | 895 | [[package]] 896 | name = "deranged" 897 | version = "0.3.11" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" 900 | dependencies = [ 901 | "powerfmt", 902 | ] 903 | 904 | [[package]] 905 | name = "derivative" 906 | version = "2.2.0" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" 909 | dependencies = [ 910 | "proc-macro2", 911 | "quote", 912 | "syn 1.0.109", 913 | ] 914 | 915 | [[package]] 916 | name = "derive_more" 917 | version = "1.0.0" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" 920 | dependencies = [ 921 | "derive_more-impl 1.0.0", 922 | ] 923 | 924 | [[package]] 925 | name = "derive_more" 926 | version = "2.0.1" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" 929 | dependencies = [ 930 | "derive_more-impl 2.0.1", 931 | ] 932 | 933 | [[package]] 934 | name = "derive_more-impl" 935 | version = "1.0.0" 936 | source = "registry+https://github.com/rust-lang/crates.io-index" 937 | checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" 938 | dependencies = [ 939 | "proc-macro2", 940 | "quote", 941 | "syn 2.0.87", 942 | "unicode-xid", 943 | ] 944 | 945 | [[package]] 946 | name = "derive_more-impl" 947 | version = "2.0.1" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" 950 | dependencies = [ 951 | "proc-macro2", 952 | "quote", 953 | "syn 2.0.87", 954 | "unicode-xid", 955 | ] 956 | 957 | [[package]] 958 | name = "digest" 959 | version = "0.9.0" 960 | source = "registry+https://github.com/rust-lang/crates.io-index" 961 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 962 | dependencies = [ 963 | "generic-array", 964 | ] 965 | 966 | [[package]] 967 | name = "digest" 968 | version = "0.10.7" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 971 | dependencies = [ 972 | "block-buffer", 973 | "const-oid", 974 | "crypto-common", 975 | "subtle", 976 | ] 977 | 978 | [[package]] 979 | name = "displaydoc" 980 | version = "0.2.4" 981 | source = "registry+https://github.com/rust-lang/crates.io-index" 982 | checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" 983 | dependencies = [ 984 | "proc-macro2", 985 | "quote", 986 | "syn 2.0.87", 987 | ] 988 | 989 | [[package]] 990 | name = "downcast-rs" 991 | version = "1.2.1" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" 994 | 995 | [[package]] 996 | name = "dunce" 997 | version = "1.0.5" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" 1000 | 1001 | [[package]] 1002 | name = "ecdsa" 1003 | version = "0.16.9" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" 1006 | dependencies = [ 1007 | "der", 1008 | "digest 0.10.7", 1009 | "elliptic-curve", 1010 | "rfc6979", 1011 | "signature", 1012 | "spki", 1013 | ] 1014 | 1015 | [[package]] 1016 | name = "educe" 1017 | version = "0.6.0" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" 1020 | dependencies = [ 1021 | "enum-ordinalize", 1022 | "proc-macro2", 1023 | "quote", 1024 | "syn 2.0.87", 1025 | ] 1026 | 1027 | [[package]] 1028 | name = "either" 1029 | version = "1.11.0" 1030 | source = "registry+https://github.com/rust-lang/crates.io-index" 1031 | checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" 1032 | 1033 | [[package]] 1034 | name = "elf" 1035 | version = "0.7.4" 1036 | source = "registry+https://github.com/rust-lang/crates.io-index" 1037 | checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" 1038 | 1039 | [[package]] 1040 | name = "elliptic-curve" 1041 | version = "0.13.8" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" 1044 | dependencies = [ 1045 | "base16ct", 1046 | "crypto-bigint", 1047 | "digest 0.10.7", 1048 | "ff", 1049 | "generic-array", 1050 | "group", 1051 | "pem-rfc7468", 1052 | "pkcs8", 1053 | "rand_core", 1054 | "sec1", 1055 | "subtle", 1056 | "zeroize", 1057 | ] 1058 | 1059 | [[package]] 1060 | name = "embedded-io" 1061 | version = "0.4.0" 1062 | source = "registry+https://github.com/rust-lang/crates.io-index" 1063 | checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" 1064 | 1065 | [[package]] 1066 | name = "embedded-io" 1067 | version = "0.6.1" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" 1070 | 1071 | [[package]] 1072 | name = "enum-ordinalize" 1073 | version = "4.3.0" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" 1076 | dependencies = [ 1077 | "enum-ordinalize-derive", 1078 | ] 1079 | 1080 | [[package]] 1081 | name = "enum-ordinalize-derive" 1082 | version = "4.3.1" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" 1085 | dependencies = [ 1086 | "proc-macro2", 1087 | "quote", 1088 | "syn 2.0.87", 1089 | ] 1090 | 1091 | [[package]] 1092 | name = "equivalent" 1093 | version = "1.0.1" 1094 | source = "registry+https://github.com/rust-lang/crates.io-index" 1095 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 1096 | 1097 | [[package]] 1098 | name = "errno" 1099 | version = "0.3.9" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 1102 | dependencies = [ 1103 | "libc", 1104 | "windows-sys", 1105 | ] 1106 | 1107 | [[package]] 1108 | name = "fastrand" 1109 | version = "2.2.0" 1110 | source = "registry+https://github.com/rust-lang/crates.io-index" 1111 | checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" 1112 | 1113 | [[package]] 1114 | name = "fastrlp" 1115 | version = "0.3.1" 1116 | source = "registry+https://github.com/rust-lang/crates.io-index" 1117 | checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" 1118 | dependencies = [ 1119 | "arrayvec", 1120 | "auto_impl", 1121 | "bytes", 1122 | ] 1123 | 1124 | [[package]] 1125 | name = "ff" 1126 | version = "0.13.0" 1127 | source = "registry+https://github.com/rust-lang/crates.io-index" 1128 | checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" 1129 | dependencies = [ 1130 | "rand_core", 1131 | "subtle", 1132 | ] 1133 | 1134 | [[package]] 1135 | name = "fixed-hash" 1136 | version = "0.8.0" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" 1139 | dependencies = [ 1140 | "byteorder", 1141 | "rand", 1142 | "rustc-hex", 1143 | "static_assertions", 1144 | ] 1145 | 1146 | [[package]] 1147 | name = "fnv" 1148 | version = "1.0.7" 1149 | source = "registry+https://github.com/rust-lang/crates.io-index" 1150 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 1151 | 1152 | [[package]] 1153 | name = "foldhash" 1154 | version = "0.1.3" 1155 | source = "registry+https://github.com/rust-lang/crates.io-index" 1156 | checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" 1157 | 1158 | [[package]] 1159 | name = "foreign-types" 1160 | version = "0.5.0" 1161 | source = "registry+https://github.com/rust-lang/crates.io-index" 1162 | checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" 1163 | dependencies = [ 1164 | "foreign-types-macros", 1165 | "foreign-types-shared", 1166 | ] 1167 | 1168 | [[package]] 1169 | name = "foreign-types-macros" 1170 | version = "0.2.3" 1171 | source = "registry+https://github.com/rust-lang/crates.io-index" 1172 | checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" 1173 | dependencies = [ 1174 | "proc-macro2", 1175 | "quote", 1176 | "syn 2.0.87", 1177 | ] 1178 | 1179 | [[package]] 1180 | name = "foreign-types-shared" 1181 | version = "0.3.1" 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" 1183 | checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" 1184 | 1185 | [[package]] 1186 | name = "funty" 1187 | version = "2.0.0" 1188 | source = "registry+https://github.com/rust-lang/crates.io-index" 1189 | checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 1190 | 1191 | [[package]] 1192 | name = "generic-array" 1193 | version = "0.14.7" 1194 | source = "registry+https://github.com/rust-lang/crates.io-index" 1195 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 1196 | dependencies = [ 1197 | "typenum", 1198 | "version_check", 1199 | "zeroize", 1200 | ] 1201 | 1202 | [[package]] 1203 | name = "getrandom" 1204 | version = "0.2.15" 1205 | source = "registry+https://github.com/rust-lang/crates.io-index" 1206 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 1207 | dependencies = [ 1208 | "cfg-if", 1209 | "libc", 1210 | "wasi 0.11.0+wasi-snapshot-preview1", 1211 | ] 1212 | 1213 | [[package]] 1214 | name = "getrandom" 1215 | version = "0.3.3" 1216 | source = "registry+https://github.com/rust-lang/crates.io-index" 1217 | checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" 1218 | dependencies = [ 1219 | "cfg-if", 1220 | "libc", 1221 | "r-efi", 1222 | "wasi 0.14.2+wasi-0.2.4", 1223 | ] 1224 | 1225 | [[package]] 1226 | name = "group" 1227 | version = "0.13.0" 1228 | source = "registry+https://github.com/rust-lang/crates.io-index" 1229 | checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" 1230 | dependencies = [ 1231 | "ff", 1232 | "rand_core", 1233 | "subtle", 1234 | ] 1235 | 1236 | [[package]] 1237 | name = "hashbrown" 1238 | version = "0.15.1" 1239 | source = "registry+https://github.com/rust-lang/crates.io-index" 1240 | checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" 1241 | dependencies = [ 1242 | "allocator-api2", 1243 | "foldhash", 1244 | "serde", 1245 | ] 1246 | 1247 | [[package]] 1248 | name = "heck" 1249 | version = "0.5.0" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 1252 | 1253 | [[package]] 1254 | name = "hex" 1255 | version = "0.4.3" 1256 | source = "registry+https://github.com/rust-lang/crates.io-index" 1257 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 1258 | dependencies = [ 1259 | "serde", 1260 | ] 1261 | 1262 | [[package]] 1263 | name = "hex-literal" 1264 | version = "0.4.1" 1265 | source = "registry+https://github.com/rust-lang/crates.io-index" 1266 | checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" 1267 | 1268 | [[package]] 1269 | name = "hmac" 1270 | version = "0.12.1" 1271 | source = "registry+https://github.com/rust-lang/crates.io-index" 1272 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 1273 | dependencies = [ 1274 | "digest 0.10.7", 1275 | ] 1276 | 1277 | [[package]] 1278 | name = "iana-time-zone" 1279 | version = "0.1.60" 1280 | source = "registry+https://github.com/rust-lang/crates.io-index" 1281 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 1282 | dependencies = [ 1283 | "android_system_properties", 1284 | "core-foundation-sys", 1285 | "iana-time-zone-haiku", 1286 | "js-sys", 1287 | "wasm-bindgen", 1288 | "windows-core", 1289 | ] 1290 | 1291 | [[package]] 1292 | name = "iana-time-zone-haiku" 1293 | version = "0.1.2" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 1296 | dependencies = [ 1297 | "cc", 1298 | ] 1299 | 1300 | [[package]] 1301 | name = "impl-codec" 1302 | version = "0.6.0" 1303 | source = "registry+https://github.com/rust-lang/crates.io-index" 1304 | checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" 1305 | dependencies = [ 1306 | "parity-scale-codec", 1307 | ] 1308 | 1309 | [[package]] 1310 | name = "impl-trait-for-tuples" 1311 | version = "0.2.2" 1312 | source = "registry+https://github.com/rust-lang/crates.io-index" 1313 | checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" 1314 | dependencies = [ 1315 | "proc-macro2", 1316 | "quote", 1317 | "syn 1.0.109", 1318 | ] 1319 | 1320 | [[package]] 1321 | name = "include_bytes_aligned" 1322 | version = "0.1.4" 1323 | source = "registry+https://github.com/rust-lang/crates.io-index" 1324 | checksum = "4ee796ad498c8d9a1d68e477df8f754ed784ef875de1414ebdaf169f70a6a784" 1325 | 1326 | [[package]] 1327 | name = "indexmap" 1328 | version = "2.6.0" 1329 | source = "registry+https://github.com/rust-lang/crates.io-index" 1330 | checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" 1331 | dependencies = [ 1332 | "equivalent", 1333 | "hashbrown", 1334 | "serde", 1335 | ] 1336 | 1337 | [[package]] 1338 | name = "itertools" 1339 | version = "0.10.5" 1340 | source = "registry+https://github.com/rust-lang/crates.io-index" 1341 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 1342 | dependencies = [ 1343 | "either", 1344 | ] 1345 | 1346 | [[package]] 1347 | name = "itertools" 1348 | version = "0.13.0" 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" 1350 | checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" 1351 | dependencies = [ 1352 | "either", 1353 | ] 1354 | 1355 | [[package]] 1356 | name = "itoa" 1357 | version = "1.0.11" 1358 | source = "registry+https://github.com/rust-lang/crates.io-index" 1359 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 1360 | 1361 | [[package]] 1362 | name = "js-sys" 1363 | version = "0.3.69" 1364 | source = "registry+https://github.com/rust-lang/crates.io-index" 1365 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 1366 | dependencies = [ 1367 | "wasm-bindgen", 1368 | ] 1369 | 1370 | [[package]] 1371 | name = "k256" 1372 | version = "0.13.4" 1373 | source = "registry+https://github.com/rust-lang/crates.io-index" 1374 | checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" 1375 | dependencies = [ 1376 | "cfg-if", 1377 | "ecdsa", 1378 | "elliptic-curve", 1379 | "once_cell", 1380 | "sha2", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "keccak" 1385 | version = "0.1.5" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" 1388 | dependencies = [ 1389 | "cpufeatures", 1390 | ] 1391 | 1392 | [[package]] 1393 | name = "keccak-asm" 1394 | version = "0.1.4" 1395 | source = "registry+https://github.com/rust-lang/crates.io-index" 1396 | checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" 1397 | dependencies = [ 1398 | "digest 0.10.7", 1399 | "sha3-asm", 1400 | ] 1401 | 1402 | [[package]] 1403 | name = "lazy_static" 1404 | version = "1.5.0" 1405 | source = "registry+https://github.com/rust-lang/crates.io-index" 1406 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 1407 | dependencies = [ 1408 | "spin", 1409 | ] 1410 | 1411 | [[package]] 1412 | name = "libc" 1413 | version = "0.2.154" 1414 | source = "registry+https://github.com/rust-lang/crates.io-index" 1415 | checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" 1416 | 1417 | [[package]] 1418 | name = "libm" 1419 | version = "0.2.8" 1420 | source = "registry+https://github.com/rust-lang/crates.io-index" 1421 | checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" 1422 | 1423 | [[package]] 1424 | name = "linux-raw-sys" 1425 | version = "0.4.14" 1426 | source = "registry+https://github.com/rust-lang/crates.io-index" 1427 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 1428 | 1429 | [[package]] 1430 | name = "log" 1431 | version = "0.4.21" 1432 | source = "registry+https://github.com/rust-lang/crates.io-index" 1433 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 1434 | 1435 | [[package]] 1436 | name = "malloc_buf" 1437 | version = "0.0.6" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" 1440 | dependencies = [ 1441 | "libc", 1442 | ] 1443 | 1444 | [[package]] 1445 | name = "memchr" 1446 | version = "2.7.2" 1447 | source = "registry+https://github.com/rust-lang/crates.io-index" 1448 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 1449 | 1450 | [[package]] 1451 | name = "merlin" 1452 | version = "3.0.0" 1453 | source = "registry+https://github.com/rust-lang/crates.io-index" 1454 | checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" 1455 | dependencies = [ 1456 | "byteorder", 1457 | "keccak", 1458 | "rand_core", 1459 | "zeroize", 1460 | ] 1461 | 1462 | [[package]] 1463 | name = "metal" 1464 | version = "0.29.0" 1465 | source = "registry+https://github.com/rust-lang/crates.io-index" 1466 | checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" 1467 | dependencies = [ 1468 | "bitflags 2.6.0", 1469 | "block", 1470 | "core-graphics-types", 1471 | "foreign-types", 1472 | "log", 1473 | "objc", 1474 | "paste", 1475 | ] 1476 | 1477 | [[package]] 1478 | name = "minimal-lexical" 1479 | version = "0.2.1" 1480 | source = "registry+https://github.com/rust-lang/crates.io-index" 1481 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 1482 | 1483 | [[package]] 1484 | name = "no_std_strings" 1485 | version = "0.1.3" 1486 | source = "registry+https://github.com/rust-lang/crates.io-index" 1487 | checksum = "a5b0c77c1b780822bc749a33e39aeb2c07584ab93332303babeabb645298a76e" 1488 | 1489 | [[package]] 1490 | name = "nom" 1491 | version = "7.1.3" 1492 | source = "registry+https://github.com/rust-lang/crates.io-index" 1493 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 1494 | dependencies = [ 1495 | "memchr", 1496 | "minimal-lexical", 1497 | ] 1498 | 1499 | [[package]] 1500 | name = "num-bigint" 1501 | version = "0.4.5" 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" 1503 | checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" 1504 | dependencies = [ 1505 | "num-integer", 1506 | "num-traits", 1507 | ] 1508 | 1509 | [[package]] 1510 | name = "num-conv" 1511 | version = "0.1.0" 1512 | source = "registry+https://github.com/rust-lang/crates.io-index" 1513 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 1514 | 1515 | [[package]] 1516 | name = "num-integer" 1517 | version = "0.1.46" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 1520 | dependencies = [ 1521 | "num-traits", 1522 | ] 1523 | 1524 | [[package]] 1525 | name = "num-traits" 1526 | version = "0.2.19" 1527 | source = "registry+https://github.com/rust-lang/crates.io-index" 1528 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 1529 | dependencies = [ 1530 | "autocfg", 1531 | "libm", 1532 | ] 1533 | 1534 | [[package]] 1535 | name = "objc" 1536 | version = "0.2.7" 1537 | source = "registry+https://github.com/rust-lang/crates.io-index" 1538 | checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" 1539 | dependencies = [ 1540 | "malloc_buf", 1541 | ] 1542 | 1543 | [[package]] 1544 | name = "oid-registry" 1545 | version = "0.6.1" 1546 | source = "registry+https://github.com/rust-lang/crates.io-index" 1547 | checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" 1548 | dependencies = [ 1549 | "asn1-rs", 1550 | ] 1551 | 1552 | [[package]] 1553 | name = "once_cell" 1554 | version = "1.19.0" 1555 | source = "registry+https://github.com/rust-lang/crates.io-index" 1556 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 1557 | 1558 | [[package]] 1559 | name = "p256" 1560 | version = "0.13.2" 1561 | source = "git+https://github.com/risc0/RustCrypto-elliptic-curves?tag=p256%2Fv0.13.2-risczero.1#bb0f51ad3ba81585f36ea8a1ea81093d8664b195" 1562 | dependencies = [ 1563 | "bytemuck", 1564 | "ecdsa", 1565 | "elliptic-curve", 1566 | "primeorder", 1567 | "risc0-bigint2", 1568 | "sha2", 1569 | ] 1570 | 1571 | [[package]] 1572 | name = "parity-scale-codec" 1573 | version = "3.6.12" 1574 | source = "registry+https://github.com/rust-lang/crates.io-index" 1575 | checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" 1576 | dependencies = [ 1577 | "arrayvec", 1578 | "bitvec", 1579 | "byte-slice-cast", 1580 | "impl-trait-for-tuples", 1581 | "parity-scale-codec-derive", 1582 | "serde", 1583 | ] 1584 | 1585 | [[package]] 1586 | name = "parity-scale-codec-derive" 1587 | version = "3.6.12" 1588 | source = "registry+https://github.com/rust-lang/crates.io-index" 1589 | checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" 1590 | dependencies = [ 1591 | "proc-macro-crate", 1592 | "proc-macro2", 1593 | "quote", 1594 | "syn 1.0.109", 1595 | ] 1596 | 1597 | [[package]] 1598 | name = "paste" 1599 | version = "1.0.15" 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" 1601 | checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 1602 | 1603 | [[package]] 1604 | name = "pem-rfc7468" 1605 | version = "0.7.0" 1606 | source = "registry+https://github.com/rust-lang/crates.io-index" 1607 | checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" 1608 | dependencies = [ 1609 | "base64ct", 1610 | ] 1611 | 1612 | [[package]] 1613 | name = "pest" 1614 | version = "2.7.14" 1615 | source = "registry+https://github.com/rust-lang/crates.io-index" 1616 | checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" 1617 | dependencies = [ 1618 | "memchr", 1619 | "thiserror", 1620 | "ucd-trie", 1621 | ] 1622 | 1623 | [[package]] 1624 | name = "pin-project-lite" 1625 | version = "0.2.14" 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" 1627 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 1628 | 1629 | [[package]] 1630 | name = "pkcs8" 1631 | version = "0.10.2" 1632 | source = "registry+https://github.com/rust-lang/crates.io-index" 1633 | checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" 1634 | dependencies = [ 1635 | "der", 1636 | "spki", 1637 | ] 1638 | 1639 | [[package]] 1640 | name = "postcard" 1641 | version = "1.1.1" 1642 | source = "registry+https://github.com/rust-lang/crates.io-index" 1643 | checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" 1644 | dependencies = [ 1645 | "cobs", 1646 | "embedded-io 0.4.0", 1647 | "embedded-io 0.6.1", 1648 | "serde", 1649 | ] 1650 | 1651 | [[package]] 1652 | name = "powerfmt" 1653 | version = "0.2.0" 1654 | source = "registry+https://github.com/rust-lang/crates.io-index" 1655 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 1656 | 1657 | [[package]] 1658 | name = "ppv-lite86" 1659 | version = "0.2.17" 1660 | source = "registry+https://github.com/rust-lang/crates.io-index" 1661 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1662 | 1663 | [[package]] 1664 | name = "primeorder" 1665 | version = "0.13.1" 1666 | source = "git+https://github.com/risc0/RustCrypto-elliptic-curves?tag=p256%2Fv0.13.2-risczero.1#bb0f51ad3ba81585f36ea8a1ea81093d8664b195" 1667 | dependencies = [ 1668 | "bytemuck", 1669 | "elliptic-curve", 1670 | "risc0-bigint2", 1671 | ] 1672 | 1673 | [[package]] 1674 | name = "primitive-types" 1675 | version = "0.12.2" 1676 | source = "registry+https://github.com/rust-lang/crates.io-index" 1677 | checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" 1678 | dependencies = [ 1679 | "fixed-hash", 1680 | "impl-codec", 1681 | "uint", 1682 | ] 1683 | 1684 | [[package]] 1685 | name = "proc-macro-crate" 1686 | version = "3.2.0" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" 1689 | dependencies = [ 1690 | "toml_edit", 1691 | ] 1692 | 1693 | [[package]] 1694 | name = "proc-macro-error-attr2" 1695 | version = "2.0.0" 1696 | source = "registry+https://github.com/rust-lang/crates.io-index" 1697 | checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" 1698 | dependencies = [ 1699 | "proc-macro2", 1700 | "quote", 1701 | ] 1702 | 1703 | [[package]] 1704 | name = "proc-macro-error2" 1705 | version = "2.0.1" 1706 | source = "registry+https://github.com/rust-lang/crates.io-index" 1707 | checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" 1708 | dependencies = [ 1709 | "proc-macro-error-attr2", 1710 | "proc-macro2", 1711 | "quote", 1712 | "syn 2.0.87", 1713 | ] 1714 | 1715 | [[package]] 1716 | name = "proc-macro2" 1717 | version = "1.0.89" 1718 | source = "registry+https://github.com/rust-lang/crates.io-index" 1719 | checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" 1720 | dependencies = [ 1721 | "unicode-ident", 1722 | ] 1723 | 1724 | [[package]] 1725 | name = "proptest" 1726 | version = "1.5.0" 1727 | source = "registry+https://github.com/rust-lang/crates.io-index" 1728 | checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" 1729 | dependencies = [ 1730 | "bit-set", 1731 | "bit-vec 0.6.3", 1732 | "bitflags 2.6.0", 1733 | "lazy_static", 1734 | "num-traits", 1735 | "rand", 1736 | "rand_chacha", 1737 | "rand_xorshift", 1738 | "regex-syntax", 1739 | "rusty-fork", 1740 | "tempfile", 1741 | "unarray", 1742 | ] 1743 | 1744 | [[package]] 1745 | name = "quick-error" 1746 | version = "1.2.3" 1747 | source = "registry+https://github.com/rust-lang/crates.io-index" 1748 | checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" 1749 | 1750 | [[package]] 1751 | name = "quote" 1752 | version = "1.0.36" 1753 | source = "registry+https://github.com/rust-lang/crates.io-index" 1754 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 1755 | dependencies = [ 1756 | "proc-macro2", 1757 | ] 1758 | 1759 | [[package]] 1760 | name = "r-efi" 1761 | version = "5.2.0" 1762 | source = "registry+https://github.com/rust-lang/crates.io-index" 1763 | checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" 1764 | 1765 | [[package]] 1766 | name = "radium" 1767 | version = "0.7.0" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 1770 | 1771 | [[package]] 1772 | name = "rand" 1773 | version = "0.8.5" 1774 | source = "registry+https://github.com/rust-lang/crates.io-index" 1775 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1776 | dependencies = [ 1777 | "libc", 1778 | "rand_chacha", 1779 | "rand_core", 1780 | "serde", 1781 | ] 1782 | 1783 | [[package]] 1784 | name = "rand_chacha" 1785 | version = "0.3.1" 1786 | source = "registry+https://github.com/rust-lang/crates.io-index" 1787 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1788 | dependencies = [ 1789 | "ppv-lite86", 1790 | "rand_core", 1791 | ] 1792 | 1793 | [[package]] 1794 | name = "rand_core" 1795 | version = "0.6.4" 1796 | source = "registry+https://github.com/rust-lang/crates.io-index" 1797 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1798 | dependencies = [ 1799 | "getrandom 0.2.15", 1800 | ] 1801 | 1802 | [[package]] 1803 | name = "rand_xorshift" 1804 | version = "0.3.0" 1805 | source = "registry+https://github.com/rust-lang/crates.io-index" 1806 | checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" 1807 | dependencies = [ 1808 | "rand_core", 1809 | ] 1810 | 1811 | [[package]] 1812 | name = "regex-syntax" 1813 | version = "0.8.5" 1814 | source = "registry+https://github.com/rust-lang/crates.io-index" 1815 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 1816 | 1817 | [[package]] 1818 | name = "rfc6979" 1819 | version = "0.4.0" 1820 | source = "registry+https://github.com/rust-lang/crates.io-index" 1821 | checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" 1822 | dependencies = [ 1823 | "hmac", 1824 | "subtle", 1825 | ] 1826 | 1827 | [[package]] 1828 | name = "risc0-bigint2" 1829 | version = "1.4.3" 1830 | source = "registry+https://github.com/rust-lang/crates.io-index" 1831 | checksum = "00a065c83232c9945f9c1690f9766bec75f8919272b3a724b44dcc68b05f4625" 1832 | dependencies = [ 1833 | "include_bytes_aligned", 1834 | "stability", 1835 | ] 1836 | 1837 | [[package]] 1838 | name = "risc0-binfmt" 1839 | version = "2.0.2" 1840 | source = "registry+https://github.com/rust-lang/crates.io-index" 1841 | checksum = "62eb7025356a233c1bc267c458a2ce56fcfc89b136d813c8a77be14ef1eaf2b1" 1842 | dependencies = [ 1843 | "anyhow", 1844 | "borsh", 1845 | "derive_more 2.0.1", 1846 | "elf", 1847 | "lazy_static", 1848 | "postcard", 1849 | "risc0-zkp", 1850 | "risc0-zkvm-platform", 1851 | "semver 1.0.23", 1852 | "serde", 1853 | "tracing", 1854 | ] 1855 | 1856 | [[package]] 1857 | name = "risc0-circuit-keccak" 1858 | version = "3.0.0" 1859 | source = "registry+https://github.com/rust-lang/crates.io-index" 1860 | checksum = "0094af5a57b020388a03bdd3834959c7d62723f1687be81414ade25104d93263" 1861 | dependencies = [ 1862 | "anyhow", 1863 | "bytemuck", 1864 | "paste", 1865 | "risc0-binfmt", 1866 | "risc0-circuit-recursion", 1867 | "risc0-core", 1868 | "risc0-zkp", 1869 | "tracing", 1870 | ] 1871 | 1872 | [[package]] 1873 | name = "risc0-circuit-recursion" 1874 | version = "3.0.0" 1875 | source = "registry+https://github.com/rust-lang/crates.io-index" 1876 | checksum = "76ebded45c902c2b6939924a1cddd1d06b5d1d4ad1531e8798ebfee78f9c038d" 1877 | dependencies = [ 1878 | "anyhow", 1879 | "bytemuck", 1880 | "hex", 1881 | "metal", 1882 | "risc0-core", 1883 | "risc0-zkp", 1884 | "tracing", 1885 | ] 1886 | 1887 | [[package]] 1888 | name = "risc0-circuit-rv32im" 1889 | version = "3.0.0" 1890 | source = "registry+https://github.com/rust-lang/crates.io-index" 1891 | checksum = "15030849f8356f01f23c74b37dbfa4283100b594eb634109993e9e005ef45f64" 1892 | dependencies = [ 1893 | "anyhow", 1894 | "bit-vec 0.8.0", 1895 | "bytemuck", 1896 | "derive_more 2.0.1", 1897 | "paste", 1898 | "risc0-binfmt", 1899 | "risc0-core", 1900 | "risc0-zkp", 1901 | "serde", 1902 | "tracing", 1903 | ] 1904 | 1905 | [[package]] 1906 | name = "risc0-core" 1907 | version = "2.0.0" 1908 | source = "registry+https://github.com/rust-lang/crates.io-index" 1909 | checksum = "317bbf70a8750b64d4fd7a2bdc9d7d5f30d8bb305cae486962c797ef35c8d08e" 1910 | dependencies = [ 1911 | "bytemuck", 1912 | "bytemuck_derive", 1913 | "rand_core", 1914 | ] 1915 | 1916 | [[package]] 1917 | name = "risc0-groth16" 1918 | version = "2.0.2" 1919 | source = "registry+https://github.com/rust-lang/crates.io-index" 1920 | checksum = "7cf5d0b673d5fc67a89147c2e9c53134707dcc8137a43d1ef06b4ff68e99b74f" 1921 | dependencies = [ 1922 | "anyhow", 1923 | "ark-bn254", 1924 | "ark-ec", 1925 | "ark-groth16", 1926 | "ark-serialize 0.5.0", 1927 | "bytemuck", 1928 | "hex", 1929 | "num-bigint", 1930 | "num-traits", 1931 | "risc0-binfmt", 1932 | "risc0-zkp", 1933 | "serde", 1934 | "stability", 1935 | ] 1936 | 1937 | [[package]] 1938 | name = "risc0-zkos-v1compat" 1939 | version = "2.0.1" 1940 | source = "registry+https://github.com/rust-lang/crates.io-index" 1941 | checksum = "f76c479b69d1987cb54ac72dcc017197296fdcd6daf78fafc10cbbd3a167a7de" 1942 | dependencies = [ 1943 | "include_bytes_aligned", 1944 | "no_std_strings", 1945 | ] 1946 | 1947 | [[package]] 1948 | name = "risc0-zkp" 1949 | version = "2.0.2" 1950 | source = "registry+https://github.com/rust-lang/crates.io-index" 1951 | checksum = "a287e9cd6d7b3b38eeb49c62090c46a1935922309fbd997a9143ed8c43c8f3cb" 1952 | dependencies = [ 1953 | "anyhow", 1954 | "blake2", 1955 | "borsh", 1956 | "bytemuck", 1957 | "cfg-if", 1958 | "digest 0.10.7", 1959 | "hex", 1960 | "hex-literal", 1961 | "metal", 1962 | "paste", 1963 | "rand_core", 1964 | "risc0-core", 1965 | "risc0-zkvm-platform", 1966 | "serde", 1967 | "sha2", 1968 | "stability", 1969 | "tracing", 1970 | ] 1971 | 1972 | [[package]] 1973 | name = "risc0-zkvm" 1974 | version = "2.2.0" 1975 | source = "registry+https://github.com/rust-lang/crates.io-index" 1976 | checksum = "c59aaf1898f2f5d526a79d53dbe6288aeb1ce52a17184b85af84d06dedb1a367" 1977 | dependencies = [ 1978 | "anyhow", 1979 | "borsh", 1980 | "bytemuck", 1981 | "derive_more 2.0.1", 1982 | "getrandom 0.2.15", 1983 | "hex", 1984 | "risc0-binfmt", 1985 | "risc0-circuit-keccak", 1986 | "risc0-circuit-recursion", 1987 | "risc0-circuit-rv32im", 1988 | "risc0-core", 1989 | "risc0-groth16", 1990 | "risc0-zkos-v1compat", 1991 | "risc0-zkp", 1992 | "risc0-zkvm-platform", 1993 | "rrs-lib", 1994 | "semver 1.0.23", 1995 | "serde", 1996 | "sha2", 1997 | "stability", 1998 | "tracing", 1999 | ] 2000 | 2001 | [[package]] 2002 | name = "risc0-zkvm-platform" 2003 | version = "2.0.3" 2004 | source = "registry+https://github.com/rust-lang/crates.io-index" 2005 | checksum = "cae9cb2c2f6cab2dfa395ea6e2576713929040c7fb0c5f4150d13e1119d18686" 2006 | dependencies = [ 2007 | "bytemuck", 2008 | "cfg-if", 2009 | "getrandom 0.2.15", 2010 | "getrandom 0.3.3", 2011 | "libm", 2012 | "stability", 2013 | ] 2014 | 2015 | [[package]] 2016 | name = "rlp" 2017 | version = "0.5.2" 2018 | source = "registry+https://github.com/rust-lang/crates.io-index" 2019 | checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" 2020 | dependencies = [ 2021 | "bytes", 2022 | "rustc-hex", 2023 | ] 2024 | 2025 | [[package]] 2026 | name = "rrs-lib" 2027 | version = "0.1.0" 2028 | source = "registry+https://github.com/rust-lang/crates.io-index" 2029 | checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" 2030 | dependencies = [ 2031 | "downcast-rs", 2032 | "paste", 2033 | ] 2034 | 2035 | [[package]] 2036 | name = "ruint" 2037 | version = "1.12.3" 2038 | source = "registry+https://github.com/rust-lang/crates.io-index" 2039 | checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" 2040 | dependencies = [ 2041 | "alloy-rlp", 2042 | "ark-ff 0.3.0", 2043 | "ark-ff 0.4.2", 2044 | "bytes", 2045 | "fastrlp", 2046 | "num-bigint", 2047 | "num-traits", 2048 | "parity-scale-codec", 2049 | "primitive-types", 2050 | "proptest", 2051 | "rand", 2052 | "rlp", 2053 | "ruint-macro", 2054 | "serde", 2055 | "valuable", 2056 | "zeroize", 2057 | ] 2058 | 2059 | [[package]] 2060 | name = "ruint-macro" 2061 | version = "1.2.1" 2062 | source = "registry+https://github.com/rust-lang/crates.io-index" 2063 | checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" 2064 | 2065 | [[package]] 2066 | name = "rustc-hash" 2067 | version = "2.0.0" 2068 | source = "registry+https://github.com/rust-lang/crates.io-index" 2069 | checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" 2070 | 2071 | [[package]] 2072 | name = "rustc-hex" 2073 | version = "2.1.0" 2074 | source = "registry+https://github.com/rust-lang/crates.io-index" 2075 | checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" 2076 | 2077 | [[package]] 2078 | name = "rustc_version" 2079 | version = "0.3.3" 2080 | source = "registry+https://github.com/rust-lang/crates.io-index" 2081 | checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" 2082 | dependencies = [ 2083 | "semver 0.11.0", 2084 | ] 2085 | 2086 | [[package]] 2087 | name = "rustc_version" 2088 | version = "0.4.0" 2089 | source = "registry+https://github.com/rust-lang/crates.io-index" 2090 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 2091 | dependencies = [ 2092 | "semver 1.0.23", 2093 | ] 2094 | 2095 | [[package]] 2096 | name = "rusticata-macros" 2097 | version = "4.1.0" 2098 | source = "registry+https://github.com/rust-lang/crates.io-index" 2099 | checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" 2100 | dependencies = [ 2101 | "nom", 2102 | ] 2103 | 2104 | [[package]] 2105 | name = "rustix" 2106 | version = "0.38.34" 2107 | source = "registry+https://github.com/rust-lang/crates.io-index" 2108 | checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" 2109 | dependencies = [ 2110 | "bitflags 2.6.0", 2111 | "errno", 2112 | "libc", 2113 | "linux-raw-sys", 2114 | "windows-sys", 2115 | ] 2116 | 2117 | [[package]] 2118 | name = "rusty-fork" 2119 | version = "0.3.0" 2120 | source = "registry+https://github.com/rust-lang/crates.io-index" 2121 | checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" 2122 | dependencies = [ 2123 | "fnv", 2124 | "quick-error", 2125 | "tempfile", 2126 | "wait-timeout", 2127 | ] 2128 | 2129 | [[package]] 2130 | name = "ryu" 2131 | version = "1.0.18" 2132 | source = "registry+https://github.com/rust-lang/crates.io-index" 2133 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 2134 | 2135 | [[package]] 2136 | name = "sec1" 2137 | version = "0.7.3" 2138 | source = "registry+https://github.com/rust-lang/crates.io-index" 2139 | checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" 2140 | dependencies = [ 2141 | "base16ct", 2142 | "der", 2143 | "generic-array", 2144 | "pkcs8", 2145 | "subtle", 2146 | "zeroize", 2147 | ] 2148 | 2149 | [[package]] 2150 | name = "semver" 2151 | version = "0.11.0" 2152 | source = "registry+https://github.com/rust-lang/crates.io-index" 2153 | checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" 2154 | dependencies = [ 2155 | "semver-parser", 2156 | ] 2157 | 2158 | [[package]] 2159 | name = "semver" 2160 | version = "1.0.23" 2161 | source = "registry+https://github.com/rust-lang/crates.io-index" 2162 | checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" 2163 | dependencies = [ 2164 | "serde", 2165 | ] 2166 | 2167 | [[package]] 2168 | name = "semver-parser" 2169 | version = "0.10.2" 2170 | source = "registry+https://github.com/rust-lang/crates.io-index" 2171 | checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" 2172 | dependencies = [ 2173 | "pest", 2174 | ] 2175 | 2176 | [[package]] 2177 | name = "serde" 2178 | version = "1.0.201" 2179 | source = "registry+https://github.com/rust-lang/crates.io-index" 2180 | checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" 2181 | dependencies = [ 2182 | "serde_derive", 2183 | ] 2184 | 2185 | [[package]] 2186 | name = "serde_derive" 2187 | version = "1.0.201" 2188 | source = "registry+https://github.com/rust-lang/crates.io-index" 2189 | checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" 2190 | dependencies = [ 2191 | "proc-macro2", 2192 | "quote", 2193 | "syn 2.0.87", 2194 | ] 2195 | 2196 | [[package]] 2197 | name = "serde_json" 2198 | version = "1.0.117" 2199 | source = "registry+https://github.com/rust-lang/crates.io-index" 2200 | checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" 2201 | dependencies = [ 2202 | "itoa", 2203 | "ryu", 2204 | "serde", 2205 | ] 2206 | 2207 | [[package]] 2208 | name = "sha2" 2209 | version = "0.10.8" 2210 | source = "git+https://github.com/risc0/RustCrypto-hashes?tag=sha2-v0.10.8-risczero.0#244dc3b08788f7a4ccce14c66896ae3b4f24c166" 2211 | dependencies = [ 2212 | "cfg-if", 2213 | "cpufeatures", 2214 | "digest 0.10.7", 2215 | ] 2216 | 2217 | [[package]] 2218 | name = "sha3" 2219 | version = "0.10.8" 2220 | source = "registry+https://github.com/rust-lang/crates.io-index" 2221 | checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" 2222 | dependencies = [ 2223 | "digest 0.10.7", 2224 | "keccak", 2225 | ] 2226 | 2227 | [[package]] 2228 | name = "sha3-asm" 2229 | version = "0.1.4" 2230 | source = "registry+https://github.com/rust-lang/crates.io-index" 2231 | checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" 2232 | dependencies = [ 2233 | "cc", 2234 | "cfg-if", 2235 | ] 2236 | 2237 | [[package]] 2238 | name = "signature" 2239 | version = "2.2.0" 2240 | source = "registry+https://github.com/rust-lang/crates.io-index" 2241 | checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" 2242 | dependencies = [ 2243 | "digest 0.10.7", 2244 | "rand_core", 2245 | ] 2246 | 2247 | [[package]] 2248 | name = "spin" 2249 | version = "0.9.8" 2250 | source = "registry+https://github.com/rust-lang/crates.io-index" 2251 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 2252 | 2253 | [[package]] 2254 | name = "spki" 2255 | version = "0.7.3" 2256 | source = "registry+https://github.com/rust-lang/crates.io-index" 2257 | checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" 2258 | dependencies = [ 2259 | "base64ct", 2260 | "der", 2261 | ] 2262 | 2263 | [[package]] 2264 | name = "stability" 2265 | version = "0.2.1" 2266 | source = "registry+https://github.com/rust-lang/crates.io-index" 2267 | checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" 2268 | dependencies = [ 2269 | "quote", 2270 | "syn 2.0.87", 2271 | ] 2272 | 2273 | [[package]] 2274 | name = "static_assertions" 2275 | version = "1.1.0" 2276 | source = "registry+https://github.com/rust-lang/crates.io-index" 2277 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 2278 | 2279 | [[package]] 2280 | name = "subtle" 2281 | version = "2.5.0" 2282 | source = "registry+https://github.com/rust-lang/crates.io-index" 2283 | checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" 2284 | 2285 | [[package]] 2286 | name = "syn" 2287 | version = "1.0.109" 2288 | source = "registry+https://github.com/rust-lang/crates.io-index" 2289 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 2290 | dependencies = [ 2291 | "proc-macro2", 2292 | "quote", 2293 | "unicode-ident", 2294 | ] 2295 | 2296 | [[package]] 2297 | name = "syn" 2298 | version = "2.0.87" 2299 | source = "registry+https://github.com/rust-lang/crates.io-index" 2300 | checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" 2301 | dependencies = [ 2302 | "proc-macro2", 2303 | "quote", 2304 | "unicode-ident", 2305 | ] 2306 | 2307 | [[package]] 2308 | name = "syn-solidity" 2309 | version = "0.8.12" 2310 | source = "registry+https://github.com/rust-lang/crates.io-index" 2311 | checksum = "f76fe0a3e1476bdaa0775b9aec5b869ed9520c2b2fedfe9c6df3618f8ea6290b" 2312 | dependencies = [ 2313 | "paste", 2314 | "proc-macro2", 2315 | "quote", 2316 | "syn 2.0.87", 2317 | ] 2318 | 2319 | [[package]] 2320 | name = "synstructure" 2321 | version = "0.12.6" 2322 | source = "registry+https://github.com/rust-lang/crates.io-index" 2323 | checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" 2324 | dependencies = [ 2325 | "proc-macro2", 2326 | "quote", 2327 | "syn 1.0.109", 2328 | "unicode-xid", 2329 | ] 2330 | 2331 | [[package]] 2332 | name = "tap" 2333 | version = "1.0.1" 2334 | source = "registry+https://github.com/rust-lang/crates.io-index" 2335 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 2336 | 2337 | [[package]] 2338 | name = "tempfile" 2339 | version = "3.11.0" 2340 | source = "registry+https://github.com/rust-lang/crates.io-index" 2341 | checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" 2342 | dependencies = [ 2343 | "cfg-if", 2344 | "fastrand", 2345 | "once_cell", 2346 | "rustix", 2347 | "windows-sys", 2348 | ] 2349 | 2350 | [[package]] 2351 | name = "thiserror" 2352 | version = "1.0.60" 2353 | source = "registry+https://github.com/rust-lang/crates.io-index" 2354 | checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" 2355 | dependencies = [ 2356 | "thiserror-impl", 2357 | ] 2358 | 2359 | [[package]] 2360 | name = "thiserror-impl" 2361 | version = "1.0.60" 2362 | source = "registry+https://github.com/rust-lang/crates.io-index" 2363 | checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" 2364 | dependencies = [ 2365 | "proc-macro2", 2366 | "quote", 2367 | "syn 2.0.87", 2368 | ] 2369 | 2370 | [[package]] 2371 | name = "time" 2372 | version = "0.3.36" 2373 | source = "registry+https://github.com/rust-lang/crates.io-index" 2374 | checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" 2375 | dependencies = [ 2376 | "deranged", 2377 | "itoa", 2378 | "num-conv", 2379 | "powerfmt", 2380 | "serde", 2381 | "time-core", 2382 | "time-macros", 2383 | ] 2384 | 2385 | [[package]] 2386 | name = "time-core" 2387 | version = "0.1.2" 2388 | source = "registry+https://github.com/rust-lang/crates.io-index" 2389 | checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" 2390 | 2391 | [[package]] 2392 | name = "time-macros" 2393 | version = "0.2.18" 2394 | source = "registry+https://github.com/rust-lang/crates.io-index" 2395 | checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" 2396 | dependencies = [ 2397 | "num-conv", 2398 | "time-core", 2399 | ] 2400 | 2401 | [[package]] 2402 | name = "tiny-keccak" 2403 | version = "2.0.2" 2404 | source = "registry+https://github.com/rust-lang/crates.io-index" 2405 | checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" 2406 | dependencies = [ 2407 | "crunchy", 2408 | ] 2409 | 2410 | [[package]] 2411 | name = "toml_datetime" 2412 | version = "0.6.8" 2413 | source = "registry+https://github.com/rust-lang/crates.io-index" 2414 | checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" 2415 | 2416 | [[package]] 2417 | name = "toml_edit" 2418 | version = "0.22.22" 2419 | source = "registry+https://github.com/rust-lang/crates.io-index" 2420 | checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" 2421 | dependencies = [ 2422 | "indexmap", 2423 | "toml_datetime", 2424 | "winnow", 2425 | ] 2426 | 2427 | [[package]] 2428 | name = "tracing" 2429 | version = "0.1.40" 2430 | source = "registry+https://github.com/rust-lang/crates.io-index" 2431 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 2432 | dependencies = [ 2433 | "log", 2434 | "pin-project-lite", 2435 | "tracing-attributes", 2436 | "tracing-core", 2437 | ] 2438 | 2439 | [[package]] 2440 | name = "tracing-attributes" 2441 | version = "0.1.27" 2442 | source = "registry+https://github.com/rust-lang/crates.io-index" 2443 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 2444 | dependencies = [ 2445 | "proc-macro2", 2446 | "quote", 2447 | "syn 2.0.87", 2448 | ] 2449 | 2450 | [[package]] 2451 | name = "tracing-core" 2452 | version = "0.1.32" 2453 | source = "registry+https://github.com/rust-lang/crates.io-index" 2454 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 2455 | dependencies = [ 2456 | "once_cell", 2457 | "valuable", 2458 | ] 2459 | 2460 | [[package]] 2461 | name = "tracing-subscriber" 2462 | version = "0.2.25" 2463 | source = "registry+https://github.com/rust-lang/crates.io-index" 2464 | checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" 2465 | dependencies = [ 2466 | "tracing-core", 2467 | ] 2468 | 2469 | [[package]] 2470 | name = "typenum" 2471 | version = "1.17.0" 2472 | source = "registry+https://github.com/rust-lang/crates.io-index" 2473 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 2474 | 2475 | [[package]] 2476 | name = "ucd-trie" 2477 | version = "0.1.7" 2478 | source = "registry+https://github.com/rust-lang/crates.io-index" 2479 | checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" 2480 | 2481 | [[package]] 2482 | name = "uint" 2483 | version = "0.9.5" 2484 | source = "registry+https://github.com/rust-lang/crates.io-index" 2485 | checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" 2486 | dependencies = [ 2487 | "byteorder", 2488 | "crunchy", 2489 | "hex", 2490 | "static_assertions", 2491 | ] 2492 | 2493 | [[package]] 2494 | name = "unarray" 2495 | version = "0.1.4" 2496 | source = "registry+https://github.com/rust-lang/crates.io-index" 2497 | checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" 2498 | 2499 | [[package]] 2500 | name = "unicode-ident" 2501 | version = "1.0.12" 2502 | source = "registry+https://github.com/rust-lang/crates.io-index" 2503 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 2504 | 2505 | [[package]] 2506 | name = "unicode-xid" 2507 | version = "0.2.4" 2508 | source = "registry+https://github.com/rust-lang/crates.io-index" 2509 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 2510 | 2511 | [[package]] 2512 | name = "valuable" 2513 | version = "0.1.0" 2514 | source = "registry+https://github.com/rust-lang/crates.io-index" 2515 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 2516 | 2517 | [[package]] 2518 | name = "version_check" 2519 | version = "0.9.4" 2520 | source = "registry+https://github.com/rust-lang/crates.io-index" 2521 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 2522 | 2523 | [[package]] 2524 | name = "wait-timeout" 2525 | version = "0.2.0" 2526 | source = "registry+https://github.com/rust-lang/crates.io-index" 2527 | checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" 2528 | dependencies = [ 2529 | "libc", 2530 | ] 2531 | 2532 | [[package]] 2533 | name = "wasi" 2534 | version = "0.11.0+wasi-snapshot-preview1" 2535 | source = "registry+https://github.com/rust-lang/crates.io-index" 2536 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2537 | 2538 | [[package]] 2539 | name = "wasi" 2540 | version = "0.14.2+wasi-0.2.4" 2541 | source = "registry+https://github.com/rust-lang/crates.io-index" 2542 | checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" 2543 | dependencies = [ 2544 | "wit-bindgen-rt", 2545 | ] 2546 | 2547 | [[package]] 2548 | name = "wasm-bindgen" 2549 | version = "0.2.92" 2550 | source = "registry+https://github.com/rust-lang/crates.io-index" 2551 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 2552 | dependencies = [ 2553 | "cfg-if", 2554 | "wasm-bindgen-macro", 2555 | ] 2556 | 2557 | [[package]] 2558 | name = "wasm-bindgen-backend" 2559 | version = "0.2.92" 2560 | source = "registry+https://github.com/rust-lang/crates.io-index" 2561 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 2562 | dependencies = [ 2563 | "bumpalo", 2564 | "log", 2565 | "once_cell", 2566 | "proc-macro2", 2567 | "quote", 2568 | "syn 2.0.87", 2569 | "wasm-bindgen-shared", 2570 | ] 2571 | 2572 | [[package]] 2573 | name = "wasm-bindgen-macro" 2574 | version = "0.2.92" 2575 | source = "registry+https://github.com/rust-lang/crates.io-index" 2576 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 2577 | dependencies = [ 2578 | "quote", 2579 | "wasm-bindgen-macro-support", 2580 | ] 2581 | 2582 | [[package]] 2583 | name = "wasm-bindgen-macro-support" 2584 | version = "0.2.92" 2585 | source = "registry+https://github.com/rust-lang/crates.io-index" 2586 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 2587 | dependencies = [ 2588 | "proc-macro2", 2589 | "quote", 2590 | "syn 2.0.87", 2591 | "wasm-bindgen-backend", 2592 | "wasm-bindgen-shared", 2593 | ] 2594 | 2595 | [[package]] 2596 | name = "wasm-bindgen-shared" 2597 | version = "0.2.92" 2598 | source = "registry+https://github.com/rust-lang/crates.io-index" 2599 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 2600 | 2601 | [[package]] 2602 | name = "windows-core" 2603 | version = "0.52.0" 2604 | source = "registry+https://github.com/rust-lang/crates.io-index" 2605 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 2606 | dependencies = [ 2607 | "windows-targets", 2608 | ] 2609 | 2610 | [[package]] 2611 | name = "windows-sys" 2612 | version = "0.52.0" 2613 | source = "registry+https://github.com/rust-lang/crates.io-index" 2614 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 2615 | dependencies = [ 2616 | "windows-targets", 2617 | ] 2618 | 2619 | [[package]] 2620 | name = "windows-targets" 2621 | version = "0.52.5" 2622 | source = "registry+https://github.com/rust-lang/crates.io-index" 2623 | checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" 2624 | dependencies = [ 2625 | "windows_aarch64_gnullvm", 2626 | "windows_aarch64_msvc", 2627 | "windows_i686_gnu", 2628 | "windows_i686_gnullvm", 2629 | "windows_i686_msvc", 2630 | "windows_x86_64_gnu", 2631 | "windows_x86_64_gnullvm", 2632 | "windows_x86_64_msvc", 2633 | ] 2634 | 2635 | [[package]] 2636 | name = "windows_aarch64_gnullvm" 2637 | version = "0.52.5" 2638 | source = "registry+https://github.com/rust-lang/crates.io-index" 2639 | checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" 2640 | 2641 | [[package]] 2642 | name = "windows_aarch64_msvc" 2643 | version = "0.52.5" 2644 | source = "registry+https://github.com/rust-lang/crates.io-index" 2645 | checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" 2646 | 2647 | [[package]] 2648 | name = "windows_i686_gnu" 2649 | version = "0.52.5" 2650 | source = "registry+https://github.com/rust-lang/crates.io-index" 2651 | checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" 2652 | 2653 | [[package]] 2654 | name = "windows_i686_gnullvm" 2655 | version = "0.52.5" 2656 | source = "registry+https://github.com/rust-lang/crates.io-index" 2657 | checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" 2658 | 2659 | [[package]] 2660 | name = "windows_i686_msvc" 2661 | version = "0.52.5" 2662 | source = "registry+https://github.com/rust-lang/crates.io-index" 2663 | checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" 2664 | 2665 | [[package]] 2666 | name = "windows_x86_64_gnu" 2667 | version = "0.52.5" 2668 | source = "registry+https://github.com/rust-lang/crates.io-index" 2669 | checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" 2670 | 2671 | [[package]] 2672 | name = "windows_x86_64_gnullvm" 2673 | version = "0.52.5" 2674 | source = "registry+https://github.com/rust-lang/crates.io-index" 2675 | checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" 2676 | 2677 | [[package]] 2678 | name = "windows_x86_64_msvc" 2679 | version = "0.52.5" 2680 | source = "registry+https://github.com/rust-lang/crates.io-index" 2681 | checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" 2682 | 2683 | [[package]] 2684 | name = "winnow" 2685 | version = "0.6.20" 2686 | source = "registry+https://github.com/rust-lang/crates.io-index" 2687 | checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" 2688 | dependencies = [ 2689 | "memchr", 2690 | ] 2691 | 2692 | [[package]] 2693 | name = "wit-bindgen-rt" 2694 | version = "0.39.0" 2695 | source = "registry+https://github.com/rust-lang/crates.io-index" 2696 | checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" 2697 | dependencies = [ 2698 | "bitflags 2.6.0", 2699 | ] 2700 | 2701 | [[package]] 2702 | name = "wyz" 2703 | version = "0.5.1" 2704 | source = "registry+https://github.com/rust-lang/crates.io-index" 2705 | checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 2706 | dependencies = [ 2707 | "tap", 2708 | ] 2709 | 2710 | [[package]] 2711 | name = "x509-parser" 2712 | version = "0.15.1" 2713 | source = "registry+https://github.com/rust-lang/crates.io-index" 2714 | checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" 2715 | dependencies = [ 2716 | "asn1-rs", 2717 | "data-encoding", 2718 | "der-parser", 2719 | "lazy_static", 2720 | "nom", 2721 | "oid-registry", 2722 | "rusticata-macros", 2723 | "thiserror", 2724 | "time", 2725 | ] 2726 | 2727 | [[package]] 2728 | name = "zerocopy" 2729 | version = "0.7.34" 2730 | source = "registry+https://github.com/rust-lang/crates.io-index" 2731 | checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" 2732 | dependencies = [ 2733 | "zerocopy-derive", 2734 | ] 2735 | 2736 | [[package]] 2737 | name = "zerocopy-derive" 2738 | version = "0.7.34" 2739 | source = "registry+https://github.com/rust-lang/crates.io-index" 2740 | checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" 2741 | dependencies = [ 2742 | "proc-macro2", 2743 | "quote", 2744 | "syn 2.0.87", 2745 | ] 2746 | 2747 | [[package]] 2748 | name = "zeroize" 2749 | version = "1.7.0" 2750 | source = "registry+https://github.com/rust-lang/crates.io-index" 2751 | checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" 2752 | dependencies = [ 2753 | "zeroize_derive", 2754 | ] 2755 | 2756 | [[package]] 2757 | name = "zeroize_derive" 2758 | version = "1.4.2" 2759 | source = "registry+https://github.com/rust-lang/crates.io-index" 2760 | checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" 2761 | dependencies = [ 2762 | "proc-macro2", 2763 | "quote", 2764 | "syn 2.0.87", 2765 | ] 2766 | --------------------------------------------------------------------------------