diff --git a/Cargo.lock b/Cargo.lock index d3898e49..23fee397 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4389,11 +4389,11 @@ dependencies = [ [[package]] name = "keccak" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e24a010dd405bd7ed803e5253182815b41bf2e6a80cc3bfc066658e03a198aa" +source = "git+https://github.com/logos-blockchain/sponges?rev=16ac194828f8e25e5eaf38d33970b4515e13b676#16ac194828f8e25e5eaf38d33970b4515e13b676" dependencies = [ "cfg-if", "cpufeatures 0.3.0", + "risc0-zkvm", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 25f03774..8ce9989d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,8 +92,9 @@ tokio = { version = "1.50", features = [ "fs", ] } tokio-util = "0.7.18" -risc0-zkvm = { version = "3.0.5", default-features = false, features = ['std'] } -risc0-build = "3.0.5" +# Unstable fearture needed for keccak optimization +risc0-zkvm = { version = "3.0.5", default-features = false, features = ['std', 'unstable'] } +risc0-build = { version = "3.0.5", features = ['unstable'] } anyhow = "1.0.98" derive_more = "2.1.1" num_cpus = "1.13.1" @@ -178,6 +179,10 @@ opt-level = 'z' lto = true codegen-units = 1 +# Keccak speedup for in-guest ML KEM +[patch.crates-io] +keccak = { git = "https://github.com/logos-blockchain/sponges", rev = "16ac194828f8e25e5eaf38d33970b4515e13b676" } + # Keep backtraces but drop full DWARF type info to avoid LLD OOM/SIGBUS when # linking large integration-test binaries on resource-constrained CI runners. [profile.dev] @@ -323,4 +328,4 @@ clippy.cargo = { level = "deny", priority = -1 } clippy.cargo-common-metadata = "allow" # Reason: hard to address right now and mostly comes from dependencies # so the fix would be just a long list of exceptions. -clippy.multiple-crate-versions = "allow" +clippy.multiple-crate-versions = "allow" \ No newline at end of file