Allow creation of opaque custom predicate batch (#427)

This is useful for a verifier that wants to verify a MainPod that
contains a custom predicate in a public statement without
knowledge of how the custom predicate is defined.
This commit is contained in:
Eduard S. 2025-09-26 12:47:00 +02:00 committed by GitHub
parent 5a80fba618
commit 352b1fdac1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -404,6 +404,14 @@ impl CustomPredicateBatch {
Arc::new(cpb)
}
pub fn new_opaque(name: String, id: Hash) -> Arc<Self> {
Arc::new(Self {
id,
name,
predicates: vec![],
})
}
/// Cryptographic identifier for the batch.
fn calculate_id(&self, params: &Params) -> Hash {
// NOTE: This implementation just hashes the concatenation of all the custom predicates,