Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
45a14c7
refactor(stm): rename IVC circuit degree constant K to RECURSIVE_CIRC…
hjeljeli32 Jun 19, 2026
d5408b5
refactor(stm): relocate and rename shared PLONK key aliases to PlonkV…
hjeljeli32 Jun 19, 2026
3519d04
feat(stm): add CircuitKeySerialization trait and key serde for both c…
hjeljeli32 Jun 19, 2026
7adc104
feat(stm): give CircuitKeyCache typed key access and wire the SNARK s…
hjeljeli32 Jun 19, 2026
d084bae
refactor(stm): rename certificate snark setup module and drop test-on…
hjeljeli32 Jun 21, 2026
ad71e77
refactor(stm): rename SnarkSetup to SnarkProverSetup
hjeljeli32 Jun 21, 2026
3d9c0b5
test(stm): isolate test key caches per test via current_function!
hjeljeli32 Jun 22, 2026
0a98763
refactor(stm): apply first round of review feedback on the SNARK setup
hjeljeli32 Jun 23, 2026
0fe7e59
test(stm): apply second round of review feedback on the SNARK setup
hjeljeli32 Jun 23, 2026
be8f92a
refactor(stm): turn the circuit key cache into a verification key pro…
hjeljeli32 Jun 25, 2026
c1cb344
refactor(stm): compute the certificate key through the verification k…
hjeljeli32 Jun 25, 2026
d669da4
refactor(stm): rename IvcProverSetup to IvcSnarkProverSetup and use t…
hjeljeli32 Jun 26, 2026
f59df42
test(stm): share a content-keyed key cache across the slow tests
hjeljeli32 Jun 26, 2026
38ce2e2
refactor(stm): share the certificate test key and clarify setup naming
hjeljeli32 Jun 26, 2026
ec30b96
refactor(stm): address review comments
hjeljeli32 Jun 29, 2026
f2691d2
refactor(stm): adopt the reviewed circuit verification key provider
hjeljeli32 Jun 29, 2026
f644755
refactor(stm): relocate circuit verification key provider factories
hjeljeli32 Jun 29, 2026
0501602
refactor(stm): replace raw SNARK keys with per-circuit key newtypes
hjeljeli32 Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mithril-stm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ rug = { version = "1.30.0", optional = true }
[dev-dependencies]
blake2b_simd = "1.0.4"
criterion = { version = "0.8.2", features = ["html_reports"] }
fs2 = "0.4.3"
httpmock = "0.8.3"
num-bigint = "0.4.6"
num-rational = "0.4.2"
Expand Down
25 changes: 25 additions & 0 deletions mithril-stm/src/circuits/circuit_key_generator.rs
Comment thread
hjeljeli32 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Lets each circuit derive its own verifying and proving keys from an SRS, so the verification key
// provider can compute keys on a cache miss without a separate generator type.
use midnight_curves::Bls12;
use midnight_proofs::poly::kzg::params::ParamsKZG;

use crate::{
StmResult,
codec::{TryFromBytes, TryToBytes},
};

/// A circuit that can generate its verifying and proving keys from a sufficiently sized SRS.
pub(crate) trait CircuitKeyGenerator {
/// Verifying key; round-trips through bytes and is cloneable for caching.
type VerifyingKey: TryFromBytes + TryToBytes + Clone;
/// Proving key; round-trips through bytes.
type ProvingKey: TryFromBytes + TryToBytes;

/// Derives the verifying and proving keys from a sufficiently sized `srs`: it uses `srs` directly
/// when already at the circuit's relation degree, and otherwise downsizes a clone to that degree,
/// never mutating the caller's SRS.
fn generate_key_pair(
&self,
srs: &ParamsKZG<Bls12>,
) -> StmResult<(Self::VerifyingKey, Self::ProvingKey)>;
}
Loading
Loading